Commit Graph

37100 Commits

Author SHA1 Message Date
Brian Paul
672f6cdc19 glapi: use _mesa_snprintf()
Note that the enums.c file is generated with this script.
This will preserve the change from commit
c4066b78c0.
2010-07-13 07:44:35 -06:00
Marek Olšák
56da2403fc r300/compiler: implement the Abs source operand modifier for vertex shaders 2010-07-13 15:06:22 +02:00
Marek Olšák
b5fc699b1e r300/compiler: emulate SIN/COS/SCS in r3xx-r4xx vertex shaders
Despite the docs, the corresponding hardware instructions are r5xx-only.
2010-07-13 15:06:22 +02:00
Vinson Lee
c4066b78c0 mesa: s/snprintf/_mesa_snprintf/ 2010-07-13 00:31:37 -07:00
Marek Olšák
2470750b4e r300g: do not advertise half_float_vertex on rv3x0
rv3x0 can't do it.
2010-07-13 06:31:36 +02:00
Eric Anholt
4ca07882af ir_to_mesa: Rely on ir_mat_op_to_vec for matrix multiplication support. 2010-07-12 19:50:49 -07:00
Eric Anholt
15ded63279 glsl2: Add matrix multiplication to ir_mat_op_to_vec. 2010-07-12 19:50:49 -07:00
Eric Anholt
3f08989267 ir_to_mesa: Emit OPCODE_MAD when we find an ADD of a MUL.
Bug #27914.
2010-07-12 19:50:49 -07:00
Eric Anholt
562c3d0cb1 glsl2: Flatten expression that appear as the parameters of ir_call as well. 2010-07-12 19:50:49 -07:00
Eric Anholt
94da2abfd4 glsl2: Flatten expressions that appear as the children of ir_return as well. 2010-07-12 19:50:49 -07:00
Ian Romanick
31a97868fc linker: Merge global-scope instructions into main
Find instructions in all shaders that are not contained in a function
(i.e., initializers for global variables).  "Move" these instructions
to the top of the main function in the linked shader.  As a
side-effect, many global variables will also be copied into the linked
shader.
2010-07-12 19:12:28 -07:00
Ian Romanick
15ce87e9f2 linker: Detect the shader that contains "main" during intrastage linking 2010-07-12 18:51:55 -07:00
Ian Romanick
11fc7beb2f ir_function: Make matching_signature not return const
The linker needs to use this function to get specific function signatures, but
it also needs to modify the returned signature.  Since this method isn't itself
const (i.e., const this pointer), there is no value in making a const and
non-const version.
2010-07-12 18:51:55 -07:00
Ian Romanick
13f782c4ae linker: Implement first bits of intrastage linking
This currently involves an ugly hack so that every link doesn't result
in all the built-in functions showing up as multiply defined.  As soon
as the built-in functions are stored in a separate compilation unit,
ir_function_signature::is_built_in can be removed.
2010-07-12 18:51:55 -07:00
Ian Romanick
e2e5d0def4 linker: Refactor cross_validate_uniforms into cross_validate_globals
The later, more generic function will be used in the intra-stage linker.
2010-07-12 18:51:55 -07:00
Marek Olšák
50db6dba65 r300g: extend and clean up debug logging 2010-07-13 01:34:21 +02:00
Marek Olšák
499022c282 r300g/swtcl: do not emit texcoords if they are also stuffed in GA 2010-07-13 01:34:21 +02:00
Marek Olšák
f5804e64b4 r300g: rework the draw_rectangle hook
It is a lot simplier, cleaner, and more stable now.
2010-07-13 01:34:09 +02:00
Eric Anholt
d74c9ff046 glsl2: Use a better talloc context for ir_expression_flattening.
The instruction can be hung off of any other in the tree, even if the
other one will be deleted, since it'll get stolen to the shader's
context later if it's still live.
2010-07-12 16:07:02 -07:00
Eric Anholt
7b96b474e0 glsl2: Add support for variable vector indexing on the LHS of assignments.
Fixes glsl-vs-vec4-indexing-3.
2010-07-12 16:07:02 -07:00
Eric Anholt
b87259d3ef glsl2: Fix copy propagation in the presence of derefs in array indexes.
We would clear the in_lhs flag early, avoiding copy propagation on the
array index variable (oops) and then copy propagating on the array
variable (ouch).  Just avoid all copy propagation on the LHS instead.
2010-07-12 16:07:02 -07:00
Eric Anholt
8258a6a2c3 ir_to_mesa: Add support for dereferencing matrices from arrays. 2010-07-12 16:07:02 -07:00
Ian Romanick
506880bc32 ir_validate: Also perform usual checks on ir_dereference_variable nodes 2010-07-12 15:46:16 -07:00
Ian Romanick
8baf21b1a4 ir_validate: Validate that varibles are declared before used in IR 2010-07-12 15:43:50 -07:00
Ian Romanick
3fb878722e linker: Stub-out intrastage linker 2010-07-12 15:19:30 -07:00
Ian Romanick
ffd7bb031e Make shader_api.h be C++ friendly 2010-07-12 15:19:30 -07:00
Ian Romanick
c67016de96 ir_validate: Additional function related invariant checks
Add two invariant checks related to functions and function signatures:

1. Ensure that function definitions (ir_function) are not nested.

2. Ensure that the ir_function pointed to by an ir_function_signature
is the one that contains it in its signatures list.
2010-07-12 15:19:29 -07:00
Ian Romanick
df05ad4e1a ir_function_signature: Add method to get the function owning a signature
There is no setter function, the getter returns a constant pointer,
and ir_function_signature::_function is private for a reason.  The
only way to make a connection between a function and function
signature is via ir_function::add_signature.  This helps ensure that
certain invariants (i.e., a function signature is in the list of
signatures for its _function) are met.
2010-07-12 15:19:29 -07:00
Ian Romanick
f3235eb37f glsl2: Add utility function clone_ir_list 2010-07-12 15:19:29 -07:00
Ian Romanick
792e01c1e2 ir_call: Add method to set the function signature being called 2010-07-12 15:19:29 -07:00
Ian Romanick
b500981226 glsl2: Implement ir_function::clone and ir_function_signature::clone 2010-07-12 15:19:29 -07:00
Ian Romanick
81d664f099 glsl2: Move temp declaration to correct side of if-statement in IR 2010-07-12 15:19:29 -07:00
Ian Romanick
10d222b702 glsl2: Add missing fields in ir_variable::clone 2010-07-12 14:56:21 -07:00
Ian Romanick
0b9ae3befb glsl2: Add declarations for temporaries to instruction stream
Temporary variables added for &&, ||, and ?: were not being added to
the instruction stream.  This resulted in either test failures or
Valgrind being angry after the original IR tree was destroyed by
talloc_free.  The talloc_free caused the ir_variables to be destroyed
even though they were still referenced.
2010-07-12 14:56:21 -07:00
Maciej Cencora
7facb8f2c8 Merge branch 'master' of git://anongit.freedesktop.org/mesa/mesa 2010-07-12 23:42:06 +02:00
Vinson Lee
c6b7aa96f9 r600: Fix include recursion.
Fix r600_context.h -> r700_oglprog.h -> r600_context.h include
recursion.
2010-07-12 14:23:51 -07:00
Vinson Lee
5ba0ba72d9 r300g: Remove unnecessary header. 2010-07-12 14:12:02 -07:00
Eric Anholt
288733f600 glsl2: Store the gl_type of the array's element type in the array.
Fixes glsl-fs-uniform-array-1, glsl-vs-uniform-array-1, and the -2
tests on software.
2010-07-12 14:05:20 -07:00
Eric Anholt
7b48843ecd Revert "ir_to_mesa: Add support for adding/subtracting matrices."
This reverts commit b4d0c0e0ee.
Now that ir_mat_op_to_vec is landed, this change is no longer needed.
2010-07-12 13:26:49 -07:00
Eric Anholt
6d8a0a0aad glsl2: Add a new pass at the IR level to break down matrix ops to vector ops.
This will be used by the Mesa IR and likely most HW backends, as it
allows other optimizations to occur that might not otherwise.

Fixes glsl-vs-mat-sub-1, glsl-vs-mat-div-1.
2010-07-12 13:26:46 -07:00
Maciej Cencora
ba03a0b5ba radeon: fix some wine d3d9 tests
Need to flush command stream before mapping texture image
that is referenced by current cs.

Candidate for 7.8 branch.

Signed-off-by: Maciej Cencora <m.cencora@gmail.com>
2010-07-12 21:48:43 +02:00
Eric Anholt
5723e5bb8b glsl2: Flatten out expressions that are the child of an assignment rhs.
This feels a little odd, but it will be useful for ir_mat_to_vec,
where I want to see a plain assignment of the expression to a
variable, not to a writemasked array dereference with a call as the
array index.
2010-07-12 12:02:32 -07:00
Eric Anholt
d2afc87445 glsl2: Check when inlining a bare function call that it actually is.
It would be easy to miss an entry either of the two visitors involved
that would result in trying to ir->remove() the call to remove it from
the instruction stream when really it's part of an expression tree
that wasn't flattened.
2010-07-12 12:02:11 -07:00
José Fonseca
cd629c28d7 llvmpipe: Re-enable threading on windows. 2010-07-12 15:40:33 +01:00
nobled
209009d75f os: remove gratuitous pipe_barrier placeholder code
There's already an implementation of pipe_barrier using
the other pipe_* primitives; just use that on Windows, too.

Now Windows passes pipe_barrier_test.
2010-07-12 15:40:33 +01:00
nobled
7ce9a3adc5 os, rbug: remove PIPE_THREAD_HAVE_CONDVAR
The new default implementation of pipe_condvar makes it
unnecessary.
2010-07-12 15:40:33 +01:00
nobled
f321d5c38a os: Implement pipe_condvar on Windows Vista and later
Unfortunately compiling with these defines enabled would mean
Gallium can't run on Windows XP/2003 or older.

Todo: Need a macro to declare if we don't care about WinXP
compatibililty.
2010-07-12 15:40:32 +01:00
nobled
9795a60a8f os: Implement pipe_condvar on win32
Or at least a little of it. This version will sleep
for a fixed amount of time instead of just deadlocking,
which is a slight improvement.

Also do the same thing on any unrecognized platform.
2010-07-12 15:40:32 +01:00
Marek Olšák
8c836f7f74 r300g: implement fast color clear
An initial implementation made by Dave Airlie.

For it to be used, a color-only clear must be invoked and exactly one
point-sampled render target must be set. The render target must be
macrotiled (for us to overcome alignment issues) and bpp must be either
16 or 32.

I can't see a difference in performance. :(

Conflicts:

	src/gallium/drivers/r300/r300_blit.c
2010-07-12 13:26:00 +02:00
Marek Olšák
78e8a8765f r300g: clear and copy a resource with a rectangular point sprite
With an ordinary quad, the pixels on the main diagonal are computed
and stored twice, which is somewhat inefficient and might not work well
with specialized clear codepaths.
2010-07-12 13:06:45 +02:00