Commit graph

37857 commits

Author SHA1 Message Date
nobled
e9f3994b16 llvmpipe: Always use floating-point operators for floating-point types
See:
http://bugs.freedesktop.org/29404
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-10 10:24:26 +01:00
Eric Anholt
0ff3b2b344 glsl2: Make ir_algebraic reassociate add/mul operands for constant folding.
It's rather easy to produce two constant multiplies separated by other
multiplies while writing a BRDF shader, and non-obvious enough in the
resulting codegen that I didn't catch it in my demo code until just
recently.  Cuts 3 965 instructions from my demo (<1%), and 20 from
glsl-fs-raytrace (1.3%).
2010-08-09 21:42:17 -07:00
Eric Anholt
5854d4583c glsl2: Add a pass to transform ir_binop_sub to add(op0, neg(op1))
All the current HW backends transform subtract to adding the negation,
so I haven't bothered peepholing it back out in Mesa IR.  This allows
some subtract of subtract to get removed in ir_algebraic.
2010-08-09 21:41:14 -07:00
Eric Anholt
8bebbeb7c5 glsl2: Add constant propagation.
Whereas constant folding evaluates constant expressions at rvalue
nodes, constant propagation tracks constant components of vectors
across execution to replace (possibly swizzled) variable dereferences
with constant values, triggering possible constant folding or reduced
variable liveness.
2010-08-09 19:21:18 -07:00
Eric Anholt
81996ae861 i965: More s/stderr/stdout/ for program debug. 2010-08-09 18:24:23 -07:00
Eric Anholt
2dd3ae0d4a glsl2: Teach copy propagation about "if" and "loop" instructions.
This lets us track copies across basic block boundaries.  The loop
doesn't get a filled out list of available copies into it yet, though.

glsl-fs-raytrace drops from 585 to 535 Mesa IR instructions out of the
compiler, and it appears that Yo Frankie's largest shaders decrease in
Mesa IR count by about 10% as well.
2010-08-09 17:14:31 -07:00
Kenneth Graunke
8aa7dbacaf glsl2: Refresh autogenerated file builtin_function.cpp. 2010-08-09 12:45:25 -07:00
Kenneth Graunke
2eed82ebc0 texture_builtins.py: Fix cut and paste errors in function names.
Some signatures were being generated with the wrong function name.
2010-08-09 12:41:39 -07:00
Henri Verbeet
e165453f84 radeon: Use MESA_FORMAT_SARGB8 for sRGB formats
This can be supported on r600 without using the endian swapper, and is a
better fit for (typical) uploads using GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV
anyway.
2010-08-09 15:06:02 -04:00
Henri Verbeet
08933b5a17 r600c: Disable alpha test during blits 2010-08-09 15:03:27 -04:00
Kenneth Graunke
dbff7b541e glsl2: Use gl_DepthRange's proper name.
It was being incorrectly added as gl_DepthRangeParameters, which is the
type name, not the variable name.
2010-08-09 11:42:37 -07:00
Ian Romanick
c88e60a27b ir_algebraic: Support other comparisons in ir_unop_logic_not 2010-08-09 10:46:38 -07:00
Ian Romanick
fe277089c7 ir_algebraic: Convert ir_unop_logic_not handler to use a switch statement
Currently only ir_binop_equal and ir_binop_nequal are supported, but
soon all of the relational operators will be added.  Making this
change now will simplify those commits.
2010-08-09 10:19:39 -07:00
José Fonseca
6e1f9bc8f6 gallivm: More type checks. 2010-08-09 17:31:18 +01:00
José Fonseca
8a3a971743 gallivm: Don't call LLVMBuildFNeg on llvm-2.6.
It didn't exist yet.
2010-08-09 17:31:18 +01:00
nobled
fc9a49b638 gallivm: Always use floating-point operators for floating-point types
This fixes the assert added in LLVM 2.8:
assert(getType()->isIntOrIntVectorTy() &&
       "Tried to create an integer operation on a non-integer type!")

But it also fixes some subtle bugs, since we should've been doing this
since LLVM 2.6 anyway.

Includes a modified patch from steckdenis@yahoo.fr for the
FNeg instructions in emit_fetch(); thanks for pointing those out.

http://bugs.freedesktop.org/29404
http://bugs.freedesktop.org/29407

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-09 17:31:18 +01:00
José Fonseca
65b9747a54 util: Move _mm_shuffle_epi8() to u_sse.h.
It's bound to be useful elsewhere.
2010-08-09 17:31:18 +01:00
Aras Pranckevicius
3adce986c4 glsl2: do not use __retval name; two underscores is reserved word according to GLSL spec (and Win7 ATI drivers do complain about that) 2010-08-09 09:08:03 -07:00
Aras Pranckevicius
5023edaf5d glsl: fix missing return in ir_structure_splitting 2010-08-09 09:04:32 -07:00
Jerome Glisse
95fb0bf58d r600g: fix r600 context structure, avoid segfault when no scissor
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-09 11:33:25 -04:00
Marek Olšák
29b7d26401 r300g: do not print shader compiler errors by default 2010-08-09 17:18:45 +02:00
Marek Olšák
2cad5350f9 r600g: fix some warnings 2010-08-09 15:00:19 +02:00
Marek Olšák
00963589b4 r600g: fill out some missing caps and sort them
The shader caps need additional corrections.

(based on a patch from netkas at Phoronix)
2010-08-09 14:59:54 +02:00
Andre Maasikas
67ee40684d radeon: fix npot mipmap alignment on r600
seems it got lost in commit 0d383547
have no earlier radeons to test, but npot mipmaps were not supported there?
2010-08-09 14:37:01 +03:00
Andre Maasikas
8d0985b9b8 r600: bump glsl version
from the tests i couldn't find any new driver faults
2010-08-09 14:28:00 +03:00
Dave Airlie
771ad67414 r300g: fix hiz/zmask offset emissions.
ofs is in dwords, so need to shift it for registers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-09 19:56:45 +10:00
Eric Anholt
f8d2cfe4a6 glsl2: Handle plain variable copies in struct splitting.
glsl-fs-raytrace goes from 620 Mesa IR instructions out of the
compiler to 585.
2010-08-08 23:45:58 -07:00
Luca Barbieri
3bb0719fe1 nouveau: fix maps with PIPE_TRANSFER_UNSYNCHRONIZED | PIPE_TRANSFER_DONTBLOCK
In this case, we were incorrectly prioritizing PIPE_TRANSFER_DONTBLOCK over
PIPE_TRANSFER_UNSYNCHRONIZED.

This can lead to failure in the Mesa VBO draw paths that end up specifying
both, but don't expect map to fail (in particular, the problem manifested as
a leak of buffer objects in teapot with other changes).
2010-08-09 05:02:12 +02:00
Marek Olšák
aef0fbd5b6 r300g: remove a flush
Ooops, it wasn't supposed to be there.
2010-08-08 23:20:43 +02:00
José Fonseca
12f5c0f9ce gallivm: Fix more integer operations. 2010-08-08 22:18:53 +01:00
nobled
cd5af8c703 gallivm: Use the correct context for integers
See:
http://bugs.freedesktop.org/29407
2010-08-08 22:08:52 +01:00
Marek Olšák
4f5e51068b r300g: flush zmasks of zbuffers we are going to use as samplers
It sometimes works, sometimes not. I guess we have the zmask offsets wrong.
2010-08-08 22:53:31 +02:00
Marek Olšák
363b74f132 r300g: do not allocate a zmask block for 3D textures and cubemaps 2010-08-08 22:29:00 +02:00
Marek Olšák
757c78afe7 r300g: generalize the way we ask for hyperz
This makes it compatible with the modified DRM interface in drm-radeon-testing.

Also, now you need to set RADEON_HYPERZ=1 to be able to use hyperz.
It's not bug-free yet.
2010-08-08 22:28:35 +02:00
José Fonseca
d827972816 gallivm: Add type checks for the basic operations. 2010-08-08 21:02:59 +01:00
José Fonseca
b9a21fd6ca draw: Remove unused variable. 2010-08-08 13:58:23 +01:00
nobled
445e59057f draw: Use the correct type for integers
Two integers were being operated on as
a vector of floats in draw_llvm_generate().

This bug got uncovered by fixing this bug:
http://bugs.freedesktop.org/29407
2010-08-08 12:19:07 +01:00
Dave Airlie
b55f627937 r300g: take hiz/zmask offsets into a/c when clearing.
Need to add a test for multi-hiz/zmask db in a single context.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-08 19:12:14 +10:00
Vinson Lee
ef3b17f5f3 i810: Add missing header m_xform.h.
This is another follow-up to commit
f4511c4835.
2010-08-07 23:38:20 -07:00
Vinson Lee
facf368df2 dri: Add missing header m_xform.h.
This is a follow-up patch to commit
f4511c4835.

Files that include tnl_dd/t_dd_dmatmp.h now need to also include
m_xform.h as t_context.h no longer includes it.
2010-08-07 23:19:27 -07:00
Vinson Lee
f4511c4835 tnl: Reduce header file inclusion in t_context.h.
t_context.h
Remove m_matrix.h and m_xform.h.

t_vb_program.c
Include m_xform.h.

t_vb_render.c
Include m_xform.h.
2010-08-07 22:56:35 -07:00
Vinson Lee
2154dfa701 swrast: Reduce header file inclusion in s_zoom.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 22:13:19 -07:00
Vinson Lee
a2a40cefe2 swrast: Fix header file inclusion in s_texfilter.h.
Include mtypes.h for GLcontext symbol.
Include s_context.h for texture_sample_func symbol.
2010-08-07 22:05:28 -07:00
Vinson Lee
c20e977467 swrast: Reduce header file inclusion in s_texcombine.h.
Include mtypes.h for GLcontext sybmol.
Include s_span.h for SWspan symbol.
2010-08-07 22:01:27 -07:00
Vinson Lee
e616d05b22 swrast: Reduce header file inclusion in s_stencil.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 21:44:53 -07:00
Vinson Lee
01739cdda2 swrast: Reduce header file inclusion in s_masking.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 21:24:16 -07:00
Vinson Lee
562c727414 swrast: Reduce header file inclusion in s_logic.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 21:07:11 -07:00
Vinson Lee
f009f177fd swrast: Reduce header file inclusion in s_fragprog.h.
s_fragprog.h
Include mtype.h for GLcontext symbol.
Include s_span.h for SWspan symbol.

s_fragprog.c
Include s_context.h now that it is removed from s_fragprog.h.
2010-08-07 21:01:12 -07:00
Vinson Lee
7b56285487 swrast: Reduce header file inclusion in s_fog.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 13:57:50 -07:00
Vinson Lee
5db13da866 swrast: Clean up header file inclusion in s_depth.h.
Include mtypes.h for GLcontext symbol.
Include s_span.h for SWspan symbol.
2010-08-07 13:04:50 -07:00