Commit Graph

47827 Commits

Author SHA1 Message Date
Marek Olšák c9f2af3df7 gallium: expose ARB_map_buffer_alignment on Radeon
Reviewed-by: Brian Paul <brianp@vmware.com>

v2: update relnotes-9.1
v3: use align_malloc and align_free for malloced buffers in r300g
v4: document the new CAP in the docs
2012-10-31 01:53:50 +01:00
Marek Olšák f2f782d50f mesa: implement ARB_map_buffer_alignment
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 01:48:40 +01:00
Marek Olšák 0ebd0b78c6 st/mesa: don't use _NEW_PROGRAM where ST_NEW_xxx_PROGRAM is sufficient
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 01:44:58 +01:00
Marek Olšák c0c26ddaef r600g: use better sample positions for 8x MSAA
Taken from the intel driver. The sample positions are actually a solution
to the 8 queens puzzle.  It gives more accurate and smoother AA.
2012-10-31 00:55:23 +01:00
Marek Olšák e73bf3b805 gallium: add start_slot parameter to set_vertex_buffers
This allows updating only a subrange of buffer bindings.

set_vertex_buffers(pipe, start_slot, count, NULL) unbinds buffers in that
range. Binding NULL resources unbinds buffers too (both buffer and user_buffer
must be NULL).

The meta ops are adapted to only save, change, and restore the single slot
they use. The cso_context can save and restore only one vertex buffer slot.
The clients can query which one it is using cso_get_aux_vertex_buffer_slot.
It's currently set to 0. (the Draw module breaks if it's set to non-zero)

It should decrease the CPU overhead when using a lot of meta ops, but
the drivers must be able to treat each vertex buffer slot as a separate
state (only r600g does so at the moment).

I can imagine this also being useful for optimizing some OpenGL use cases.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 00:55:13 +01:00
Marvin Schmidt a7c5be098a st/xorg: Remove superfluous miInitializeBackingStore() call
It was defined as an empty function since Nov 2010 and was ultimately
removed completely.

See xserver commit 1cb0261

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-10-30 11:36:31 +01:00
Vinson Lee 0a66ced8f8 xlib: Do not undefine _R, _G, and _B.
Fixes build error on Cygwin and Solaris. _R, _G, and _B are used in
ctype.h on those platforms.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-29 22:25:56 -07:00
Brian Paul aab0ea9352 mesa: remove array size so the static assert can work
With the explit NUM_TEXTURE_TARGETS array size, the assertion that
Elements(targets) == NUM_TEXTURE_TARGETS would pass even if elements
were missing.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-29 17:56:05 -06:00
Brian Paul 1e46d810c8 mesa: use GLuint for more gl_constants fields
To silence assorted MSVC warnings.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:05 -06:00
Brian Paul ec5341800b vbo: silence MSVC double/float conversion warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:05 -06:00
Brian Paul f6c83e1661 mesa: silence some MSVC conversion warnings in get.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:05 -06:00
Brian Paul 06bb81f01d mesa: silence MSVC signed/unsigned comparision warnings in hash_table.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul 8e45e38512 mesa: silence MSVC signed/unsigned comparision warnings in transformfeedback.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul 03503daa21 mesa: silence MSVC signed/unsigned comparision warnings in accum.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul db0136ae3e mesa: silence MSVC signed/unsigned comparison warning in texstorage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul 298d7a20e1 mesa: silence MSVC double/float assignment warnings in pixel unpack code
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Vincent Lejeune 5ab82e0ccf r600g: tgsi-to-llvm emits right input intrinsics
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-10-30 00:28:42 +01:00
Tapani Pälli e4e3b07181 intel: support for 16 bit config with 24 depth and 8 stencil
Patch adds additional singlesample config with 565 color buffer,
24 bit depth and 8 bit stencil buffer. This makes Quadrant benchmark
work on Android. Tested with Sandybridge and Ivybridge machines.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-29 11:58:47 -07:00
Ian Romanick e8f2bec25e dri: Support MESA_FORMAT_SARGB8 in driCreateConfigs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:56 -07:00
Ian Romanick 749ac8b73a intel: If the visual is sRGB, use an sRGB internal format
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:53 -07:00
Ian Romanick 1f6e10f67b dri: Convert driCreateConfigs to use a gl_format enum
This is instead of the pair of GLenums for format and type that were
previously used.  This is necessary for the Intel drivers to expose sRGB
framebuffer formats.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-29 09:55:42 -07:00
Ian Romanick 43d6fe156b dri_util: Elminiate the bytes_per_pixel table
With fewer formats to support, it's kind of useless.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:38 -07:00
Ian Romanick bda208a4d4 dri_util: Remove support for RGB332 framebuffers
None of the remaining DRI drivers in Mesa use this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:32 -07:00
Ian Romanick 0398a26097 swrast: Remove the 2_3_3_REV framebuffer format
There is no gl_format in Mesa that corresponds to this arrangement, so I
have a very hard time believing that this works.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:27 -07:00
Ian Romanick 386282b5c2 glx: Add the extension string for GLX_ARB_framebuffer_sRGB
From the GLX perspective, the ARB and EXT extensions are identical.  Use
a single bit for both.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
2012-10-29 09:55:23 -07:00
Ian Romanick 7b0f912e70 glx: Set sRGBCapable to a default value
Previously, if the server didn't send a GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT
tag, it would still be set to GLX_DONT_CARE (which is -1).  Set it to
GL_FALSE instead.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
2012-10-29 09:55:15 -07:00
Bryan Cain 170f0459a2 glsl_to_tgsi: set correct register type for array and structure elements
This fixes an issue where glsl_to_tgsi_visior::get_opcode() would emit the
wrong opcode because the register type was GLSL_TYPE_ARRAY/STRUCT instead of
GLSL_TYPE_FLOAT/INT/UINT/BOOL, so the function would use the float opcodes for
operations on integer or boolean values dereferenced from an array or
structure.  Assertions have been added to get_opcode() to prevent this bug
from reappearing in the future.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-29 15:49:00 +01:00
Marek Olšák 96ed6c90ef r600g: implement texturing with 8x MSAA compressed surfaces for Evergreen
The 2x and 4x MSAA cases are completely broken. The lfdptr instruction returns
garbage there.

The 8x MSAA case is broken on Cayman, though at least the result looks somewhat
correct.

Only the 8x MSAA case works on Evergreen and is enabled.
2012-10-29 12:51:41 +01:00
Marek Olšák b3921e1f53 mesa: bump MAX_VARYING to 32
We're starting to get apps utilizing more than 16 varyings and
most current hardware supports 32 anyway.

Tested with r600g.
swrast, softpipe and llvmpipe still advertise 16 varyings.

This fixes a WebGL crash after launching this demo:
https://developer.mozilla.org/en-US/demos/detail/falling-cubes

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54402

NOTE: This is a candidate for the stable branches.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 12:51:41 +01:00
Andreas Boll 00e6819e99 Revert "glsl_to_tgsi: set correct register type for array and structure elements"
This reverts commit ebd8df7a31.

accidentally pushed.
2012-10-29 12:21:07 +01:00
Christoph Bumiller 9ae7d8bb79 nv50/ir: restore use of long immediate encodings
NOTE: This is a candidate for the 9.0 branch.
2012-10-28 14:57:20 +01:00
Christoph Bumiller 351d3c59f2 nv50,nvc0: fix 2d engine stencil-only copies 2012-10-28 14:25:56 +01:00
Alexander V. Nikolaev eaa8e56108 gallium/gallivm: code generation options for LLVM 3.1+
LLVM 3.1+ haven't more "extern unsigned llvm::StackAlignmentOverride"
and friends for configuring code generation options, like stack
alignment.

So I restrict assiging of lvm::StackAlignmentOverride and other
variables to LLVM 3.0 only, and wrote similiar code using
TargetOptions.

This patch fix segfaulting of WINE using llvmpipe built with LLVM 3.1

Signed-off-by: Alexander V. Nikolaev <avn@daemon.hole.ru>
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-10-28 10:34:26 +00:00
Eric Anholt 459b28aba7 i965: Merge brw_prepare_query_begin() and brw_emit_query_begin().
This is a leftover from when we had to split those two functions due to
the separate BO validation step.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-26 12:41:54 -07:00
Eric Anholt 99dc870613 i965: Rename misleading "active" field of brw->query.
"Active" is an already-used term for the query being between
glBeginQuery() and glEndQuery(), while this is tracking whether the
start of the packet pair for emitting state has been inserted into the
current batchbuffer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-26 12:41:01 -07:00
Marek Olšák b78b62497f r600g: advertise 32 streamout vec4 outputs
to match the varying limit.
2012-10-26 19:01:16 +02:00
Brian Paul 80bc3206aa softpipe: remove extraneous whitespace 2012-10-26 10:59:29 -06:00
Brian Paul 369b5a311c gallivm/llvmpipe: fix 64-bit %ll format compiler warnings for mingw32
Use the PRIx64 and PRIu64 format macros from inttypes.h.  We made a
similar change in prog_print.c in df2d81ea59.
2012-10-26 10:59:29 -06:00
Marek Olšák 8b63512be0 r600g: advertise 32 fragment shaders inputs, not 34 2012-10-26 18:01:14 +02:00
José Fonseca 8eb2b331ef graw/fs-test: Use user constant buffers.
Much simpler. More interesting.
2012-10-26 16:02:59 +01:00
José Fonseca ce10624e9e trace: Flush before drawing. 2012-10-26 16:02:59 +01:00
José Fonseca 91332e455a graw: Ensure new members are zeroed.
Several new state members were added, and they were not being zeroed,
causing random crashes.
2012-10-26 16:02:59 +01:00
José Fonseca 2532f0d063 tests/graw: Update occlusion query example. 2012-10-26 16:02:58 +01:00
Michel Dänzer 97078b198d radeonsi: Handle TGSI_SEMANTIC_FACE.
Fixes two piglit tests using gl_FrontFacing.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:18 +02:00
Michel Dänzer 691f08dbea radeonsi: Handle TGSI_SEMANTIC_BCOLOR.
Put the back face colour right after the front face colour in the LDS parameter
space.

Fixes 18 piglit tests related to two sided lighting.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Michel Dänzer 44ef033c25 radeonsi: Don't snoop context state while building shaders.
Let's use the shader key describing the state.

Ported from r600g commit b652180107.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Michel Dänzer f3257d80b0 radeon/llvm: Add intrinsic for reading SI FRONT_FACE VGPR in the pixel shader.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Alex Deucher bd274eb8f4 r600g: split cayman common state out into a shared function
And use it for compute.  This should improve compute support
on cayman.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:33:32 -04:00
Alex Deucher 67c875117c r600g: emit some additional regs on cayman
These are common to both evergreen and cayman, but were
not emitted on cayman.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:33:06 -04:00
Alex Deucher d781f0c73c r600g: there are 16 const buffer size regs for each shader stage
we were previously only setting 8 of them.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:32:55 -04:00
Alex Deucher 20d268b350 r600g: rework evergreen_init_common_regs()
Move gfx specific bits out as the code is shared with
compute.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:32:40 -04:00
Alex Deucher 480e146305 r600g/compute: always CONTEXT_CONTROL packet at start of CS
It's required.  The CP uses this to properly allocate new
contexts.  Also do a CS partial flush since we are updating
CONFIG regs which are single state.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:32:33 -04:00
José Fonseca 4a93414985 tools/trace: More helpful message when no args are provided. 2012-10-26 10:50:48 +01:00
José Fonseca 54536686b2 scons: Build xlib swrast too.
Helpful for debugging.
2012-10-26 10:50:48 +01:00
Christian König 59d4bc8c48 vl: fix the dri winsys helper screen init
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-10-26 09:53:04 +02:00
Vinson Lee 8cb2a4a7f5 tests: Use printf instead of debug_printf in u_format_compatible_test.
Use printf instead of debug_printf to be consistent with print
statements in rest of unit tests.

This also fixes the lack of print output with the MinGW build of
u_format_compatible_test.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-25 23:09:59 -07:00
Marek Olšák 8fb4b1dce1 r300g: fix texture border color for sRGB formats
NOTE: This is a candidate for the stable branches.
2012-10-26 01:27:05 +02:00
Kenneth Graunke b45a68eebf glsl: Allow ir_if in the linker's move_non_declarations function.
Global initializers using the ?: operator with at least one non-constant
operand generate ir_if statements.  For example,

   float foo = some_boolean ? 0.0 : 1.0;

becomes:

   (declare (temporary) float conditional_tmp)
   (if (var_ref some_boolean)
       ((assign (x) (var_ref conditional_tmp) (constant float (0.0))))
       ((assign (x) (var_ref conditional_tmp) (constant float (1.0)))))

This pattern is necessary because the second or third arguments could be
function calls, which create statements (not expressions).

The linker moves these global initializers into the main() function.
However, it incorrectly had an assertion that global initializer
statements were only assignments, calls, or temporary variable
declarations.  As demonstrated above, they can be if statements too.

Other than the assertion, everything works fine.  So remove it.

Fixes new Piglit test condition-08.vert, as well as an upcoming
game that will be released on Steam.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:53:39 -07:00
Kenneth Graunke 03ea156f1b i965/vs: Preserve the type when copy propagating into an instruction.
Consider the following code, which reinterprets a register as a
different type:

mov(8)          g6<1>F          g1.4<0,4,1>.xF
and(8)          g5<1>.xUD       g6<4,4,1>.xUD   0x7fffffffUD

Copy propagation would notice that we can replace the use of g6 with
g1.4 and eliminate the MOV.  Unfortunately, it failed to preserve the UD
type, incorrectly generating:

and(8)          g5<1>.xUD       g6<4,4,1>.xF    0x7fffffffUD

Found while debugging Ian's uncommitted ARB_vertex_program LOG opcode
test with my new Mesa IR -> Vec4 IR translator.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:52:54 -07:00
Kenneth Graunke 10ff6772c8 i965/vs: Don't lose the MRF writemask when doing compute-to-MRF.
Consider the following code sequence:

   mul(8)          g4<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mov.sat(8)      m1<1>.xyF       g4<4,4,1>F
   mul(8)          g4<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF
   mov.sat(8)      m1<1>.zwF       g4<4,4,1>F

The compute-to-MRF pass will discover the first mov.sat and attempt to
replace it by rewriting earlier instructions.  Everything works out,
so it replaces scan_inst's destination file, reg, and reg_offset,
resulting in:

   mul(8)          m1<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mul(8)          g4<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF
   mov.sat(8)      m1<1>.zwF       g4<4,4,1>F

Unfortunately, it loses the .xy writemask on the mov.sat's MRF
destination.  While this doesn't pose an immediate problem, it then
proceeds to transform the second mov.sat, resulting in:

   mul(8)          m1<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mul(8)          m1<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF

Instead of writing both halves of the vector (like the original code),
it overwrites the full vector both times, clobbering the desired .xy
values.

When encountering a MOV, the compute-to-MRF code scans for instructions
which generate channels of the MOV source.  It ensures that all
necessary channels are available (possibly written by several
instructions).  In this case, *more* channels are available than
necessary, so we want to take the subset that's actually used.
Taking the bitwise and of both writemasks should accomplish that.

This was discovered by analyzing an ARB_vertex_program test
(glean/vertProg1/MUL test (with swizzle and masking)) with my new
Mesa IR -> Vec4 IR translator code.  However, it should be possible
with GLSL programs as well.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:52:54 -07:00
Kenneth Graunke 9142ade154 glcpp: Don't use infinite lookhead for #define differentiation.
Previously, we used lookahead patterns to differentiate:

   #define FOO(x)  function macro
   #define FOO (x) object macro

Unfortunately, our rule for function macros:

   {HASH}define{HSPACE}+/{IDENTIFIER}"("

relies on infinite lookahead, and apparently triggers a Flex bug where
the generated code overflows a state buffer (see YY_STATE_BUF_SIZE).

There's no need to use infinite lookahead.  We can simply change state,
match the identifier, and use a single character lookahead for the '('.
This apparently makes Flex not generate the giant state array, which
avoids the buffer overflow, and should be more efficient anyway.

Fixes piglit test 17000-consecutive-chars-identifier.frag.

NOTE: This is a candidate for every release branch ever.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
2012-10-25 14:52:53 -07:00
Kenneth Graunke eeb2fb72eb i965/vs: Fix debug dumping of VS push constants.
While copying the values into the batch space, we advance the param
pointer.  The debug code then tries to iterate over all the uploaded
values, starting at param...which is now the end of the uploaded data,
rather than the start.

This patch saves a pointer to the start of push constant space before
it gets altered and switches the debug code to use that.

Tested by uncommenting the code and examining the output of
glsl-vs-clamp-1.shader_test.  Previously all values appeared to be zero.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:52:53 -07:00
Matt Turner df924d82e2 mesa/tests: Add ES3.0 dispatch table sanity test
Since ES3.0 is backward compatible with 2.0, we check that all the 2.0
functions and additional 3.0 functions exist.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-10-25 14:29:05 -07:00
Matt Turner 355f507f2a Split dispatch sanity's validate_function test into two
Will be useful for the next patch, adding GLES 3 testing.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-10-25 14:29:05 -07:00
Paul Berry 1cf6360f89 dispatch_sanity: print names of functions that shouldnt be in dispatch table.
Previously we just printed the dispatch table index and the user had
to convert it to a function name.  That was a pain because when
FEATURE_remap_table is defined, the assignment of functions to
dispatch table entries is done at run time.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-10-25 14:23:01 -07:00
Paul Berry 03984b26c4 shared-glapi: implement _glapi_get_proc_name().
Previously this function was only implemented for non-shared-glapi
builds.  Since the function is only intended for debugging purposes we
use a simple O(n) algorithm.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-10-25 14:23:01 -07:00
Matt Turner 67f1e7bf5f src/glsl/tests/Makefile.am: Specify -I... in AM_CPPFLAGS
When specifying per-target CFLAGS (e.g., ralloc_test_CFLAGS) AM_CFLAGS
are not used. AM_CPPFLAGS should be used for includes anyway.

Fixes a build problem since 41b14d125:

CC       ralloc_test-ralloc.o
In file included from ../../../src/glsl/ralloc.c:42:0:
../../../src/glsl/ralloc.h:57:27: fatal error: main/compiler.h: No such file or directory

Acked-by: Paul Berry <stereotype441@gmail.com>
2012-10-25 13:31:24 -07:00
Matt Turner 41b14d1251 ralloc: Annotate printf functions with PRINTFLIKE(...)
Catches problems such as (in the gles3 branch)

glcpp-parse.y: In function '_glcpp_parser_handle_version_declaration':
glcpp-parse.y:1990:39: warning: format '%lli' expects argument of type
	'long long int', but argument 4 has type 'int' [-Wformat]

As a side-effect, remove ralloc.c's likely/unlikely macros and just use
the ones from main/compiler.h.

NOTE: This is a candidate for the release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-25 10:47:43 -07:00
José Fonseca 0cb0c38cce mesa/st: Don't use 4bits for GL_UNSIGNED_BYTE_3_3_2(_REV)
4bits and 3bits quantitization values differ significantly for
values other than 0 and 1.

Fixes piglit draw-pixels for softpipe/llvmpipe.

NOTE: Probably a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-10-25 17:57:57 +01:00
José Fonseca 4efcdd1e7a trace: Fix dumping of set_constant_buffer method. 2012-10-25 15:30:19 +01:00
Bryan Cain ebd8df7a31 glsl_to_tgsi: set correct register type for array and structure elements
This fixes an issue where glsl_to_tgsi_visior::get_opcode() would emit the
wrong opcode because the register type was GLSL_TYPE_ARRAY/STRUCT instead of
GLSL_TYPE_FLOAT/INT/UINT/BOOL, so the function would use the float opcodes for
operations on integer or boolean values dereferenced from an array or
structure.  Assertions have been added to get_opcode() to prevent this bug
from reappearing in the future.
2012-10-24 23:51:08 +02:00
Vincent Lejeune 0f35702d79 r600g: force bank_swizzle if already set
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-10-24 23:37:02 +02:00
Vincent Lejeune d1eaa9ea70 r600g: rewrite tgsi-to-llvm load-input to handle fragcoord
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-10-24 23:31:41 +02:00
Christoph Bumiller d310e29302 nv50/ir/tgsi: fix srcMask for TXP with SHADOW1D 2012-10-24 20:47:38 +02:00
Ian Romanick be1c5f4498 mesa: Use MIN instead of CLAMP for unsigned source data
This silences a zillion GCC warnings like:

../../../src/mesa/main/pack.c: In function '_mesa_pack_rgba_span_from_uints':
../../../src/mesa/main/pack.c:560:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-24 11:03:16 -07:00
Michel Dänzer eee1ff423c st/mesa: Fix assertions for copying texture image to finalized miptree.
The layer dimension of array textures is not subject to mipmap minification.
OTOH we were missing an assertion for the depth dimension.

Fixes assertion failures with piglit {f,v}s-textureSize-sampler1DArrayShadow.
For some reason, they only resulted in piglit 'warn' results for me, not
failures.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56211

NOTE: This is a candidate for the stable branches.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-24 17:54:25 +02:00
Andreas Boll ecb02c27fc gallium/docs: fix sphinx warning
src/gallium/docs/source/context.rst:495: WARNING:
malformed hyperlink target.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-24 14:14:03 +02:00
Paul Berry 2e0de80751 _mesa_create_exec_table: GLES3 fixes.
This patch sets up the dispatch table for the following GLES3
functions when a GLES3 context is in use:

- BeginQuery
- BeginTransformFeedback
- BindSampler
- BindTransformFeedback
- BlitFramebuffer
- ClearBufferfi
- ClearBufferfv
- ClearBufferiv
- ClearBufferuiv
- ClientWaitSync
- CopyBufferSubData
- DeleteQueries
- DeleteSamplers
- DeleteSync
- DeleteTransformFeedbacks
- EndQuery
- EndTransformFeedback
- FenceSync
- FramebufferTextureLayer
- GenQueries
- GenSamplers
- GenTransformFeedbacks
- GetInteger64v
- GetQueryObjectuiv
- GetQueryiv
- GetSamplerParameterfv
- GetSamplerParameteriv
- GetStringi
- GetSynciv
- GetTransformFeedbackVarying
- GetVertexAttribIiv
- GetVertexAttribIuiv
- IsQuery
- IsSampler
- IsSync
- IsTransformFeedback
- PauseTransformFeedback
- RenderbufferStorageMultisample
- ResumeTransformFeedback
- SamplerParameterf
- SamplerParameterfv
- SamplerParameteri
- SamplerParameteriv
- TransformFeedbackVaryings
- VertexAttribDivisor
- VertexAttribIPointer
- WaitSync

And it avoids setting up the dispatch table for these non-GLES3
functions:

- ColorMaski
- GetBooleani_v
- Enablei
- Disablei
- IsEnabledi
- ClearColorIiEXT
- ClearColorIuiEXT
- TextureStorage2DEXT
- TextureStorage3DEXT
- GetActiveUniformName
- GetnUniformdv
- GetnUniformfv
- GetnUniformiv
- GetnUniformuiv

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: Make the ctx argument to _mesa_init_transform_feedback_dispatch()
a const pointer.  Add a comment to remind us to add
GetBufferParameteri64v once tests exist for it.  Also add
VertexAttribDivisor for GLES3, and remove GetActiveUniformName and
GetnUniform{dv,fv,iv,uiv} for GLES3.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:40 -07:00
Paul Berry 5863e3d16e _mesa_create_exec_table(): deprecate ProgramStringARB.
This function is only useful for the ARB_{vertex,fragment}_program
extensions, which we don't expose in core contexts.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:40 -07:00
Paul Berry 893ddb068f _mesa_create_exec_table: de-deprecate GetPointerv.
glGetPointerv was de-deprecated in GL 4.3, because GL 4.3 adds
functionality from KHR_debug and ARB_debug_output, which require
glGetPointerv.

This patch modifies _mesa_create_exec_table() to populate
glGetPointerv in the dispatch table for core contexts.

Technically this is not in compliance with the spec--what we really
ought to do for core contexts is expose glGetPointerv only when a GL
4.3 context is in use or one of the two extensions is present.
However, it seems silly to go to that extra work, since the only
client-visible effect would be for glGetPointerv to raise an
INVALID_OPERATION error instead of an INVALID_ENUM error.  Besides,
the other functions set up by _mesa_create_exec_table() only depend on
the API in use, not on the GL version or extensions supported.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:39 -07:00
Paul Berry e7dd2e5213 glapi: Alias VertexAttribDivisor and VertexAttribDivisorARB.
There's no reason to have separate slots in the dispatch table for
these two functions, since they are synonymous.

Note: previous to this patch, we never populated the dispatch table
slot for VertexAttribDivisor, which was ok, since it is not required
until 3.3.  After this patch, both functions will be usable provided
that the ARB_instanced_arrays extension is present.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:39 -07:00
Paul Berry bad96f6ada glapi: Alias ClampColor and ClampColorARB.
There's no reason to have separate slots in the dispatch table for
these two functions, since they are synonymous.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:39 -07:00
Paul Berry 992ed68ed6 main: Fix warning ('struct gl_context' declared inside parameter list).
This eliminates a warning in GCC 4.7.1.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:39 -07:00
Eric Anholt ab7188e199 mesa: Return 0 for GL_CURRENT_QUERY with a mismatched query target.
With the previous two commits, this fixes piglit
GL_ARB_occlusion_query2/api.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-22 17:36:53 -07:00
Eric Anholt 8f1131fcc0 mesa: Refuse to EndQuery with a mismatched query target.
v2: Add a comment about what we're checking for.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-22 17:36:53 -07:00
Eric Anholt ce086ebd89 mesa: Throw an error for a new query on an already-active query target.
There's a similar test below, but it's not the same: that one checks whether
this query object is already active (potentially on another target).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-22 17:36:52 -07:00
Eric Anholt e755c1a36b i965: Actually add support for GL_ANY_SAMPLES_PASSED from GL_ARB_oq2.
v2: Fix mangled sentence in the comment, and make the loop exit early.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
2012-10-22 17:35:59 -07:00
Brian Paul 11070105f0 st/mesa: free TGSI tokens with ureg_free_tokens()
since they're allocated by ureg_get_tokens().

NOTE: This is a candidate for the 8.0 and 9.0 branches.
2012-10-22 15:49:31 -06:00
Brian Paul bb93439873 st/mesa: replace REALLOC() with realloc()
We should use the later since we're freeing the memory with free(),
not the gallium FREE() macro.

This fixes a mismatch when using the gallium debug memory functions.

NOTE: This is a candidate for the 9.0 branch.
2012-10-22 15:49:31 -06:00
Kristian Høgsberg 259fc154f1 gbm: Use the kms dumb ioctls for cursor instead of libkms
We need to create bos suitable for cursor usage that we can map and
write data into.  The kms dumb ioctls is all we need for this, so drop
the dependency on libkms.
2012-10-21 13:00:49 -04:00
Tom Stellard d2b0338e33 r600g: Remove special handling of PRED_SET* insructions for LLVM 3.2
The 3.2 version of the backend now sets all the correct fields for
PRED_SET* instructions.
2012-10-19 21:25:01 +00:00
Tom Stellard 8030cb0ed4 radeon/llvm: Sort tgsi opcode action initialization
This was done in order to identify and remove duplicate entries.
2012-10-19 21:25:01 +00:00
Tom Stellard bd8af8a3dc radeon/llvm: Fix lowering TGSI_OPCODE_SSG 2012-10-19 21:25:00 +00:00
Eric Anholt cae077cd0f i965: Stop flushing the batch on timestamp queries, too.
Given the usecase we have of trying to measure timestamps across individual
draw calls, flushing will totally mess up what people are trying to measure.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-19 11:47:01 -07:00
Eric Anholt 1973845fbd i965: Don't flush the batch immediately on EndQuery.
The theory I had when I wrote the code was that you wanted to minimize latency
on your queries because the app was going to ask soon.  Only, it turns out
that everybody batches up their queries and asks for the results later (often
after the next SwapBuffers!), so this was a pessimization.

Until now, I had no workload where it mattered enough to benchmark.  Recently
I started playing some Minecraft, which uses tons of queries to decide whether
to render chunks of the terrain.  For that app, avoiding the flush in the
query-generation loop improves performance 22.7% +/- 4.7% (n=3) on an apitrace
capture of it (confirmed in game by watching the fps meter found by pressing
F3, 15/16 -> 20/21 fps).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-19 11:47:01 -07:00
Eric Anholt 804469c58d i965/fs: Fix typo in refactor of brw_fs_reg_allocate.cpp.
I'm amazed that my usual warnings check didn't catch this, and that this
passed piglit.
2012-10-19 11:47:01 -07:00
Tapani Pälli f593acd577 i965/vs: include format argument in debug printf
otherwise some compilers will throw error
"error: format not a string literal and no format arguments"

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-19 10:00:19 -07:00
Michel Dänzer c2e37b1d2e st/mesa: Fix source miptree level for copying data to finalized miptree.
Fixes WebGL texture mips conformance test, no piglit regressions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44912

NOTE: This is a candidate for the stable branches.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-19 16:01:14 +02:00
Francisco Jerez 26fc30ef83 clover: No need for clover::is_zero() to be a functor.
Simplify is_zero() somewhat, and as a side effect work around a gcc compiler
bug that causes build failure.

https://bugs.freedesktop.org/show_bug.cgi?id=56140

Reported-by: Dmitry Cherkassov <dcherkassov@gmail.com>
2012-10-19 12:38:44 +02:00
Brian Paul 6551c4ea3c st/mesa: improve the guess_and_alloc_texture() heuristic
If GL_BASE_LEVEL==0 and GL_MAX_LEVEL==0 that's a pretty good hint that
there'll be a single mipmap level in the texture.

Google Earth sets the texture's state this way before the first glTexImage
call.  This saves a bit of texture memory.
2012-10-18 18:00:50 -06:00
Marek Olšák e5a9bf5523 gallium: remove unused data pointer from pipe_transfer
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-18 22:54:53 +02:00
Chad Versace 0da72d3502 intel: Skip texsubimage fastpath for more pixel unpack state (v2)
Fixes piglit tests "unpack-teximage2d --pbo=* --format=GL_BGRA" on
Sandybridge+.

The fastpath was checking an incomplete set of pixel unpack state. This
patch adds checks for all the fields of gl_pixelstore_attrib that affect
2D texture uploads.  Also, it begins permitting the case where
GL_UNPACK_ROW_LENGTH is 0.

Ideally, we would just ask a unicorn to JIT this fastpath for us in
a way that safely handles the unpacking state. Until then, it's safer if
only a small set of situations activate the fastpath.

v2: Use _mesa_is_bufferobj(), per Anholt.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-18 08:53:59 -07:00
Matt Turner 6c28174969 Finish _HAVE_FULL_GL removal
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 19:30:34 -07:00
Brian Paul 0d1ee26489 svga: add svga_screen_cache_dump() debug helper 2012-10-17 15:30:33 -06:00
Kristian Høgsberg e20a0f14b5 wayland: Drop support for ill-defined, unused wl_egl_pixmap
It doesn't provide the cross-process buffer sharing that a window system
pixmap could otherwise support and we don't have anything left that uses
this type of surface.
2012-10-17 16:32:13 -04:00
Kristian Høgsberg 2b8e90a338 wayland: Remove 0.85 compatibility #ifdefs 2012-10-17 16:32:13 -04:00
Kristian Høgsberg 0229e3ae41 egl/wayland: Update to Wayland 0.99 API
The 0.99.0 Wayland release changes the event API to provide a thread-safe
mechanism for receiving events specific to a subsystem (such as EGL) and
we need to use it in the EGL platform.

The Wayland protocol now also requires a commit request to make changes
take effect, issue that from eglSwapBuffers.
2012-10-17 16:32:13 -04:00
Eric Anholt be4c0a243e i965/fs: Statically allocate the reg_sets at context initialization.
Now that we've replaced all the variable settings other than reg_width, it's
easy to hang on to this (the expensive part of setting up the allocator).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:02:16 -07:00
Eric Anholt 8757fa65b8 i965/fs: Allocate registers in the unused parts of the gen7 MRF hack range.
This should also reduce register pressure on gen7+, like the previous commit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:02:06 -07:00
Eric Anholt a087e9f27f i965/fs: Reduce the interference between payload regs and virtual GRFs.
Improves performance of the Lightsmark penumbra shadows scene by 15.7% +/-
1.0% (n=15), by eliminating register spilling. (tested by smashing the list of
scenes to have all other scenes have 0 duration -- includes additional
rendering of scene description text that normally doesn't appear in that
scene)

v2: Allow allocation of all but g0/g1 of the payload.
v3: Pull count_to_loop_end() out to a helper function.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2, recommended v3)
2012-10-17 13:01:57 -07:00
Eric Anholt 551e1cd44f i965/fs: Expose the payload registers to the register allocator.
For now, nothing else can get allocated over them, but that will change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:01:54 -07:00
Eric Anholt 6c69df1e0f i965/fs: Remove extra allocation for classes[].
This was to slot in the magic aligned pairs class, but it got moved to a
descriptive name later.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:01:51 -07:00
Eric Anholt 5d90b98879 i965/fs: Make the register allocation class_sizes[] choice static.
Based on split_virtual_grfs(), we choose the same set every time, so set it in
stone.  This will help us avoid regenerating the somewhat expensive
class/register set setup every compile.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:01:37 -07:00
Eric Anholt 20ebebac51 i965/vs: Improve live interval calculation.
This is derived from the FS visitor code for the same, but tracks each channel
separately (otherwise, some typical fill-a-channel-at-a-time patterns would
produce excessive live intervals across loops and cause spilling).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48375
          (crash -> failure, can turn into pass by forcing unrolling still)
2012-10-17 12:24:01 -07:00
Eric Anholt e1a518e2b1 i965/vs: Fix the mlen of scratch read/write messages.
These messages always have m0 = g0 and m1 = offset, and write has m2 = data.
Avoids regression in opt_compute_to_mrf() with a change to scratch writes to
set up the data as an MRF write in the IR.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt c226b7a4d3 i965: Make the cfg reusable from the VS.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt 54679fcbca i965: Share the predicate field between FS and VS.
Note that BRW_PREDICATE_NONE is 0 and BRW_PREDICATE_NORMAL is 1, so that's a
lot like the true/false we had in the FS before.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt 7abfb67dc4 i965: Rename fs_cfg types to not mention fs.
fs_bblock_link -> bblock_link
fs_bblock -> bblock_t (to avoid conflicting with all the fs_bblock *bblock)
fs_cfg -> cfg_t (to avoid conflicting with all the fs_cfg *cfg)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt 5ed57d9543 i965: Move brw_fs_cfg.* to brw_cfg.*.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt 24aeeb2fdc i965: Make the FS and VS share a few visitor/instruction fields.
This will let us reuse brw_fs_cfg.cpp from brw_vec4_*.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt 338fd85e62 i965/vs: Trim the swizzle of the scratch write temporary.
This fixes confusion by the upcoming live variable analysis which saw e.g. use
of temp.w when only temp.xyz were initialized in the basic block, and
concluded that temp.w must have come from outside of the block (even though it
was never initialized anywhere).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt af911b2819 i965/vs: Do the temporary allocation in emit_scratch_write().
Both callers were doing basically the same thing, just written differently.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:23:59 -07:00
Eric Anholt 9499f7984e i965/vs: Simplify emit_scratch_write() prototype.
Both callers used (effectively) inst->dst as the argument, so just reference
it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:23:59 -07:00
Eric Anholt 914d8f9f84 i965/vs: Add a little bit of IR-level debug ability.
This is super basic, but it let me visualize a problem I had with
opt_compute_to_mrf().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:23:59 -07:00
Adam Jackson a30d14635d glx: Add GLXBadProfileARB to the error string list
Note: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-10-17 15:12:14 -04:00
Owen W. Taylor 1d0c621121 glx: Fix listing of INTEL_swap_event in glXQueryExtensionsString()
Due to a string mismatch, INTEL_swap_event wasn't listed among GLX
extensions for the connection, even when present on both client and
server. That is, glXQueryServerString and glXGetClientString reported the
extension, but glXQueryExtensionsString did not.

Note: This is a candidate for the stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56057
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-17 10:16:23 -07:00
José Fonseca aa2067c757 gallivm: Hide AVX support when requested by LP_NATIVE_VECTOR_WIDTH or unsupported by LLVM.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-10-17 18:07:43 +01:00
Will Schmidt 54821c0e99 gallivm: Use mcjit for ppc_64 architecture
Per commentary and direction in the LLVM community, support for ppc64 is
going into MCJIT rather than the old JIT.  There is no existing support
in prior llvm versions, so no need to specify LLVM version numbers.

Signed-off-by: Will Schmidt <will_schmidt@vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-10-17 18:07:43 +01:00
Brian Paul 32638737c5 st/mesa: silence MSVC signed/unsigned comparison warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul ead664e506 st/mesa: silence MSVC double/unsigned assignment warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul 198d1bdb5f tgsi: silence MSVC signed/unsigned comparison warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul 34a5fd2a39 util: fix MSVC signed/unsigned comparison warning in u_upload_mgr.c code
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul ba7bfdeff2 util: fix MSVC signed/unsigned comparison warning in u_vbuf.c code
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul a0785544e3 util: fix MSVC double/float conversion warning in u_format_r11g11b10f.h
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul f031910486 draw: silence MSVC signed/unsigned comparison warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul a115a29153 util/blitter: silence assorted MSVC warnings
Fix signed/unsigned comparison warnings and float/int assignment warnings.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul 7abd136e91 wmesa: remove old, unused span code 2012-10-17 10:13:30 -06:00
José Fonseca 879894552b scons: Fix graw-xlib lib order.
Avoids "undefined symbol: XShmCreateImage" error.
2012-10-17 15:28:26 +01:00
José Fonseca ea2978b11c tgsi: Add support to parse IMM[x] too.
Thanks to Brian for pointing this out.
2012-10-17 15:27:26 +01:00
José Fonseca 2ab6e67d90 Revert "gallivm: Don't use llvm.x86.avx.max/min.ps.256 inadvertently."
This reverts commit bf2edc776b.
2012-10-17 15:04:20 +01:00
Matt Turner 0199ff7fe3 es2api: Add GL ES 3 headers 2012-10-16 19:31:22 -07:00
Matt Turner c9155c9317 glapi: Add es2="3.0" attributes to XML.
Note that we are missing the ARB_internalformat_query extension, which
provides the glGetInternalformativ function needed by GL ES 3.0.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-10-16 19:31:22 -07:00
Brian Paul 1284543a44 svga: whitespace fixes, remove useless comments 2012-10-16 18:11:58 -06:00
Brian Paul 0087f5ce51 svga: silence MSVC warning about negating an unsigned value 2012-10-16 17:55:39 -06:00
Brian Paul ffbac58746 svga: silence MSVC double/float assignment warnings 2012-10-16 17:55:39 -06:00
Brian Paul ce3faa993c svga: fix MSVC double/float parameter warning 2012-10-16 17:55:39 -06:00
Brian Paul d21e6c87c0 svga: silence MSVC float/int assignment warnings 2012-10-16 17:55:39 -06:00
Brian Paul 200291e087 svga: silence MSVC double/float assignment warnings 2012-10-16 17:55:39 -06:00
Brian Paul 25cd2c2a8a svga: silence some MSVC signed/unsigned comparison warnings 2012-10-16 17:55:39 -06:00
Ian Romanick 4d0458dc6e mesa/tests: Add ES1.1 dispatch table sanity test
This test actually depends on FEATURE_ES1 because
_mesa_create_exec_table_es1 doesn't exist without it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-10-16 14:57:20 -07:00
Ian Romanick 95b76eab71 mesa/tests: Compile ES2 test regardless of FEATURE_ES2 setting
The relevant ES2 code is always in Mesa.  Always building the tests
ensures that things aren't accidentally broken when people don't build
with --enable-es2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-10-16 14:57:20 -07:00
Brian Paul c50d6a2abc mesa: remove FEATURE_ES1 tests in enable.c code
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul 1633fa1627 mesa: remove FEATURE_ES test in _mesa_get_compressed_formats()
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul 4936aadcd1 mesa: remove FEATURE_ES test in _mesa_is_compressed_format()
The code already has a runtime ES1 test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul 920f331cf1 mesa: remove FEATURE_GL test from updated_drawbuffers()
There's already a runtime test for full OpenGL.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul 99940eef48 mesa: remove #if _HAVE_FULL_GL checks
This is basically more of the "remove FEATURE_x" clean-up.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul 198fa6452b mesa: remove ASSERT_NO_FEATURE macro
Was only used in one place.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Eric Anholt 7139ab80ca i965: Fix rendering to small mipmaps of depth/stencil buffers using a temp mt.
Fixes 51 piglit tests (fbo-clear-formats, and most of the remaining failures
in depthstencil).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Eric Anholt 5c8dd6cf79 i965: Share the draw x/y offset masking code between main/blorp and all gens.
This code is twisty, and the comment before most of the blocks was actually
giving me the opposite impression from its intention: We want to apply as much
of our offset as possible through coarse tile-aligned adjustment, since we can
do so independently per buffer, and apply the minimum we can through
fine-grained drawing offset x/y, since it has to agree between all buffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Eric Anholt ddfa346e4a i965: Make a helper function for the renderbuffer temporary mt workaround.
We now have a case of wanting to do that on gen6+ as well, so make this logic
usable elsewhere.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Eric Anholt 4bec2e31bf i965: Warn on a couple of workarounds in blending.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Eric Anholt 1fe71848b6 intel: Add a macro for printing a debug warning once.
There are a number of places where some obscure piece of the code is not
currently worth fixing, and we have some workaround behavior available.  It's
nicer for users to do some lame workaround than to just assert, but without
asserts we never knew when the workaround was at fault.

This should give us a nice compromise: Execute the workaround, but mention
that the obscure workaround was hit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Paul Berry 381186dbf8 glapi: Delete gles_api.py, since it is no longer used.
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry c8ad6ef1c6 mapi_abi: Use GLES information from XML rather than gles_api.py.
Note: mapi_abi can consume API information from either XML or a .csv
file.  A side effect of this change is that the ES1 and ES2 API
printers can only be used with XML input now.  That's ok, since the
.csv input format is only used for the OpenVG API.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry 137f8ef225 mapi_abi: Override 'hidden' and 'handcode' attributes using polymorphism.
Previously, the ES1, ES2, and shared GLAPI printers passed a list of
function names to the base class constructor, which was used by the
_override_for_api() function to loop over all the API functions and
adjust their 'hidden' and 'handcode' attributes as appropriate for the
API flavour being code-generated.

This patch lifts the loop from _override_for_api() into its caller,
and makes it into a polymorphic function, so that the derived classes
can customize its behaviour directly.  In a future patch, this will
allow us to override the 'hidden' and 'handcode' attributes based on
information from the XML rather than a list of functions.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry 4f6fc905c6 mapi_abi: Get rid of unnecessary copy.
Previously, _get_api_entries() would make a deep copy of each element
in the entries table before modifying the 'hidden' and 'handcode'
attributes.  This was unnecessary, since the entries aren't used again
after this function.  Removing the copy simplifies the code, because
it is no longer necessary to adjust the alias pointers to point to the
copied entries.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry 77ed171f27 mapi_abi: Remove sanity check that all GLES functions are present.
Currently mapi_abi.py uses hardcoded lists of function names (in
gles_api.py) to determine which functions need to be included in the
GLES 1 or GLES 2 API.  This patch removes a sanity check which
verified that all GLES functions listed in the hardcoded lists were
actually present in the XML.

Later patches in this series will modify mapi_abi.py to determine
which functions need to be included in the GLES 1 or GLES 2 API based
directly on the XML.  Once that is done, the sanity check will be
redundant.  Removing the sanity check now will simplify the patches to
come.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry 155eff56b1 mapi_abi: Collect all imports at top of file.
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Paul Berry e378cd77bc glapi: Use GLES information from XML rather than gles_api.py.
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Paul Berry cd4ce16c45 glapi: Read GLES information from XML.
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Paul Berry 81a7f50781 glapi: Add es1 and es2 attributes to XML.
Currently, the set of functions which exist in GLES1 or GLES2 is
determined by hardcoded lists of function names in gles_api.py.  This
patch encodes that information into the XML files using new
attributes, es1 and es2.

The es1 attribute denotes the first version of GLES 1 in which the
function exists (e.g. es1="1.1" means the function exists in GLES 1.1
but not GLES 1.0).  "none" (the default) means the function is not
available in any version of GLES 1.

The es2 attribute denotes the first version of GLES 2/3 in which the
function exists (e.g. es2="2.0" means the function exists in both GLES
2.0 and GLES 3.0).  "none" (the default) means the function is not
available in any version of GLES 2 or GLES 3.

Note that since GLES 3 is a strict superset of GLES 2, there is no
need for a separate attribute for it; instead, 'es2="3.0"' should be
used to denote functions that are present in GLES 3 but not GLES 2.

This patch only adds information about GLES versions 1.0, 1.1, and
2.0.

Later patches will modify the python code generation scripts to use
this information rather than the hardcoded lists in gles_api.py.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Paul Berry 7dc052b12b glapi: use new-style Python classes.
An unfortunate quirk of Python 2 is that there are two types of
classes: "classic" classes (which are backward compatible with some
unfortunate design decisions made early in Python's history), and
"new-style" classes.  Classic classes have a number of limitations
(for example they don't support super()) and are unavailable in Python
3.  There's really no reason to use classic classes, except in
unmaintained legacy code.  For more information see
http://www.python.org/download/releases/2.2.3/descrintro/.

This patch upgrades the Python code in src/mapi/glapi/gen to use
exclusively new-style classes.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Kenneth Graunke 41954107c0 i965/fs: Fix segfault when using INTEL_DEBUG=perf with non-GLSL.
Now that ARB programs and fixed function are routed through the new
backend, shader might be NULL.  Don't do INTEL_DEBUG=perf support in
that case, since it relies on shader->compiled_once.

Since INTEL_DEBUG=perf wasn't previously supported, this maintains the
status quo.  It might be nice to support it someday, however.

This could be moved to brw_shader_program instead of brw_shader, but
it appears even prog can be NULL in that case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 12:02:01 -07:00
Kenneth Graunke 56705cd36b mesa: Don't flatten IF statements by default.
MaxIfDepth of 0 means "flatten all the time", not "never flatten".
This is only desirable on hardware that can't support control flow;
software rasterization and most hardware drivers want this.

This alters behavior for swrast as well as i915.  Tested on i915.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 12:01:39 -07:00
Kenneth Graunke b2e0293213 mesa: Remove PROGRAM_WRITE_ONLY register type.
More dead code.  I'm not sure what it was for.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:25 -07:00
Kenneth Graunke 01d2bd34f4 mesa: Remove dead _mesa_num_parameters_of_type() function.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke 1366db2ef6 mesa: Remove dead _mesa_add_attribute() function.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke d0021cb0fb mesa: Remove remnants of PROGRAM_VARYING.
The previous patch removed the producer of things in this file.
Since there aren't any, we can remove it.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke eda4a4ae81 mesa: Remove dead _mesa_add_varying() function.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke f7cfe3fc70 mesa: Remove dead program_parameter::Flags field.
All flags are now gone, so we can stop storing and passing this around.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke 5bb6f15f79 st/mesa: Remove the PROG_PARAM_BIT_CYL_WRAP flag. [v2]
Nobody ever set the flag, which makes this dead code.

v2: Leave the ureg_DECL_fs_input_cyl function in place, even though it's
    unused, since VMWare uses it for their internal projects.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke 4b13252bba mesa: Remove GLSL-related PROG_PARAM_BIT flags.
GLSL doesn't use the program code anymore.  Accordingly, there were no
consumers of these flags, so there's no need to define them.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke 8d418d1616 mesa: Remove support for named parameters.
These were only part of NV_fragment_program, so we can kill them.

The fact that PROGRAM_NAMED_PARAM appears in r200_vertprog.c is rather
comedic, but also demonstrates that people just spam the various types
of parameters everywhere because they're confusing.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke d67e52b027 driconf: Remove force enable for NV_vertex_program.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:23 -07:00
Kenneth Graunke 58c466519d mesa: Remove yet more remnants of NV_fragment_program.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:23 -07:00
Kenneth Graunke e5f03f23a0 mesa: Remove some miscellaneous NV program stuff from arbprogram.c.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:23 -07:00
Kenneth Graunke d213d27f84 mesa: Simplify _mesa_BindProgram() by removing NV program remnants.
Without NV programs, there's no need for the compatible_program_targets
function.  A simple (non-)equality check will do.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:23 -07:00
Kenneth Graunke 2f350f360b mesa: Remove get and enable bits for NV_fragment_program.
Also remove a leftover remnant from NV_vertex_program.

v2: Update for Imre's get changes.

Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-10-16 11:35:23 -07:00
Kenneth Graunke d711717b4a mesa: Remove prog_print support for NV programs.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke 2254569bda mesa: Remove support for parsing NV fragment programs.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke 9dc2c28983 mesa: Remove the gl_program::Resident flag.
It apparently was only used for NV programs.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke 7742952f7e mesa: Remove the EmitNVTempInitialization shader compiler option.
Nobody uses it anymore.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke 7487b16128 mesa: Remove the NV program API functions.
These are all unused now.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke 16d8161962 mesa: Switch to the other glGetVertexAttribPointervARB implementation.
Previously, Mesa used nvprogram.c's _mesa_GetVertexAttribPointervNV()
function to implement this GL call.  There was also a second
implementation in varray.c, _mesa_GetVertexAttribPointervARB(), which
was entirely unused.

The varray.c variant has an additional assertion and checks the index
against ctx->Const.VertexProgram.MaxAttribs rather than
MAX_VERTEX_GENERIC_ATTRIBS.  However, that variable is defined to the
same value, so it should be fine.

This will allow us to kill the duplicate function.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke 070ba30c36 mesa: Remove some shared NV_vp/fp functions from the dispatch table.
Also kill the resulting dead code for display list handling.

v2: Also kill dlist's OPCODE_REQUEST_RESIDENT_PROGRAMS_NV.

Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke ff1943dec9 mesa: Unhook NV_fragment_program API from the dispatch table.
The NamedParameter functions were introduced in NV_fragment_program, and
are not shared with any other extensions.

Although this patch appears to remove the LocalParameter functions, it
does not: the ARB_fragment_program section also set them up.  Now we
simply initialize them a single time.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke 492feddb03 swrast: Remove support for the NV_fragment_program extension.
No hardware drivers support this, it's obsolete, and unlikely to be
useful without NV_vertex_program, which is gone now.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:33 -07:00
Tom Stellard b1e7bd7690 r600g: Fix segfault in r600_compute_global_transfer_map()
This segfault was caused by commit
369e468889, however it is my fault for not
testing the patch while it was on the list.
2012-10-16 14:39:16 +00:00
Tom Stellard a73c5d3f9d r600g: Fix build with --enable-opencl 2012-10-16 14:39:15 +00:00
Fredrik Höglund 762d9ace6b mesa/es: Enable GL_EXT_map_buffer_range
This extension is functionally the same as GL_ARB_map_buffer_range.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 13:21:41 +02:00
Kristian Høgsberg 017c6fb324 gbm: Reject buffers that are not wl_drm buffers in gbm_bo_import()
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-10-15 22:33:04 -04:00
Fredrik Höglund 0978707917 glx: Fix a regression in the new XCB code
dri2DrawableGetMSC(), dri2WaitForMSC() and dri2WaitForSBC() were
inadvertently changed to return 0 on success.  This resulted in the callers
returning an error to the client.

Restore the previous behavior and also check that the reply pointers are
valid before accessing them.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 02:24:42 +02:00
Brian Paul df3721fd2e st/mesa: remove OPCODE_BRA switch case 2012-10-15 13:17:53 -06:00
Eric Anholt bc74c4bbaf mesa: Remove defines for NV_vertex_program limits.
Note that _mesa_GetVertexAttribPointervNV() is actually
glGetVertexAttribPointerv(), which operates on the generic attributes.  The
geometry shader initialization looks like arbitrary cruft to me.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt 09c006da9f mesa: Fix comments for NV_vp code that's now only used by other extensions.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt 37fc983d03 mesa: Add notes about remaining NV_vertex_program code.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt 8b2fe73897 mesa: Remove miscellaneous remains of NV_vertex_program.
v2: Rebase on top of get.c changes.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2012-10-15 11:53:24 -07:00
Eric Anholt cb9a1bf316 mesa: Remove API specific to GL_NV_vertex_program's aliased attribs.
v2: Rebase on top of get.c changes.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2012-10-15 11:53:24 -07:00
Eric Anholt 8058a70763 mesa: Remove prog_instruction.h field for never-supported NV_vertex_program3.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt cc763f0f3f mesa: Remove support for GL_VERTEX_STATE_PROGRAMs and their execution.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt 363643f540 mesa: Remove NV_vertex_program-specific parameters support.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt c0120c2509 mesa: Remove support for NV_vertex_program's attribute evaluation.
Note that the MAP2 getters were missing from the implementation.  Neat.

v2: Rebase on top of get.c changes.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2012-10-15 11:53:23 -07:00
Eric Anholt 4f9d351ef1 mesa: Remove support for NV_vertex_program's special attributes aliasing
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt 6a20f0e561 mesa: Fix NV_fragment_program's display list opcode for RequestResident.
While nuking NV_vertex_program, I noticed that one of my opcodes was used in a
strange place.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt 6ab9c04769 mesa: Remove support for NV_vertex_program's tracked matrices.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt bcfd51f8c4 mesa: Remove Mesa IR opcodes that existed only for NV_vertex_program.
v2: Remove dead positive() function, caught by Matt.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2012-10-15 11:53:23 -07:00
Eric Anholt 422566e1c7 mesa: Remove support for parsing NV vertex programs.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt cff1b1df4b swrast: Remove support for GL_NV_vertex_program.
It's not supported in any hardware drivers, and doesn't appear to be useful on
Linux.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt a1998673ba gallium: Remove #if 0-ed enable of NV_vp. It's going away.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:22 -07:00
Eric Anholt 63c233cf08 r200: Remove support for software-only NV_vertex_program.
It wasn't supported in hardware, and the comments in the code indicated no
known uses (similar to my experience on Intel) and a possible intent to remove
it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:22 -07:00
Eric Anholt af90c8c511 intel: Remove NV_vertex_program support.
We were holding on to this code because we were aware that NWN 1 had some
support for vertex programs -- no other linux programs I've come across would
use it (since other software also has ARB_vp or GLSL support).  Only, it turns
out that NWN doesn't even give us any vertex programs.  Given that we have
known issues where the extension has never been fully supported, just give up
on it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46795
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:22 -07:00
Eric Anholt 1a8a0418f2 i965/vp: Remove more code for unused opcodes.
These don't appear in ARB_vp or NV_vp and I missed that fact on the first
pass of removing dead opcodes.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:22 -07:00
Andreas Boll c5adfb21b3 r600g: drop useless switch statement
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-15 20:34:02 +02:00
Andreas Boll 0ce21660c2 gallium/docs: update some distro information
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 16:11:49 +02:00
Marek Olšák 023dae71ef r600g: emit the border color only when it's needed
That depends on the texture wrap modes and filtering.
2012-10-15 16:04:09 +02:00
Marek Olšák 33dda8f4fb r600g: cleanup create_sampler_state functions
- stopped using util_color
- reformatted to occupy less characters per line.
- used memcpy for the border color
- used pipe_color_union in the state structure
2012-10-15 16:04:09 +02:00
Marek Olšák 2bbd307fa6 st/mesa: fix integer texture border color for some formats (v2)
And the clear color too, though that may be an issue only with GL_RGB if it's
actually RGBA in the driver.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: The types of st_translate_color parameters were changed to gl_color_union
    and pipe_color_union as per Brian's comment.
2012-10-15 16:04:09 +02:00
Brian Paul 1ec12c53ba util: added debug_print_transfer_flags() function 2012-10-15 07:49:14 -06:00
Abdiel Janulgue bcb10ca172 mesa: Fix a crash in update_texture_state() for external texture type
NOTE: This is a candidate for the stable branch.

Signed-off-by: Abdiel <abdiel.janulgue@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-10-15 07:49:14 -06:00
Brian Paul 88ecd0ddb9 svga: remove needless debug-mode linked list code
LIST_DEL() always sets the prev/next pointers to NULL now.
2012-10-15 07:49:14 -06:00
Chris Fester 3fffe8f7b7 util: null-out the node's prev/next pointers in list_del()
Note: This is a candidate for the 9.0 branch.
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-10-15 07:49:14 -06:00
Christoph Bumiller 43e6c51aed nouveau: fix offset in nouveau_buffer_transfer_map
Before 369e468889, the transfer was
initialized before the call to map and had the correct value already.
2012-10-14 18:58:04 +02:00
Matt Turner fb85b204d3 u_format_s3tc.c: Don't call getenv() twice
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-12 12:26:03 -07:00
Tapani Pälli 60565b564b android: generate matching remap_helper to dispatch table
commit a010215463 removed ES2 specific dispatch
table and remap_helper, since now we are using dispatch.h which is generated
from gl_and_es_API.xml we need to generate a matching remap_helper using the
same xml.

Note: This is a candidate for the 9.0 branch.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-12 11:42:09 -07:00
José Fonseca bf2edc776b gallivm: Don't use llvm.x86.avx.max/min.ps.256 inadvertently.
Could happen when CPU supports AVX, but LLVM doesn't.
2012-10-12 18:52:28 +01:00
José Fonseca 9ccf91f9ef tgsi: Dump register number when dumping immediates.
For example:

VERT
DCL IN[0]
DCL OUT[0], POSITION
DCL OUT[1], GENERIC[12]
DCL CONST[0..4]
DCL TEMP[0], LOCAL
DCL TEMP[1], LOCAL
IMM[0] UINT32 {4294967295, 0, 0, 0}
IMM[1] FLT32 {    0.0000,     1.0000,     0.0000,     0.0000}
  0: SEQ TEMP[0].x, CONST[3].xxxx, IMM[0].xxxx
  1: F2I TEMP[0].x, -TEMP[0]
  2: SEQ TEMP[1].x, CONST[4].xxxx, IMM[0].xxxx
  3: F2I TEMP[1].x, -TEMP[1]
  4: AND TEMP[0].x, TEMP[0].xxxx, TEMP[1].xxxx
  5: IF TEMP[0].xxxx :0
  6:   MOV TEMP[0], IMM[1].xyxy
  7: ELSE :0
  8:   MOV TEMP[0], IMM[1].yxxy
  9: ENDIF
 10: MOV OUT[1], TEMP[0]
 11: MOV OUT[0], IN[0]
 12: END

instead of

VERT
DCL IN[0]
DCL OUT[0], POSITION
DCL OUT[1], GENERIC[12]
DCL CONST[0..4]
DCL TEMP[0], LOCAL
DCL TEMP[1], LOCAL
IMM UINT32 {4294967295, 0, 0, 0}
IMM FLT32 {    0.0000,     1.0000,     0.0000,     0.0000}
  0: SEQ TEMP[0].x, CONST[3].xxxx, IMM[0].xxxx
  1: F2I TEMP[0].x, -TEMP[0]
  2: SEQ TEMP[1].x, CONST[4].xxxx, IMM[0].xxxx
  3: F2I TEMP[1].x, -TEMP[1]
  4: AND TEMP[0].x, TEMP[0].xxxx, TEMP[1].xxxx
  5: IF TEMP[0].xxxx :0
  6:   MOV TEMP[0], IMM[1].xyxy
  7: ELSE :0
  8:   MOV TEMP[0], IMM[1].yxxy
  9: ENDIF
 10: MOV OUT[1], TEMP[0]
 11: MOV OUT[0], IN[0]
 12: END
2012-10-12 18:52:14 +01:00
Roland Scheidegger d366520e85 gallivm: fix rsqrt failures
lp_build_rsqrt initially did not do any newton-raphson step. This meant that
precision was only ~11 bits, but this handled both input 0.0 and +infinity
correctly. It did not however handle input 1.0 accurately, and denormals
always generated infinity result.
Doing a newton-raphson step increased precision significantly (but notably
input 1.0 still doesn't give output 1.0), however this fails for inputs
0.0 and infinity (both result in NaNs).
Try to fix this up by using cmp/select but since this is all quite fishy
(and still doesn't handle denormals) disable for now. Note that even with
workarounds it should still have been faster since the fallback uses sqrt/div
(which both use the usually unpipelined and slow divider hw).
Also add some more test values to lp_test_arit and test lp_build_rcp() too while
there.

v2: based on José's feedback, avoid hacky infinity definition which doesn't
work with msvc (unfortunately using INFINITY won't cut it neither on non-c99
compilers) in lp_build_rsqrt, and while here fix up the input infinity case
too (it's disabled anyway). Only test infinity input case if we have c99,
and use float cast for calculating reference rsqrt value so we really get
what we expect.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-10-12 18:51:18 +01:00
José Fonseca 2a4105cbc0 galahad: galahad_context_blit
must unwrap.
2012-10-12 18:38:05 +01:00
Marek Olšák 555c8d500a r600g: move shader structures into r600_shader.h 2012-10-12 19:00:30 +02:00
José Fonseca 23c6b8f2ed mesa/st: Fix assertions.
Can't access ptDraw before it is written.
2012-10-12 17:04:34 +01:00
Marek Olšák 7997b3c97c r600g: implement MSAA resolving for 8-bit and 16-bit integer formats
by changing the format to NORM.
2012-10-12 15:23:27 +02:00
Oliver McFadden 1b921acd5f intel: print debug either to stdout or `logcat' depending on platform.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-12 11:14:54 +03:00
Brian Paul 743d859e62 util: fix broken pipe_get_tile_rgba() call
Fix breakage from commit 369e468.
2012-10-11 15:53:16 -06:00
Tom Stellard 4cc530f452 radeon/llvm: Fix build with LLVM 3.2 2012-10-11 21:33:00 +00:00
Tom Stellard dc54c49df9 clover: Fix build with LLVM 3.2
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-10-11 21:32:54 +00:00
Tom Stellard c6b0132d1e clover: Don't link against libclangRewrite
This library does not exist in LLVM 3.2 and libOpenCL.so links fine
without it on LLVM 3.1

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-10-11 21:32:36 +00:00
Marek Olšák 7b01bc1e4c radeonsi: handle unhandled CAPs 2012-10-11 21:36:26 +02:00
Marek Olšák dd9274df4f radeonsi: fixup the return type of is_format_supported 2012-10-11 21:32:47 +02:00
Marek Olšák 8e3e4145ce radeonsi: remove unused local variables 2012-10-11 21:31:36 +02:00
Marek Olšák 47b7af6337 r600g: put user indices in the command stream for small index counts
This improves performance a little bit if there are lots of small indexed
draw commands.
2012-10-11 21:21:59 +02:00