mesa.git
13 years agor300/compiler: add a function to query program stats (alu, tex, temps..)
Marek Olšák [Tue, 7 Dec 2010 22:34:21 +0000 (23:34 +0100)]
r300/compiler: add a function to query program stats (alu, tex, temps..)

13 years agor300/compiler: don't terminate regalloc if we surpass max temps limit
Marek Olšák [Tue, 7 Dec 2010 20:45:34 +0000 (21:45 +0100)]
r300/compiler: don't terminate regalloc if we surpass max temps limit

The same check is already in a later pass (translate_vertex_program).

13 years agoi965: Don't try to store gen6 (float) blend constant color in bytes.
Eric Anholt [Wed, 8 Dec 2010 03:29:26 +0000 (19:29 -0800)]
i965: Don't try to store gen6 (float) blend constant color in bytes.

Fixes glean/blendFunc

13 years agolinker: Fix regressions caused by previous commit
Ian Romanick [Wed, 8 Dec 2010 03:00:44 +0000 (19:00 -0800)]
linker: Fix regressions caused by previous commit

That's what I get for not running piglit before pushing.

Don't try to patch types of unsized arrays when linking fails.

Don't try to patch types of unsized arrays that are shared between
shader stages.

13 years agolinker: Ensure that unsized arrays have a size after linking
Ian Romanick [Wed, 8 Dec 2010 02:30:33 +0000 (18:30 -0800)]
linker: Ensure that unsized arrays have a size after linking

Fixes piglit test case glsl-vec-array (bugzilla #31908).

NOTE: This bug does not affect 7.9, but I think this patch is a
candiate for the 7.9 branch anyway.

13 years agoi965: Fix flipped value of the not-embedded-in-if on gen6.
Eric Anholt [Wed, 8 Dec 2010 01:07:05 +0000 (17:07 -0800)]
i965: Fix flipped value of the not-embedded-in-if on gen6.

Fixes:
glean/glsl1-! (not) operator (1, fail)
glean/glsl1-! (not) operator (1, pass)

13 years agoglsl: Inherrit type of declared variable from initializer
Ian Romanick [Wed, 8 Dec 2010 00:27:22 +0000 (16:27 -0800)]
glsl: Inherrit type of declared variable from initializer

Types of declared variables and their initializer must match excatly
except for unsized arrays.  Previously the type inherritance for
unsized arrays happened implicitly in the emitted assignment.
However, this assignment is never emitted for uniforms.  Now that type
is explicitly copied unconditionally.

Fixes piglit test array-compare-04.vert (bugzilla #32035) and
glsl-array-uniform-length (bugzilla #31985).

NOTE: This is a candidate for the 7.9 branch.

13 years agoi965: Work around gen6 ignoring source modifiers on math instructions.
Eric Anholt [Tue, 7 Dec 2010 22:50:50 +0000 (14:50 -0800)]
i965: Work around gen6 ignoring source modifiers on math instructions.

With the change of extended math from having the arguments moved into
mrfs and handed off through message passing to being directly hooked
up to the EU, it looks like the piece for doing source modifiers
(negate and abs) was left out.

Fixes:
fog-modes
glean/fp1-ARB_fog_exp test
glean/fp1-ARB_fog_exp2 test
glean/fp1-Computed fog exp test
glean/fp1-Computed fog exp2 test
ext_fog_coord-modes

13 years agoi965: Add disabled debug code for dumping out the WM constant payload.
Eric Anholt [Tue, 7 Dec 2010 22:46:27 +0000 (14:46 -0800)]
i965: Add disabled debug code for dumping out the WM constant payload.

This can significantly ease thinking about the asm.

13 years agoi965: Correctly emit constants for aggregate types (array, matrix, struct)
Ian Romanick [Tue, 7 Dec 2010 22:50:34 +0000 (14:50 -0800)]
i965: Correctly emit constants for aggregate types (array, matrix, struct)

Previously the code only handled scalars and vectors.  This new code
is modeled somewhat after similar code in ir_to_mesa.

Reviewed-by: Eric Anholt <eric@anholt.net>
13 years agor600g: fix userspace fence against lastest kernel
Jerome Glisse [Tue, 7 Dec 2010 20:15:58 +0000 (15:15 -0500)]
r600g: fix userspace fence against lastest kernel

R6XX GPU doesn't like to have two partial flush writting
back to memory in row without a prior flush of the pipeline.
Add PS_PARTIAL_FLUSH to flush all work between the CP and
the ES, GS, VS, PS shaders.

Thanks a lot to Alban Browaeys (prahal on irc) for investigating
this issue.

Signed-off-by: Alban Browaeys <prahal@yahoo.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
13 years agor600g: remove dead code
Jerome Glisse [Tue, 7 Dec 2010 21:11:51 +0000 (16:11 -0500)]
r600g: remove dead code

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
13 years agoi965: Always hand the absolute value to RSQ.
Eric Anholt [Tue, 7 Dec 2010 20:34:30 +0000 (12:34 -0800)]
i965: Always hand the absolute value to RSQ.

gen6 builtin RSQ apparently clamps negative values to 0 instead of
returning the RSQ of the absolute value like ARB_fragment_program
desires and pre-gen6 apparently does.

Fixes:
glean/fp1-RSQ test 2 (reciprocal square root of negative value)
glean/vp1-RSQ test 2 (reciprocal square root of negative value)

13 years agoglsl: Ensure that equality comparisons don't return a NULL IR tree
Ian Romanick [Thu, 2 Dec 2010 20:17:36 +0000 (12:17 -0800)]
glsl: Ensure that equality comparisons don't return a NULL IR tree

This fixes bugzilla #32035 and piglit test case array-compare-01 and
array-compare-02.

NOTE: This is a candidate for the 7.9 branch.

13 years agoi965: Handle saturates on gen6 math instructions.
Eric Anholt [Tue, 7 Dec 2010 19:32:50 +0000 (11:32 -0800)]
i965: Handle saturates on gen6 math instructions.

We get saturate as an argument to brw_math() instead of as compile
state, since that's how the pre-gen6 send instructions work.  Fixes
fp-ex2-sat.

13 years agoi965: Fix comment about gen6_wm_constants.
Eric Anholt [Tue, 7 Dec 2010 19:33:34 +0000 (11:33 -0800)]
i965: Fix comment about gen6_wm_constants.

This is the push constant buffer, not the pull constants.

13 years agoRefresh autogenerated glcpp parser.
Kenneth Graunke [Tue, 7 Dec 2010 18:48:10 +0000 (10:48 -0800)]
Refresh autogenerated glcpp parser.

13 years agoglcpp: Don't emit SPACE tokens in conditional_tokens production.
Kenneth Graunke [Tue, 7 Dec 2010 18:47:50 +0000 (10:47 -0800)]
glcpp: Don't emit SPACE tokens in conditional_tokens production.

Fixes glslparsertest defined-01.vert.

Reported-by: José Fonseca <jfonseca@vmware.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
13 years agor300g: also revalidate the SWTCL vertex buffer after its reallocation
Marek Olšák [Tue, 7 Dec 2010 18:24:19 +0000 (19:24 +0100)]
r300g: also revalidate the SWTCL vertex buffer after its reallocation

13 years agoi965: upload WM state for _NEW_POLYGON on sandybridge
Zhenyu Wang [Tue, 7 Dec 2010 09:02:02 +0000 (17:02 +0800)]
i965: upload WM state for _NEW_POLYGON on sandybridge

Be sure polygon stipple mode is updated. This fixes 'gamma' demo.

13 years agor200: Silence uninitialized variable warning.
Vinson Lee [Tue, 7 Dec 2010 08:56:07 +0000 (00:56 -0800)]
r200: Silence uninitialized variable warning.

Fixes this GCC warning.
r200_maos_arrays.c: In function 'r200EmitArrays':
r200_maos_arrays.c:113: warning: 'emitsize' may be used uninitialized in this function

13 years agoi965: set minimum/maximum Point Width on Sandybridge
Xiang, Haihao [Tue, 7 Dec 2010 08:30:00 +0000 (16:30 +0800)]
i965: set minimum/maximum Point Width on Sandybridge

It is used for point width on vertex. This fixes mesa demo spriteblast and pointblast.

13 years agomesa: Clean up header file inclusion in viewport.h.
Vinson Lee [Tue, 7 Dec 2010 08:37:48 +0000 (00:37 -0800)]
mesa: Clean up header file inclusion in viewport.h.

13 years agomesa: Clean up header file inclusion in varray.h.
Vinson Lee [Tue, 7 Dec 2010 08:33:36 +0000 (00:33 -0800)]
mesa: Clean up header file inclusion in varray.h.

13 years agomesa: Clean up header file inclusion in transformfeedback.h.
Vinson Lee [Tue, 7 Dec 2010 08:28:57 +0000 (00:28 -0800)]
mesa: Clean up header file inclusion in transformfeedback.h.

13 years agomesa: Clean up header file inclusion in texrender.h.
Vinson Lee [Tue, 7 Dec 2010 08:19:06 +0000 (00:19 -0800)]
mesa: Clean up header file inclusion in texrender.h.

13 years agor300g: validate buffers only if any of bound buffers is changed
Marek Olšák [Tue, 7 Dec 2010 06:54:31 +0000 (07:54 +0100)]
r300g: validate buffers only if any of bound buffers is changed

This prevents needless buffer validation (CS space checking).

13 years agor300g: cache packet dwords of 3D_LOAD_VBPNTR in a command buffer if possible
Marek Olšák [Tue, 7 Dec 2010 05:24:06 +0000 (06:24 +0100)]
r300g: cache packet dwords of 3D_LOAD_VBPNTR in a command buffer if possible

It's not always possible to preprocess the content of 3D_LOAD_VBPNTR
in a command buffer, because the offset to all vertex buffers (which
the packet depends on) is derived from the "start" parameter of draw_arrays
and the "indexBias" parameter of draw_elements, but we can at least lazily
make a command buffer for the case when offset == 0, which should occur
most of the time.

13 years agou_blitter: use util_is_format_compatible in the assert
Marek Olšák [Tue, 7 Dec 2010 05:22:38 +0000 (06:22 +0100)]
u_blitter: use util_is_format_compatible in the assert

13 years agomesa: consolidate glTexImage1/2/3D() code
Brian Paul [Tue, 7 Dec 2010 00:08:16 +0000 (17:08 -0700)]
mesa: consolidate glTexImage1/2/3D() code

Something similar could be done for glCopyTex[Sub]Image() and the
compressed texture image functions as well.

13 years agomesa: set gl_texture_object::_Complete=FALSE in incomplete()
Brian Paul [Mon, 6 Dec 2010 22:18:57 +0000 (15:18 -0700)]
mesa: set gl_texture_object::_Complete=FALSE in incomplete()

13 years agomesa: test for cube map completeness in glGenerateMipmap()
Brian Paul [Mon, 6 Dec 2010 22:11:41 +0000 (15:11 -0700)]
mesa: test for cube map completeness in glGenerateMipmap()

The texture is not cube complete if the base level images aren't of
the same size and format.

NOTE: This is a candidate for the 7.9 branch.

13 years agoglsl: Properly add functions during lazy built-in prototype importing.
Kenneth Graunke [Mon, 6 Dec 2010 18:54:21 +0000 (10:54 -0800)]
glsl: Properly add functions during lazy built-in prototype importing.

The original lazy built-in importing patch did not add the newly created
function to the symbol table, nor actually emit it into the IR stream.

Adding it to the symbol table is non-trivial since importing occurs when
generating some ir_call in a nested scope.  A new add_global_function
method, backed by new symbol_table code in the previous patch, handles
this.

Fixes bug #32030.

13 years agosymbol_table: Add support for adding a symbol at top-level/global scope.
Kenneth Graunke [Mon, 6 Dec 2010 18:42:27 +0000 (10:42 -0800)]
symbol_table: Add support for adding a symbol at top-level/global scope.

13 years agoglsl: Factor out code which emits a new function into the IR stream.
Kenneth Graunke [Mon, 6 Dec 2010 18:54:05 +0000 (10:54 -0800)]
glsl: Factor out code which emits a new function into the IR stream.

A future commit will use the newly created function in a second place.

13 years agost/mesa: Unbind all constant buffers
Jakob Bornecrantz [Mon, 6 Dec 2010 19:59:49 +0000 (20:59 +0100)]
st/mesa: Unbind all constant buffers

13 years agor600g: remove useless flush map
Jerome Glisse [Mon, 6 Dec 2010 14:49:16 +0000 (09:49 -0500)]
r600g: remove useless flush map

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
13 years agor600g: avoid useless shader rebuild at draw call
Jerome Glisse [Mon, 6 Dec 2010 00:24:03 +0000 (19:24 -0500)]
r600g: avoid useless shader rebuild at draw call

Avoid rebuilding constant shader state at each draw call,
factor out spi update that might change at each draw call.
Best would be to update spi only when revealent states
change (likely only flat shading & sprite point).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
13 years agor600g: build fetch shader from vertex elements
Jerome Glisse [Sat, 4 Dec 2010 01:47:02 +0000 (20:47 -0500)]
r600g: build fetch shader from vertex elements

Vertex elements change are less frequent than draw call, those to
avoid rebuilding fetch shader to often build the fetch shader along
vertex elements. This also allow to move vertex buffer setup out
of draw path and make update to it less frequent.

Shader update can still be improved to only update SPI regs (based
on some rasterizer state like flat shading or point sprite ...).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
13 years agomesa: Bump the number of bits in the register index.
José Fonseca [Mon, 6 Dec 2010 20:01:30 +0000 (20:01 +0000)]
mesa: Bump the number of bits in the register index.

More than 1023 temporaries were being used for a Cinebench shader before
doing temporary optimization, causing the index value to wrap around to
-1024.

13 years agost/mesa: fix mipmap generation bug
Brian Paul [Mon, 6 Dec 2010 18:01:19 +0000 (11:01 -0700)]
st/mesa: fix mipmap generation bug

In st_finalize_texture() we were looking at the st_texture_object::
lastLevel field instead of the pipe_resource::last_level field to
determine which resource to store the mipmap in.

Then, in st_generate_mipmap() we need to call st_finalize_texture() to
make sure the destination resource is properly allocated.

These changes fix the broken piglit fbo-generatemipmap-formats test.

13 years agomesa/llvm: use llvm-config --cppflags
Brian Paul [Mon, 6 Dec 2010 17:10:58 +0000 (10:10 -0700)]
mesa/llvm: use llvm-config --cppflags

Use --cppflags instead of --cflags so that we get the -I and -D flags
we want, but not compiler options like -O3.

A similar change should probably be made for autoconf.

13 years agogallium/util: minor formatting fixes
Brian Paul [Sat, 4 Dec 2010 01:13:45 +0000 (18:13 -0700)]
gallium/util: minor formatting fixes

13 years agomesa: add error margin to clip mask debug/check code
Brian Paul [Mon, 6 Dec 2010 16:44:23 +0000 (09:44 -0700)]
mesa: add error margin to clip mask debug/check code

When X or Y or Z is close to W the outcome of the floating point clip
test comparision may be different between the C and x86 asm paths.
That's OK; don't report an error.

See fd.o bug 32093

13 years agoi965: Remove INTEL_DEBUG=glsl_force now that there's no brw_wm_glsl.c
Eric Anholt [Thu, 11 Nov 2010 16:51:26 +0000 (08:51 -0800)]
i965: Remove INTEL_DEBUG=glsl_force now that there's no brw_wm_glsl.c

13 years agoi965: Nuke brw_wm_glsl.c.
Eric Anholt [Thu, 11 Nov 2010 17:09:38 +0000 (09:09 -0800)]
i965: Nuke brw_wm_glsl.c.

It was only used for gen6 fragment programs (not GLSL shaders) at this
point, and it was clearly unsuited to the task -- missing opcodes,
corrupted texturing, and assertion failures hit various applications
of all sorts.  It was easier to patch up the non-glsl for remaining
gen6 changes than to make brw_wm_glsl.c complete.

Bug #30530

13 years agoi965: Add support for the instruction compression bits on gen6.
Eric Anholt [Fri, 3 Dec 2010 19:49:29 +0000 (11:49 -0800)]
i965: Add support for the instruction compression bits on gen6.

Since the 8-wide first-quarter and 16-wide first-half have the same
bit encoding, we now need to track "do you want instruction
compression" in the compile state.

13 years agoi965: Align gen6 push constant size to dispatch width.
Eric Anholt [Sat, 4 Dec 2010 00:50:19 +0000 (16:50 -0800)]
i965: Align gen6 push constant size to dispatch width.

The FS backend is fine with register level granularity.  But for the
brw_wm_emit.c backend, it expects pairs of regs to be used for the
constants, because the whole world is pairs of regs.  If an odd number
got used, we went looking for interpolation in the wrong place.

13 years agoi965: Make the sampler's implied move on gen6 be a raw move.
Eric Anholt [Fri, 3 Dec 2010 23:33:13 +0000 (15:33 -0800)]
i965: Make the sampler's implied move on gen6 be a raw move.

We were accidentally doing a float-to-uint conversion.

13 years agoi965: Fix up gen6 samplers for their usage by brw_wm_emit.c
Eric Anholt [Fri, 3 Dec 2010 22:30:38 +0000 (14:30 -0800)]
i965: Fix up gen6 samplers for their usage by brw_wm_emit.c

We were trying to do the implied move even when we'd already manually
moved the real header in place.

13 years agoi965: Fix gen6 interpolation setup for 16-wide.
Eric Anholt [Fri, 3 Dec 2010 20:38:08 +0000 (12:38 -0800)]
i965: Fix gen6 interpolation setup for 16-wide.

In the SF and brw_fs.cpp fixes to set up interpolation sanely on gen6,
the setup for 16-wide interpolation was left behind.  This brings
relative sanity to that path too.

13 years agoi965: Don't smash a group of coordinates doing gen6 16-wide sampler headers.
Eric Anholt [Sat, 13 Nov 2010 06:18:09 +0000 (22:18 -0800)]
i965: Don't smash a group of coordinates doing gen6 16-wide sampler headers.

13 years agoi965: Fix up 16-wide gen6 FB writes after various refactoring.
Eric Anholt [Fri, 3 Dec 2010 20:20:02 +0000 (12:20 -0800)]
i965: Fix up 16-wide gen6 FB writes after various refactoring.

13 years agoi965: Provide delta_xy reg to gen6 non-GLSL path PINTERP.
Eric Anholt [Sat, 13 Nov 2010 00:38:38 +0000 (16:38 -0800)]
i965: Provide delta_xy reg to gen6 non-GLSL path PINTERP.

Fixes many assertion failures in that path.

13 years agoi965: Move payload reg setup to compile, not lookup time.
Eric Anholt [Thu, 11 Nov 2010 17:30:16 +0000 (09:30 -0800)]
i965: Move payload reg setup to compile, not lookup time.

Payload reg setup on gen6 depends more on the dispatch width as well
as the uses_depth, computes_depth, and other flags.  That's something
we want to decide at compile time, not at cache lookup.  As a bonus,
the fragment shader program cache lookup should be cheaper now that
there's less to compute for the hash key.

13 years agomapi: Rewrite mapi_abi.py to get rid of preprocessor magic.
Chia-I Wu [Mon, 6 Dec 2010 02:27:39 +0000 (10:27 +0800)]
mapi: Rewrite mapi_abi.py to get rid of preprocessor magic.

The preprocessor magic in mapi was nothing but obfuscation.  Rewrite
mapi_abi.py to generate real C code.

This commit removes the hack added in
43121f20866bb89e8dac92bd92ec85a943704b7e.

13 years agoegl: _eglFilterArray should not allocate.
Chia-I Wu [Mon, 6 Dec 2010 06:38:23 +0000 (14:38 +0800)]
egl: _eglFilterArray should not allocate.

Otherwise, when it is called from within a driver, the caller cannot
free the returned data (on Windows).

13 years agoi965: Fix GS state uploading on Sandybridge
Zhenyu Wang [Mon, 6 Dec 2010 07:15:55 +0000 (15:15 +0800)]
i965: Fix GS state uploading on Sandybridge

Need to check the required primitive type for GS on Sandybridge,
and when GS is disabled, the new state has to be issued too, instead
of only updating URB state with no GS entry, that caused hang on Sandybridge.

This fixes hang issue during conformance suite testing.

13 years agoi965: fix for flat shading on Sandybridge
Xiang, Haihao [Mon, 6 Dec 2010 01:33:18 +0000 (09:33 +0800)]
i965: fix for flat shading on Sandybridge

use constant interpolation instead of linear interpolation for
attributes COL0,COL1 if GL_FLAT is used. This fixes mesa demo bounce.

13 years agor600g: Cleanup fetch shader resources in r600_pipe_shader_destroy().
Henri Verbeet [Sun, 5 Dec 2010 17:42:43 +0000 (18:42 +0100)]
r600g: Cleanup fetch shader resources in r600_pipe_shader_destroy().

13 years agor600g: Cleanup block bo references in r600_context_fini().
Henri Verbeet [Sun, 5 Dec 2010 17:42:43 +0000 (18:42 +0100)]
r600g: Cleanup block bo references in r600_context_fini().

13 years agost/mesa: initialize key in st_vp_varient
Marek Olšák [Sun, 5 Dec 2010 05:43:18 +0000 (06:43 +0100)]
st/mesa: initialize key in st_vp_varient

This fixes endless vertex shader recompilations in find_translated_vp
if the shader contains an edge flag output.

NOTE: This is a candidate for the 7.9 branch.

Signed-off-by Brian Paul <brianp@vmware.com>

13 years agogallium/trace: check bind_vertex_sampler_states and set_vertex_sampler_views
Xavier Chantry [Sun, 5 Dec 2010 11:12:20 +0000 (12:12 +0100)]
gallium/trace: check bind_vertex_sampler_states and set_vertex_sampler_views

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Reviewed-by: Jakob Bornecrantz <wallbraker at gmail.com>
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
13 years agoinit ps->context with util_surfaces_get and do_get
Xavier Chantry [Sun, 5 Dec 2010 11:09:30 +0000 (12:09 +0100)]
init ps->context with util_surfaces_get and do_get

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Reviewed-by: Jakob Bornecrantz <wallbraker at gmail.com>
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
13 years agonvfx: fixes after array textures merge
Xavier Chantry [Sun, 5 Dec 2010 11:04:47 +0000 (12:04 +0100)]
nvfx: fixes after array textures merge

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
13 years agor300g: optimize looping over atoms
Marek Olšák [Sat, 4 Dec 2010 09:06:48 +0000 (10:06 +0100)]
r300g: optimize looping over atoms

This also removes DBG_STATS (the stats can be obtained with valgrind instead).

13 years agor300g: cleanup winsys
Marek Olšák [Sat, 4 Dec 2010 03:36:02 +0000 (04:36 +0100)]
r300g: cleanup winsys

13 years agor300g: try and use all of vertex constant space
Dave Airlie [Fri, 3 Dec 2010 10:53:39 +0000 (20:53 +1000)]
r300g: try and use all of vertex constant space

Finished up by Marek Olšák.

We can set the constant space to use a different area per-call to the shader,
we can avoid flushing the PVS as often as we do by spreading out the constants
across the whole constant space.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
13 years agor300g: do not use the index parameter in set_constant_buffer
Marek Olšák [Sun, 5 Dec 2010 00:30:09 +0000 (01:30 +0100)]
r300g: do not use the index parameter in set_constant_buffer

It appears to be a constant buffer index (in case there are more constant
buffers explicitly used by a shader), i.e. something that Gallium currently
does not use. We treated it incorrectly as the offset to a constant buffer.

13 years agogallium/noop: Add prototype for noop_init_state_functions.
Vinson Lee [Sun, 5 Dec 2010 01:30:08 +0000 (17:30 -0800)]
gallium/noop: Add prototype for noop_init_state_functions.

Silences this GCC warning.
noop_state.c:247: warning: no previous prototype for
'noop_init_state_functions'

13 years agoi965: Fix compile warning about missing opcodes.
Eric Anholt [Sun, 5 Dec 2010 00:27:57 +0000 (16:27 -0800)]
i965: Fix compile warning about missing opcodes.

13 years agoi965: Update gen6 SF state on fragment program change too.
Eric Anholt [Sat, 4 Dec 2010 02:20:42 +0000 (18:20 -0800)]
i965: Update gen6 SF state on fragment program change too.

SF state depends on what inputs there are to the fragment program, not
just the outputs of the VS.

13 years agoi965: Update gen6 WM state on compiled program change, not just FP change.
Eric Anholt [Sat, 4 Dec 2010 02:25:52 +0000 (18:25 -0800)]
i965: Update gen6 WM state on compiled program change, not just FP change.

13 years agointel: Add an env var override to execute for a different GPU revision.
Eric Anholt [Fri, 3 Dec 2010 02:25:45 +0000 (18:25 -0800)]
intel: Add an env var override to execute for a different GPU revision.

Sometimes I'm on the train and want to just read what's generated
under INTEL_DEBUG=vs,wm for some code on another generation.  Or, for
the next gen enablement we'll want to dump aub files before we have
the actual hardware.  This will let us do that.

13 years agost/vega: Fix pipe blend state for various blend modes.
Chia-I Wu [Sat, 4 Dec 2010 13:42:51 +0000 (21:42 +0800)]
st/vega: Fix pipe blend state for various blend modes.

rgb_src_factor and rgb_dst_factor should be PIPE_BLENDFACTOR_ONE for
VG_BLEND_SRC_IN and VG_BLEND_DST_IN respectively.  VG_BLEND_SRC_OVER can
be supported only when the fb has no alpha channel.  VG_BLEND_DST_OVER
and VG_BLEND_ADDITIVE have to be supported with a shader.

Note that Porter-Duff blending rules assume premultiplied alpha.

13 years agost/vega: Add blend shaders for all blend modes.
Chia-I Wu [Sat, 4 Dec 2010 14:42:46 +0000 (22:42 +0800)]
st/vega: Add blend shaders for all blend modes.

13 years agost/vega: Fix VG_BLEND_MULTIPLY.
Chia-I Wu [Sat, 4 Dec 2010 13:02:50 +0000 (21:02 +0800)]
st/vega: Fix VG_BLEND_MULTIPLY.

TEMP[1].w will be needed for OUT.w just below.  Use TEMP[0] to store the
intermediate value.

13 years agomesa: Clean up header file inclusion in texobj.h.
Vinson Lee [Sat, 4 Dec 2010 09:29:50 +0000 (01:29 -0800)]
mesa: Clean up header file inclusion in texobj.h.

13 years agomesa: Clean up header file inclusion in texgetimage.h.
Vinson Lee [Sat, 4 Dec 2010 09:20:28 +0000 (01:20 -0800)]
mesa: Clean up header file inclusion in texgetimage.h.

13 years agomesa: Clean up header file inclusion in texformat.h.
Vinson Lee [Sat, 4 Dec 2010 09:11:33 +0000 (01:11 -0800)]
mesa: Clean up header file inclusion in texformat.h.

13 years agomesa: Clean up header file inclusion in texenvprogram.h.
Vinson Lee [Sat, 4 Dec 2010 09:03:52 +0000 (01:03 -0800)]
mesa: Clean up header file inclusion in texenvprogram.h.

13 years agomesa: Clean up header file inclusion in texcompress_s3tc.h.
Vinson Lee [Sat, 4 Dec 2010 09:00:21 +0000 (01:00 -0800)]
mesa: Clean up header file inclusion in texcompress_s3tc.h.

13 years agost/vega: Silence uninitialized variable warning.
Vinson Lee [Sat, 4 Dec 2010 08:53:44 +0000 (00:53 -0800)]
st/vega: Silence uninitialized variable warning.

Fixes this GCC warning.
api_filters.c: In function 'execute_filter':
api_filters.c:184: warning: 'tex_wrap' may be used uninitialized in this function

13 years agomesa: Clean up header file inclusion in texcompress.h.
Vinson Lee [Sat, 4 Dec 2010 08:52:14 +0000 (00:52 -0800)]
mesa: Clean up header file inclusion in texcompress.h.

13 years agost/vega: Blending should use premultiplied alpha.
Chia-I Wu [Sat, 4 Dec 2010 06:51:27 +0000 (14:51 +0800)]
st/vega: Blending should use premultiplied alpha.

Convert color values to and back from premultiplied form for blending.
Finally the rendering result of the blend demo looks much closer to that
of the reference implementation.

13 years agost/vega: Add support for per-channel alpha.
Chia-I Wu [Sat, 4 Dec 2010 04:03:07 +0000 (12:03 +0800)]
st/vega: Add support for per-channel alpha.

Drawing an image in VG_DRAW_IMAGE_STENCIL mode produces per-channel
alpha for use in blending.  Add a new shader stage to produce and save
it in TEMP[1].

For other modes that do not need per-channel alpha, the stage does

  MOV TEMP[1], TEMP[0].wwww

13 years agost/vega: Move masking after blending.
Chia-I Wu [Sat, 4 Dec 2010 03:23:41 +0000 (11:23 +0800)]
st/vega: Move masking after blending.

Masking should happen after blending.  The shader is not entirely
correct, but leave it as is for now.

13 years agost/vega: Refactor blend shaders.
Chia-I Wu [Fri, 3 Dec 2010 12:35:56 +0000 (20:35 +0800)]
st/vega: Refactor blend shaders.

Add a helper function, blend_generic, that supports all blend modes and
per-channel alpha.  Make other blend generators a wrapper to it.

Both the old and new code expects premultiplied colors, yet the input is
non-premultiplied.  Per-channel alpha is also not used for stencil
image.  They still need to be fixed.

13 years agost/vega: Add some comments to pipeline shaders.
Chia-I Wu [Fri, 3 Dec 2010 12:16:37 +0000 (20:16 +0800)]
st/vega: Add some comments to pipeline shaders.

13 years agost/mesa: new comment about updating state vars
Brian Paul [Sat, 4 Dec 2010 00:07:16 +0000 (17:07 -0700)]
st/mesa: new comment about updating state vars

13 years agomesa: update comments, remove dead code
Brian Paul [Fri, 3 Dec 2010 23:45:44 +0000 (16:45 -0700)]
mesa: update comments, remove dead code

13 years agomesa: remove unneeded cast
Brian Paul [Fri, 3 Dec 2010 23:40:36 +0000 (16:40 -0700)]
mesa: remove unneeded cast

13 years agomesa: make glGet*(GL_NONE) generate GL_INVALID_ENUM
Brian Paul [Fri, 3 Dec 2010 22:59:29 +0000 (15:59 -0700)]
mesa: make glGet*(GL_NONE) generate GL_INVALID_ENUM

In find_value() check if we've hit the 0th/invalid entry before checking
if the pname matches.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=31987

NOTE: This is a candidate for the 7.9 branch.

13 years agoswrast: restructure some glReadPixels() code
Brian Paul [Fri, 3 Dec 2010 22:26:19 +0000 (15:26 -0700)]
swrast: restructure some glReadPixels() code

13 years agoswrast: accept GL_RG in glReadPixels()
Brian Paul [Fri, 3 Dec 2010 22:21:36 +0000 (15:21 -0700)]
swrast: accept GL_RG in glReadPixels()

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32088

13 years agoir_print_visitor: Print out constant structure values.
Kenneth Graunke [Thu, 2 Dec 2010 18:11:49 +0000 (10:11 -0800)]
ir_print_visitor: Print out constant structure values.

In the form (constant type ((field1 value) (field2 value) ...))

13 years agoswrast: fix indentation
Brian Paul [Fri, 3 Dec 2010 21:49:19 +0000 (14:49 -0700)]
swrast: fix indentation

13 years agoswrast: allow GL_RG format in glDrawPixels()
Brian Paul [Fri, 3 Dec 2010 21:48:01 +0000 (14:48 -0700)]
swrast: allow GL_RG format in glDrawPixels()

Restructure the switch statement to avoid having to add additional
color formats in the future.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32086

13 years agomesa: consolidate some compiler -D flags
Brian Paul [Fri, 3 Dec 2010 17:59:52 +0000 (10:59 -0700)]
mesa: consolidate some compiler -D flags

-D__STDC_CONSTANT_MACROS and -D__STDC_LIMIT_MACROS are only needed for
LLVM build.

13 years agor300g: one more r500_index_bias_supported leftover
Marek Olšák [Fri, 3 Dec 2010 19:59:55 +0000 (20:59 +0100)]
r300g: one more r500_index_bias_supported leftover