Commit graph

38544 commits

Author SHA1 Message Date
Christoph Bumiller
0b8170103c nv50: fix indirect CONST access with large or negative offsets 2010-09-13 17:26:41 +02:00
Christoph Bumiller
3b3c20744f nv50: MOV TEMP[0], -CONST[0] must be float32 negation 2010-09-13 17:26:41 +02:00
Christoph Bumiller
1f1411f2cc nv50: interp cannot write flags reg 2010-09-13 17:26:41 +02:00
Christoph Bumiller
cca3906a9b nv50: check for immediates when turning MUL ADD into MAD 2010-09-13 17:26:41 +02:00
Christoph Bumiller
98c87c382d nv50: handle TGSI EXP and LOG again 2010-09-13 17:26:41 +02:00
Christoph Bumiller
1fa812d84a nv50: match TEMP limit with nv50 ir builder
Mesa doesn't respect it anyway, but this makes it assert rather
than threads access areas of l[] that don't belong to them.
2010-09-12 11:41:57 +02:00
Christoph Bumiller
fdb00ac1ef nv50: newlines in shader bincode printing 2010-09-12 11:41:57 +02:00
Christoph Bumiller
d4fd11a628 nv50: cannot move from local mem to output reg directly 2010-09-12 11:41:57 +02:00
Xavier Chantry
9b39fb1b61 nv50: fix size of outputs_written array 2010-09-12 00:59:50 +02:00
Christoph Bumiller
fc31a25afa nv50: minor compiler fixes and cleanups 2010-09-12 00:59:49 +02:00
Christoph Bumiller
7a4a537be1 nv50: reduce bb_reachable_by runtime from pot to linear
As a by-product, remove the memory leak of nv_basic_blocks.
2010-09-12 00:59:49 +02:00
Christoph Bumiller
6997da9f3c nv50: fix can_load check for 3rd source 2010-09-09 19:21:35 +02:00
Christoph Bumiller
6b14a3eb19 nv50: address regs are 16 bit 2010-09-09 19:21:34 +02:00
Christoph Bumiller
246ebd7df1 nv50: duplicate interps in load_proj_tex_coords
Otherwise we might clobber the origin interpolation result or
use the result of the RCP before its definition.
2010-09-09 19:21:34 +02:00
Christoph Bumiller
9cc80e25db nv50: create value references with the right type
Since atm our OPs aren't typed but instead values are, we need to
take care if they're used as different types (e.g. a load makes a
value u32 by default).

Maybe this should be changed (also to match TGSI), but it should
work as well if done properly.
2010-09-09 19:21:34 +02:00
Christoph Bumiller
f30810cb68 nv50: use actual loads/stores if TEMPs are accessed indirectly 2010-09-09 19:21:34 +02:00
Christoph Bumiller
d8dcff7970 nv50: don't parse again in tgsi_2_nc 2010-09-09 19:21:34 +02:00
Christoph Bumiller
d91b8865ec nv50: prepare for having multiple functions
At some point we'll want to support real subroutines instead of
just inlining them into the main shader.

Since recursive calls are forbidden, we can just save all used
registers to a fixed local memory region and restore them on a
return, no need for a stack pointer.
2010-09-09 19:21:34 +02:00
Christoph Bumiller
217542a061 nv50: save tgsi instructions 2010-09-09 19:21:34 +02:00
Christoph Bumiller
9e4901402c nv50: load address register before using it, not after 2010-09-03 14:27:23 +02:00
Christoph Bumiller
222d2f2ac2 Merge remote branch 'origin/master' into nv50-compiler
Conflicts:
	src/gallium/drivers/nv50/nv50_program.c
2010-09-02 18:31:49 +02:00
Christoph Bumiller
443abc80db nv50: fix build-predicate function 2010-09-02 18:28:47 +02:00
Christoph Bumiller
9f9ae4eee1 nv50: fix find_dom_frontier 2010-09-02 18:28:39 +02:00
Jerome Glisse
e73c5501b2 r600g: fix memory/bo leak
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-02 11:47:30 -04:00
Brian Paul
c9039fdb16 mesa: fix code generation for ir_unop_sqrt
The CMP instruction needed to be flipped to properly handle
operand==0.

Fixes fd.o bug 29923.
2010-09-02 07:58:33 -06:00
Brian Paul
9eca0e2c3e mesa: fix some printf warnings with casts 2010-09-02 07:57:16 -06:00
Dave Airlie
5d5f693cef r600g: fix thinko in shadow code.
spotted by taiu on irc
2010-09-02 21:26:12 +10:00
Dave Airlie
76d0541e79 r600g: fix logicop, the 3d ROP is the 2D rop shifted twice. 2010-09-02 16:40:41 +10:00
Dave Airlie
e8ff0f63b6 r600g: fix depth texture tests 2010-09-02 15:51:23 +10:00
Kenneth Graunke
f32d3df8ab glsl: Apply implicit conversions to structure constructor parameters.
The code for handling implicit conversions should probably get
refactored, but for now, this is easy.

Fixes piglit test constructor-26.vert.
2010-09-01 20:39:09 -07:00
Kenneth Graunke
43a6200f3c glsl: Convert constant record constructor parameters to ir_constants.
I'm not sure if this is strictly necessary, but it seems wise.
2010-09-01 20:39:09 -07:00
Kenneth Graunke
cfe0dd5622 glsl: Reject structure constructors that have too many arguments.
Fixes piglit test constructor-27.vert.
2010-09-01 20:39:09 -07:00
Ian Romanick
e466b182bb glsl2: Remove unnecessary glsl_symbol_table::get_function parameter return_constructors
Now that constructors are not generated as functions or stored in the
symbol table, there is no need to flag whether or not constructors
should be returned.
2010-09-01 20:39:09 -07:00
Ian Romanick
4d6221f90d glsl2: Remove unused method glsl_type::generate_constructor 2010-09-01 20:39:09 -07:00
Ian Romanick
16d9ebb357 glsl2: Remove unused 'constructor' parameter from glsl_symbol_table::add_type 2010-09-01 20:39:09 -07:00
Ian Romanick
a789ca649c glsl2: Don't generate constructor functions for structures 2010-09-01 20:39:09 -07:00
Ian Romanick
37200d83d3 glsl2: Emit structure constructors inline
Fixes piglit test cases glsl-[fv]s-all-0[12].
2010-09-01 20:39:09 -07:00
Dave Airlie
7299023c2a r600g: add missing vertex fetch formats to the translation table.
fixes at least 2 more piglits.
2010-09-02 13:32:25 +10:00
Jerome Glisse
31b84acbd2 r600g: fix binding of same texture to several target slot
One can bind same texture or sampler to different slot,
each slot needs it own state. The solution implemented
here is not exactly beautifull or optimal need to think
to somethings better.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01 21:59:28 -04:00
Kenneth Graunke
3960558795 glsl: Fix write mask in matrix-from-matrix constructors.
If the matrix being constructed was larger than the source matrix, it
would overwrite the lower-right part of the matrix with the wrong
values, rather than leaving it as the identity matrix.

For example, constructing a mat4 from a mat2 should only use a writemask
of "xy" when copying from the source, but was using "xyzw".

Fixes the code generated by piglit test constructor-23.vert.
2010-09-01 18:57:51 -07:00
Kenneth Graunke
54b35e6735 glsl: Add proper handling for constant matrix-from-matrix constructors.
Fixes piglit test case constructor-21.vert and changes
constructor-22.vert to give the correct output.
2010-09-01 18:57:51 -07:00
Kenneth Graunke
1f7c7df40f glsl: Move generate_constructor_(matrix|vector) to ir_constant ctor. 2010-09-01 18:57:50 -07:00
Kenneth Graunke
550237eedd ast_function: Fix check for "too few components".
This was triggering even for matrix-from-matrix constructors.  It is
perfectly legal to construct a mat3 from a mat2 - the rest will be
filled in by the identity matrix.

Changes piglit test constructor-23.vert from FAIL to PASS, but the
generated code is incorrect.
2010-09-01 18:57:50 -07:00
Kenneth Graunke
ee88c46640 ast_function: Remove bogus cases from generate_constructor_matrix.
There are no integer matrix types, so switching on them is silly.
2010-09-01 18:57:50 -07:00
Dave Airlie
36192b772e r600g: fix incorrect state naming in pipe_sampler vs pipe_sampler_view
fixes problems in valgrind with uninitialised values.
2010-09-02 11:17:37 +10:00
Eric Anholt
5ad74779ce ir_to_mesa: Load all the STATE_VAR elements of a builtin uniform to a temp.
Like the constant handling and the handling of other uniforms, we add
the whole thing to the Parameters, avoiding messy, incomplete logic
for adding just the elements of a builting uniform that get used.
This means that a driver that relies only on ParameterValues[] for its
parameters will have an increased parameter load, but drivers
generally don't do that (since they have other params they need to
handle, too).

Fixes glsl-fs-statevar-call (testcase for Ember).  Bug #29687.

Regresses glsl-vs-array-04 on 965.  Thanks to a slight change in
register allocation, this test of undefined behavior now wraps around
the register space and unexpectedly reads the constant value it's
trying to compare to.  The test should probably not look at the
resulting color, since behavior is undefined.
2010-09-01 17:08:23 -07:00
Eric Anholt
500e7b7599 ir_to_mesa: Add a little helper for emitting link failure messages. 2010-09-01 17:08:23 -07:00
Eric Anholt
86af037e6a mesa: Fix many printf-like warnings.
Most of these are just typecasting to long to match the arg type.  I
don't really care too much about getting a GLsizei or whatever
appropriate type in.  However, there were a number of real bugs, like
missing arguments or passing floats to integer format specifiers.  My
favorite: printflike("%s, argument") is missing an argument.
2010-09-01 17:08:23 -07:00
Eric Anholt
3cddc15d9d mesa: Add __printf__ attribute to printf-like functions to get warnings. 2010-09-01 17:08:23 -07:00
Dave Airlie
557a71c506 mesa/st: remove check for buffer/elements = 0
shown by the glsl-vs-point-size failing on r600g.

the test passes on softpipe and I get a full piglit test run completing on r600g.
2010-09-02 09:51:25 +10:00