Commit graph

35867 commits

Author SHA1 Message Date
Eric Anholt
2d7dfb8446 i965: Add disabled debug code for dumping out the WM constant payload.
This can significantly ease thinking about the asm.
2010-12-07 15:11:27 -08:00
Ian Romanick
6848e27e14 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>
2010-12-07 15:03:14 -08:00
Jerome Glisse
b7617346dc 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>
2010-12-07 17:54:56 -05:00
Jerome Glisse
69251fc4cd r600g: remove dead code
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-07 16:14:18 -05:00
Eric Anholt
fa0d5a2c5b 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)
2010-12-07 13:13:27 -08:00
Ian Romanick
6d36be508f 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.
2010-12-07 12:50:38 -08:00
Eric Anholt
72845d206e 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.
2010-12-07 12:21:08 -08:00
Eric Anholt
ed492e9544 i965: Fix comment about gen6_wm_constants.
This is the push constant buffer, not the pull constants.
2010-12-07 12:21:08 -08:00
Kenneth Graunke
bd74101aeb Refresh autogenerated glcpp parser. 2010-12-07 10:52:59 -08:00
Kenneth Graunke
800eed6765 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>
2010-12-07 10:52:36 -08:00
Marek Olšák
d8b861987d r300g: also revalidate the SWTCL vertex buffer after its reallocation 2010-12-07 19:26:28 +01:00
Zhenyu Wang
27609a8267 i965: upload WM state for _NEW_POLYGON on sandybridge
Be sure polygon stipple mode is updated. This fixes 'gamma' demo.
2010-12-07 17:05:02 +08:00
Vinson Lee
6ee415cc6d 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
2010-12-07 00:58:54 -08:00
Xiang, Haihao
5ff6ed2b97 i965: set minimum/maximum Point Width on Sandybridge
It is used for point width on vertex. This fixes mesa demo spriteblast and pointblast.
2010-12-07 16:43:24 +08:00
Vinson Lee
dda3ccba8c mesa: Clean up header file inclusion in viewport.h. 2010-12-07 00:37:48 -08:00
Vinson Lee
dbd3f72662 mesa: Clean up header file inclusion in varray.h. 2010-12-07 00:33:36 -08:00
Vinson Lee
2aa36f78dc mesa: Clean up header file inclusion in transformfeedback.h. 2010-12-07 00:28:57 -08:00
Vinson Lee
8cc3d411ed mesa: Clean up header file inclusion in texrender.h. 2010-12-07 00:19:06 -08:00
Marek Olšák
4953ba6a71 r300g: validate buffers only if any of bound buffers is changed
This prevents needless buffer validation (CS space checking).
2010-12-07 08:46:18 +01:00
Marek Olšák
78068a5fbf 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.
2010-12-07 06:42:05 +01:00
Marek Olšák
857d107bfe u_blitter: use util_is_format_compatible in the assert 2010-12-07 06:22:38 +01:00
Brian Paul
d0b2b8da7d mesa: consolidate glTexImage1/2/3D() code
Something similar could be done for glCopyTex[Sub]Image() and the
compressed texture image functions as well.
2010-12-06 17:10:05 -07:00
Brian Paul
6dca66b620 mesa: set gl_texture_object::_Complete=FALSE in incomplete() 2010-12-06 17:10:05 -07:00
Brian Paul
ecb7cc3319 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.
2010-12-06 17:10:05 -07:00
Kenneth Graunke
c17c790387 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.
2010-12-06 13:43:22 -08:00
Kenneth Graunke
a8f52647b0 symbol_table: Add support for adding a symbol at top-level/global scope. 2010-12-06 13:43:22 -08:00
Kenneth Graunke
6fae1e4c4d 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.
2010-12-06 13:43:22 -08:00
Jakob Bornecrantz
d72cb9c94d st/mesa: Unbind all constant buffers 2010-12-06 22:10:49 +01:00
Jerome Glisse
e0d554ab78 r600g: remove useless flush map
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-12-06 15:50:50 -05:00
Jerome Glisse
afc56b1861 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>
2010-12-06 15:50:50 -05:00
Jerome Glisse
fa86fc564a 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>
2010-12-06 15:50:50 -05:00
José Fonseca
a9fa0f3a2f 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.
2010-12-06 20:03:51 +00:00
Brian Paul
cae2bb76c1 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.
2010-12-06 11:01:21 -07:00
Brian Paul
4fc62a074c gallium/util: minor formatting fixes 2010-12-06 09:46:45 -07:00
Brian Paul
b89a731ff2 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
2010-12-06 09:46:01 -07:00
Eric Anholt
4538ce915b i965: Remove INTEL_DEBUG=glsl_force now that there's no brw_wm_glsl.c 2010-12-06 00:14:23 -08:00
Eric Anholt
5ba517baa2 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
2010-12-06 00:14:23 -08:00
Eric Anholt
245662f308 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.
2010-12-06 00:14:23 -08:00
Eric Anholt
3f8bcb0d99 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.
2010-12-06 00:14:23 -08:00
Eric Anholt
237aa33c67 i965: Make the sampler's implied move on gen6 be a raw move.
We were accidentally doing a float-to-uint conversion.
2010-12-06 00:14:23 -08:00
Eric Anholt
5340dd8cca 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.
2010-12-06 00:14:22 -08:00
Eric Anholt
ad29e79850 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.
2010-12-06 00:14:22 -08:00
Eric Anholt
ae0df25ab4 i965: Don't smash a group of coordinates doing gen6 16-wide sampler headers. 2010-12-06 00:14:22 -08:00
Eric Anholt
d1ead22d1b i965: Fix up 16-wide gen6 FB writes after various refactoring. 2010-12-06 00:14:22 -08:00
Eric Anholt
ad35528944 i965: Provide delta_xy reg to gen6 non-GLSL path PINTERP.
Fixes many assertion failures in that path.
2010-12-06 00:14:22 -08:00
Eric Anholt
16f8c82389 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.
2010-12-06 00:14:22 -08:00
Chia-I Wu
8f2a974cf2 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
43121f2086.
2010-12-06 15:40:37 +08:00
Chia-I Wu
5ae4b6693a egl: _eglFilterArray should not allocate.
Otherwise, when it is called from within a driver, the caller cannot
free the returned data (on Windows).
2010-12-06 15:40:37 +08:00
Zhenyu Wang
2b1469340b 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.
2010-12-06 15:20:48 +08:00
Xiang, Haihao
08be8d6450 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.
2010-12-06 09:42:28 +08:00