Commit graph

37857 commits

Author SHA1 Message Date
Jakob Bornecrantz
9f5c1194ff tgsi: Add option to stop the sanity checker from printing 2010-08-05 17:44:05 -07:00
Ian Romanick
0a09d679ca glsl_type: Don't have two versions of a type with the same name
Previously some sampler types were duplicated in GLSL 1.30 and
GL_EXT_texture_array.  This resulted in not being able to find the
built-in sampler functions when the extension was used.  When the
built-in functions were compiled, they bound to the 1.30 version.
This caused a type mismatch when trying to find the function.  It also
resulted in a confusing error message:

0:0(0): error: no matching function for call to `texture2DArray(sampler2DArray, vec3)'
0:0(0): error: candidates are: vec4 texture2DArray(sampler2DArray, vec3)

0:0(0): error:                 vec4 texture2DArray(sampler2DArray, vec3, float)
2010-08-05 17:29:15 -07:00
Jakob Bornecrantz
4d65055b1f util: Add option to not dump cpu caps 2010-08-05 17:25:13 -07:00
Jakob Bornecrantz
981c6bc6a5 st/mesa: Only get debug option once 2010-08-05 17:25:13 -07:00
Jakob Bornecrantz
99611f0849 st/mesa: Only get mesa mvp dp4 option once
The correct for this is of course to do what comment says
2010-08-05 17:25:13 -07:00
Jakob Bornecrantz
e00b17830b llvmpipe: Only get no rast option once 2010-08-05 17:25:13 -07:00
Jakob Bornecrantz
4bd061b127 gallivm: Only get debug option once 2010-08-05 17:25:13 -07:00
Ian Romanick
1e0f0459e0 glsl2: Log a better error message when a matching function cannot be found 2010-08-05 17:21:39 -07:00
Vinson Lee
1b8aa2176c st/mesa: Clean up header file inclusion in st_mesa_to_tgsi.h.
st_mesa_to_tgsi.h
Replace tgsi_ureg.h with a forward declaration.
Include p_compiler.h for ubyte symbol.

st_program.c
Include tgsi_ureg.h directly.
2010-08-05 17:15:25 -07:00
Luca Barbieri
bf5ee5aa4f nvfx: fix nv30 vertex program scalar opcodes
Apparently they have always been broken, even before unification.

Fixes a lot of stuff, starting from morph3d and lighting in teapot
with textures disabled.
2010-08-06 01:28:14 +02:00
Luca Barbieri
3e231361f3 nvfx: shut up unknown cap 64 warning 2010-08-06 01:28:14 +02:00
Vinson Lee
0a7cbe845f st/mesa: Clean up header file inclusion in st_manager.h.
Include mtypes.h for GLcontext, gl_buffer_index, and GLframebuffer
symbols.
Include p_compiler.h for boolean symbol.
Include st_context.h in st_cb_eglimage.c as it previously included
st_context.h indirectly through st_manager.h.
2010-08-05 16:20:07 -07:00
Brian Paul
3d038a3ed2 glsl: fix atan(0, -1)
Fixes fd.o bug 29388

NOTE: this is a candidate for the 7.8 branch.
2010-08-05 16:39:09 -06:00
Eric Anholt
bc4034b243 glsl2: Add a pass to convert exp and log to exp2 and log2.
Fixes ir_to_mesa handling of unop_log, which used the weird ARB_vp LOG
opcode that doesn't do what we want.  This also lets the multiplication
coefficients in there get constant-folded, possibly.

Fixes:
glsl-fs-log
2010-08-05 15:34:00 -07:00
Alex Deucher
918ef7ff18 r600c: tiling require drm 2.6.0, not 2.5.0 2010-08-05 17:42:29 -04:00
Eric Anholt
8048226b7b glsl2: Insert global declarations at the top of the instruction stream.
Fixes use-before-decl in glslparsertest shaders.

Fixes:
CorrectFull.frag
CorrectModule.frag
2010-08-05 14:41:09 -07:00
Alex Deucher
e93d413a0d r600: add support for getting the tiling config via drm ioctl (v2)
Needed for the the 2D tiling span functions.

v2: rebase on new kernel, mesa changes

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-08-05 17:13:10 -04:00
Alex Deucher
3095bc679d r600: add new relocs for tiling support
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-08-05 17:12:52 -04:00
Alex Deucher
063c70d7f7 r600: add span support for 2D tiling
Requires tiling config ioctl support from the drm to use.
kms only.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2010-08-05 17:12:37 -04:00
Eric Anholt
0a0ab121f8 ir_structure_splitting: Massive fixing to this.
I'd missed putting in the actual "find structures to split" part, so
most of the code didn't do anything.  I was running on too large of an
app and assuming the lack of progress was elsewhere.
2010-08-05 13:40:09 -07:00
Eric Anholt
748f81a8ea glsl2: Make the HV actually call ir_texture's visit_leave. 2010-08-05 13:34:02 -07:00
Eric Anholt
7f7eaf0285 ir_structure_splitting: New pass to chop structures into their components.
This doesn't do anything if your structure goes through an uninlined
function call or if whole-structure assignment occurs.  As such, the
impact is limited, at least until we do some global copy propagation
to reduce whole-structure assignment.
2010-08-05 12:56:03 -07:00
Eric Anholt
c314c8f231 glsl2: Fix the dereferences_variable check in ir_tree_grafting.
The HV doesn't descend into ir_variable, which is generally a good
thing (allowing one to distinguish between variable declarations and
refs), but here we never saw tree grafting opportunities killed
because we were looking for the ir_variable child of a dereference to
get visited.

Fixes:
glsl1-function call with inout params
2010-08-05 12:56:03 -07:00
Eric Anholt
b259eb2804 glsl2: Don't tree-grafting out assignment to an out variable.
Fixes:
glsl-deadcode-varying.
2010-08-05 12:56:03 -07:00
Eric Anholt
9f82806c7b glsl2: Don't dead-code eliminate a call where the return value is unused.
This showed up since the disabling of inlining at compile time, which
I apparently didn't regenerate piglit summary for.

Fixes:
glsl-deadcode-call.
2010-08-05 12:56:03 -07:00
Eric Anholt
3bd7e70bf7 glsl2: Add some easy-to-enable debug printfs to ir_dead_code.cpp. 2010-08-05 12:56:02 -07:00
Jerome Glisse
9c949d4a4d r600g: don't use dynamic state allocation for states
Simplify state handly by avoiding state allocation.
Next step is to allocate once for all context packet
buffer and then avoid rebuilding pm4 packet each time
(through use of combined crc) this would also avoid
number of memcpy.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-05 15:41:35 -04:00
Joakim Sindholt
0633c2e683 targets/egl: fix build 2010-08-05 20:42:04 +02:00
Eric Anholt
e995f0e10c ir_to_mesa: Don't do function inlining until linking.
Optimizations at compile time should generally be done with the goal
of reducing instruction count so that other work, particularly
linking, is less time-consuming if the shader is used multiple times.
However, function inlining increases instruction count for the inlined
function bodies without removing the original function body, since we
don't know if it will be used at link time or not.

Reduces the runtime of linking and executing a Yo Frankie fragment
shader from 0.9 seconds to 0.5 seconds (-45.9%, +/- 2.2%, n=5).
2010-08-05 10:18:45 -07:00
Eric Anholt
2e853ca23c glsl2: Add a pass for removing unused functions.
For a shader involving many small functions, this avoids running
optimization across all of them after they've been inlined
post-linking.

Reduces the runtime of linking and running a fragment shader from Yo
Frankie from 1.6 seconds to 0.9 seconds (-44.9%, +/- 3.3%).
2010-08-05 10:18:31 -07:00
Marek Olšák
a4be3b6b31 r300g: fix fb_state atom size 2010-08-05 19:06:09 +02:00
Marek Olšák
fc94fd9bfa r300g: debug_print on startup whether we can use hyper-z 2010-08-05 19:05:11 +02:00
Eric Anholt
c5b9cab499 glsl2: Catch pointless copies in copy propagation.
We wouldn't want to go rewriting dereferences to variables to point at
the same variable it did before.  While I didn't find a way to trigger
that, a shader in Yo Frankie managed to produce a self-assignment by
passing a constant to a function doing self assignment like this.

Cleans up the IR for glsl-deadcode-self-assign.shader_test
2010-08-05 09:17:45 -07:00
Eric Anholt
8f6a0c9ed9 glsl2: Don't try to dump GLSL IR for a shader that didn't compile. 2010-08-05 09:17:45 -07:00
Eric Anholt
9de2c4fc8e ir_to_mesa: Remove debug force-enablement of EmitNoIfs. 2010-08-05 09:17:45 -07:00
Dave Airlie
b5f1044711 r300g: always emit hyperz state atom. 2010-08-05 20:58:51 +10:00
Dave Airlie
41f9e60bb3 r300g: disable hiz on rv530 for now.
On my rv530 at least HiZ is causing rendering issues in gears.
2010-08-05 20:32:06 +10:00
Dave Airlie
6eb2a7fbaf r300g: implement hyper-z support. (v4)
This implements fast Z clear, Z compression, and HiZ support for r300->r500
GPUs.

It also allows cbzb clears when fast Z clears are being used for the ZB.

It requires a kernel with hyper-z support.

Thanks to Marek Olšák <maraeo@gmail.com>, who started this off, and Alex Deucher at AMD for providing lots of hints.

v2:
squashed zmask ram size fix]
squashed r300g/blitter: fix Z readback when compressed]

v3:
rebase around texture changes in master - .1 fix more bits

v4:
migrated to using u_mm in r300_texture to manage hiz/zmask rams consistently
disabled HiZ when using OQ
flush z-cache before turning hyper-z off
update hyper-z state on dsa state change
store depthclearvalue across cbzb clears and replace it afterwards.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-05 20:32:05 +10:00
Keith Whitwell
ccbd9ae7cc docs: clarify point sprite discussion
Plagiarizes email explanation from Roland.
2010-08-05 11:09:14 +01:00
Vinson Lee
5e56c8907b st/mesa: Remove unnecessary header from st_gl_api.h. 2010-08-05 01:38:46 -07:00
Vinson Lee
ea1744a664 mesa: Include missing header in st_get_mipmap.h.
Include mtypes.h for GLcontext symbol.
Add forward declaration for st_context.
2010-08-05 01:23:46 -07:00
Vinson Lee
ad4d27c6d1 st/mesa: Include missing headers in st_format.h. 2010-08-05 00:59:44 -07:00
Vinson Lee
2febc491bc st/mesa: Add forward delcaration in st_extensions.h. 2010-08-05 00:54:27 -07:00
Vinson Lee
4f9ca250d6 st/mesa: Add missing headers to st_draw.h. 2010-08-05 00:52:30 -07:00
Chris Wilson
66708fd8a9 intel: Check for a NULL src buffer prior to blt
This can only happen along a malloc failure path, but check anyway.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-05 08:39:15 +01:00
Chris Wilson
85cfe32180 intel: Check for region allocation failure.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-08-05 08:38:55 +01:00
Kenneth Graunke
f4239872c9 glcpp: Ignore #if and #elif expressions when skipping.
Fixes glcpp test cases 073 and 074, as well as piglit test
xonotic-vs-generic-diffuse.vert.
2010-08-04 23:37:19 -07:00
Kenneth Graunke
d65135a766 glcpp/tests: Add a corollary to testcase 073 for testing #elif. 2010-08-04 23:37:19 -07:00
Kenneth Graunke
c52b2be166 glcpp/tests: Fix 073-if-in-ifdef.c to use #ifdef, not #if.
The original intention was to use #ifdef.
2010-08-04 23:37:19 -07:00
Kenneth Graunke
16b4eed59a glcpp: Refactor HASH_IF and HASH_ELIF expansion to reuse code. 2010-08-04 23:37:18 -07:00