Commit Graph

37007 Commits

Author SHA1 Message Date
Carl Worth efef950f39 glcpp: Explicitly expect 0 shift/reduce conflicts.
The "%expect 0" construct will make bison emit an error if any future
changes to the grammar introduce shift/reduce conflicts, (without also
increasing the number after "%expect").
2010-07-28 11:10:52 -07:00
Carl Worth 2233d10442 glcpp: Remove 2 shift/reduce conflicts from the grammar.
Since we have productions to turn "defined FOO" and "defined ( FOO )"
into a conditional_token we don't need to list DEFINED as an operator
as well. Doing so just introduces the shift/reduce ambiguity with no
benefit.
2010-07-28 11:07:46 -07:00
Eric Anholt f9b0e5e322 glsl2: When stealing var->constant_value, steal its children as well.
Fixes:
glsl1-GLSL 1.20 uniform array constructor
2010-07-27 15:25:07 -07:00
Eric Anholt 9a670c2e9b ir_to_mesa: Provide a restricted type size to _mesa_add_uniform.
Fixes:
glsl-uniform-out-of-bounds.
2010-07-27 15:10:38 -07:00
Eric Anholt 59c45e9e6c glsl2: Actually use the linked dead code eliminator.
I managed to revert the change from unlinked at some point while
cleaning up the changes.  glsl-fs-raytrace-bug27060 drops from 389
instructions to 370.
2010-07-27 14:34:53 -07:00
Eric Anholt 54f583a206 glsl2: Don't dereference a NULL var in CE handling during a compile error.
If an undeclared variable was dereferenced in an expression that
needed constant expression handling, we would walk off a null ir->var
pointer.

Fixes:
glsl1-TIntermediate::addUnaryMath
2010-07-27 12:10:50 -07:00
Eric Anholt 20c074ae28 ir_to_mesa: Add support for array constants.
Fixes:
glsl1-GLSL 1.20 array constructor 1
glsl1-GLSL 1.20 array constructor 2
glsl1-GLSL 1.20 array.length()
glsl1-GLSL 1.20 const array constructor 1
glsl1-GLSL 1.20 const array constructor 2
2010-07-27 12:02:11 -07:00
Eric Anholt bf6ad0ab3d glsl2: Use ir_dead_code's linked version after linking.
glsl-fs-raytrace-bug27060 goes from 485 Mesa IR instructions to 389
before Mesa IR optimization.
2010-07-27 11:49:27 -07:00
Eric Anholt 5532c4ca69 glsl2: Fix the linked version of ir_dead_code.
If we don't walk into functions, we won't see any usage of variables
in the functions.
2010-07-27 11:46:06 -07:00
Eric Anholt 66d4c65ee2 glsl2: Make the dead code handler make its own talloc context.
This way, we don't need to pass in a parse state, and the context
doesn't grow with the number of passes through optimization.
2010-07-27 11:46:05 -07:00
Eric Anholt 8bbdf6e7cd mesa: Allow large temporary indices coming into the temporary reg allocator.
This gets glsl-vs-raytrace, glsl-fs-raytrace running on the new
compiler.
2010-07-27 11:45:27 -07:00
Eric Anholt 85cd64ee17 glsl2: Talloc type names.
Otherwise, we end up losing structure names after compile time, and
dumping IR often ends up reporting some other mysterious string.
2010-07-27 11:14:59 -07:00
Eric Anholt 9a770ee49f ir_to_mesa: Set the swizzle on constant struct src regs.
MESA_GLSL=nopt now produces believable output for glsl-fs-raytrace.
2010-07-27 10:41:01 -07:00
Eric Anholt fdbaca931a ir_to_mesa: Fix stray "break" that broke functions of >1 argument. 2010-07-27 10:08:38 -07:00
Eric Anholt 832aad989e glsl2: Add optimization pass for algebraic simplifications.
This cleans up the assembly output of almost all the non-logic tests
glsl-algebraic-*.  glsl-algebraic-pow-two needs love (basically,
flattening to a temporary and squaring it).
2010-07-27 09:43:52 -07:00
Eric Anholt 5533c6e380 ir_validate: Check the types of expression operations. 2010-07-27 09:43:52 -07:00
Eric Anholt 6a1401eb88 glsl2: Fix missing visit_continue return in ir_validate. 2010-07-27 00:18:57 -07:00
Eric Anholt 576d01ad8c ir_to_mesa: Fix up handling of void function returns.
void functions have a type of glsl_type::void_type, not a null type.
2010-07-26 19:41:39 -07:00
Eric Anholt c91809e1e4 ir_to_mesa: Actually allocate the right size for constant matrix temps. 2010-07-26 19:41:23 -07:00
Eric Anholt 5b6890a388 ir_to_mesa: Add support for structure constants.
Fixes:
TPPStreamCompiler::assignOperands
2010-07-26 19:40:47 -07:00
Eric Anholt fbaca31352 glsl2: Also steal the constant components of aggregate-typed ir_constants. 2010-07-26 19:30:19 -07:00
Kenneth Graunke eb2cc4f1b1 glsl2: Steal ir_variable's constant_value field.
Fixes a link-time crash in glsl-vs-cross-3.
2010-07-26 19:09:10 -07:00
Eric Anholt e2130d4e39 glsl2: Remove old .gitignore file from when we were out of tree. 2010-07-26 17:54:35 -07:00
Eric Anholt afe125e0a1 Merge remote branch 'origin/master' into glsl2
This pulls in multiple i965 driver fixes which will help ensure better
testing coverage during development, and also gets past the conflicts
of the src/mesa/shader -> src/mesa/program move.

Conflicts:
	src/mesa/Makefile
	src/mesa/main/shaderapi.c
	src/mesa/main/shaderobj.h
2010-07-26 17:53:27 -07:00
Eric Anholt d64343f1ae ir_to_mesa: Flag when we use the address reg.
Hardware backends will get angry otherwise.
2010-07-26 17:45:37 -07:00
Kristian Høgsberg 5403ca79b2 glx: Remove function prototypes no longer necessary 2010-07-26 17:37:59 -04:00
Eric Anholt 2621100458 i965: Fix reversed naming of the operations in compute-to-mrf optimization.
Also fix up comments, so that the difference between the two passes is
clarified.
2010-07-26 13:08:25 -07:00
Eric Anholt b3ea15f12b i965: Clean up a few magic numbers to use brw_defines.h defs. 2010-07-26 13:08:25 -07:00
Eric Anholt ca0f4e2c10 i965: Use MIN2, MAX2 instead of rolling our own. 2010-07-26 13:08:25 -07:00
Eric Anholt 9e31adfa46 i965: Fold the "is arithmetic" bit of 965 opcodes into the opcode list. 2010-07-26 13:08:25 -07:00
Eric Anholt b9c84515a5 i965: Remove some duped register size/count definitions 2010-07-26 13:08:25 -07:00
Eric Anholt 22f839292f i965: Move the GRF-to-MRF optimizations to brw_optimize.c. 2010-07-26 13:08:25 -07:00
Benjamin Segovia a64def5f2a i965: Improve (i.e. remove) some grf-to-mrf unnecessary moves
Several routines directly analyze the grf-to-mrf moves from the Gen
binary code. When it is possible, the mov is removed and the message
register is directly written in the arithmetic instruction

Also redundant mrf-to-grf moves are removed (frequently for example,
when sampling many textures with the same uv)

Code was tested with piglit, warsow and nexuiz on an Ironlake
machine. No regression was found there

Note that the optimizations are *deactivated* on Gen4 and Gen6 since I
did test them properly yet. No reason there are bugs but who knows

The optimizations are currently done in branch free programs *only*.
Considering branches is more complicated and there are actually two
paths: one for branch free programs and one for programs with branches

Also some other optimizations should be done during the emission
itself but considering that some code is shader between vertex shaders
(AOS) and pixel shaders (SOA) and that we may have branches or not, it
is pretty hard to both factorize the code and have one good set of
strategies
2010-07-26 13:08:25 -07:00
Kristian Høgsberg e4aa9440d9 glx: Drop debug fprintf that snug in with the previous commit 2010-07-26 16:06:05 -04:00
Kristian Høgsberg 2235b1c72d glx: Enable copy subbuffer patch when GLX_DIRECT_RENDERING is #defined
Depending on __DRI_COPY_SUB_BUFFER doesn't work when we no longer include
dri_interface.h.

https://bugs.freedesktop.org/show_bug.cgi?id=29264
2010-07-26 15:52:45 -04:00
nobled c88fc26ac9 st/egl: Fix debug line
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2010-07-26 12:27:21 -07:00
nobled 3cef6c42bc util: fix CPU detection on OS X
s/PIPE_OS_DARWIN/PIPE_OS_APPLE, since there is no PIPE_OS_DARWIN.

Acked-by: Vinson Lee <vlee@vmware.com>
2010-07-26 12:27:01 -07:00
nobled b1ef3e0863 st/xorg: fix use-after-free
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2010-07-26 12:26:58 -07:00
Jakob Bornecrantz 0697d41fce i965g: Enable llvm in dri driver if built 2010-07-26 12:26:53 -07:00
nobled 4830237660 i915g: Fix llvm build
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2010-07-26 12:25:05 -07:00
Kristian Høgsberg bc34aa6128 glx: Drop duplicate psc field in dri context struct
Same problem as fixed for drisw in 4d58b5b482.
2010-07-26 15:18:56 -04:00
Eric Anholt 941b893032 i965: Allow VS MOVs to use immediate constants.
Clarifies program assembly, and with a little tweak to always use
constant_map, we could cut down on constant buffer payload.
2010-07-26 10:11:31 -07:00
Stephan Schmid 0bebdc230f r600g: implememt the LIT instruction 2010-07-26 10:34:05 -04:00
Marek Olšák a3a42e4696 util: fix another mutex leak in mempool
By fixing one, I introduced another. Crap.
2010-07-26 14:56:48 +02:00
Marek Olšák d26fb69169 util: fix mutex leaks in mempool 2010-07-26 14:53:27 +02:00
Dave Airlie 8c26dc2bfe r300g: fix macro substitution problem
isn't a problem yet, but have issues in hiz branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-07-26 12:02:14 +10:00
Marek Olšák 6f2936c654 r300g: implement D24X8 texture sampling for r3xx-r4xx
Because the hw can't sample it, I reinterpret the format as G16R16 and
sample the G component. This gives 16 bits of precision, which should be
enough for depth texturing (surprisingly, the sampled values are exactly
the same as in D16 textures).

This also enables EXT_packed_depth_stencil on those old chipsets, finally.
2010-07-25 23:40:51 +02:00
Marek Olšák 451a0ddb19 r300g: make sure a texture is large enough for the CBZB clear
The number of macrotiles in the Y direction must be even, otherwise memory
corruption may happen (e.g. broken fonts). Basically, if we get a buffer
in resource_from_handle, we can determine from the buffer size whether it's
safe to use the CBZB clear or not.
2010-07-25 10:33:09 +02:00
Marek Olšák 49330fc5ac r300g: do not use TXPITCH_EN if the width is POT and the height is NPOT 2010-07-25 10:25:21 +02:00
Marek Olšák c92d232061 r300g: do not use TXPITCH_EN for power-of-two textures from the DDX
We were using TXPITCH_EN for textures from the DDX since ever, for nothing.
2010-07-25 10:25:21 +02:00