Commit graph

37820 commits

Author SHA1 Message Date
Dave Airlie
03c59e4ab1 r600g: fixup pitch alignment like r600c.
This still needs work, passes tex3d, fbo-scissor-bitmap, scissor-bitmap
2010-08-18 12:49:59 +10:00
Luca Barbieri
547e88e70d translate_sse: don't overwrite source buffer pointer
We were putting the source pointer in a register used as a temporary,
breaking all paths that don't read the data in a single instruction.
2010-08-18 04:21:46 +02:00
Eric Anholt
ede67e3071 glcpp: Add testcase for #if handling bug that breaks Savage2. 2010-08-17 17:51:10 -07:00
Dave Airlie
edb465e9bb r600g: fix height calcs for miptree
h needs to be rounded up, this probably needs revisiting when we get
to tiling etc.

fixes fbo-generatemipmap-npot
2010-08-18 10:50:19 +10:00
Dave Airlie
1d18739290 r600g: emit texture level offset in CB/DB setup.
8 more piglit tests pass,
fbo-clearmipmap, fbo-copyteximage, fbo-generatemipmap,
fbo-generatemipmap-nonsquare, fbo-generatemipmap-scissor,
fbo-generatemipmap-viewport, gen-teximage, gen-texsubimage
2010-08-18 10:35:09 +10:00
Eric Anholt
6992c3c373 ir_to_mesa: Fix implementation of ir_binop_equal, ir_binop_notequal.
These binops are the vector-to-bool comparisons, not vec-to-bvec.  We
likely want both operations avilable as expression, since 915 and 965
FS naturally does the vector version, while 965 VS can also naturally
do the scalar version.  However, we can save that until later.

Fixes:
glsl-fs-vec4-operator-equal.shader_test
glsl-fs-vec4-operator-notequal.shader_test
glsl-vs-vec4-operator-equal.shader_test
glsl-vs-vec4-operator-notequal.shader_test
2010-08-17 17:27:44 -07:00
Eric Anholt
02e1639829 i915: Add support for SSG opcode.
Fixes glsl-fs-sign and many of the tests of trig builtins.
2010-08-17 16:39:18 -07:00
Eric Anholt
e43b250fc0 i915: Add support for reading output regs in the FS.
Fixes glsl-unused-varying and many others, since we produce an output
reg read any time gl_FragColor is written inside an if statement.
2010-08-17 16:39:18 -07:00
Eric Anholt
66690864ef i915: Add support for OPCODE_DP2.
Fixes glsl-fs-dot-vec2.
2010-08-17 16:39:17 -07:00
Eric Anholt
a58514cc9c i915: Enable ARB_fragment_shader by default.
Now that we have glsl2 with if flattening in place, most shaders will
just work.  Remaining failing shaders will mostly be due to loop
unrolling (in progress), some possible if flattening failures in
inlining functions (planning on fixing), and the register/instruction
count limits.

While the GLSL and GLSL-ES specs say that shaders shouldn't fail to
compile/link due to register/instruction limits, in practice we're not
the first vendor to expose GLSL on hardware with these limitations.
The benefit to application developers of providing a better language
for GPU programming is greater than the pain of having to handle
instruction limits (which they had to for ARB_fp on this hardware
anyway)
2010-08-17 16:39:17 -07:00
Ian Romanick
bdc0e5285a glsl2: Fix transpose of rows and cols
This error led to an assertion failure for some constructors of
non-square matrices.  It only occured in matrices where the number of
columns was greater than the number of rows.  It didn't even always
occur on those.

Fixes piglit glslparsertest case constructor-16.vert.
2010-08-17 16:06:30 -07:00
Henri Verbeet
8f5f44c9c8 r600c: Handle reads from PROGRAM_OUTPUT
with glsl2, reads from outputs are legal
2010-08-17 18:25:32 -04:00
Ian Romanick
40e114b5dc linker: Demote user-defined varyings in the VS-only case
Fixes piglit test case glsl-vs-ff-frag and bugzilla #29623.
2010-08-17 14:57:18 -07:00
Benjamin Segovia
5a38e70d59 prog_optimize: Only merge writes to temporary registers
In one optimization pass, register files may have been messed therefore
merging instructions which use the same index in two different register
files.
2010-08-17 14:57:18 -07:00
Jerome Glisse
608f749ec3 r600g: fix fake pixel output
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-17 17:25:08 -04:00
Eric Anholt
147ca9f3fc i965: Add support for DP2 in the VS.
Fixes glsl-vs-dot-vec2.
2010-08-17 13:59:08 -07:00
Eric Anholt
0e6066df63 glsl: When doing algebraic simplification, make sure the type still matches.
When simplifying (vec4(1.0) / (float(x))) to rcp(float(x)), we forgot
to produce a vec4, angering ir_validate when starting alien-arena.

Fixes:
glsl-algebraic-add-zero-2
glsl-algebraic-div-one-2
glsl-algebraic-mul-one-2
glsl-algebraic-sub-zero-3
glsl-algebraic-rcp-sqrt-2
2010-08-17 13:50:45 -07:00
Eric Anholt
f166d94fac glsl: Make ir_algebraic new expressions allocate out of the parent.
This could reduce the amount of memory used by a shader tree after
optimization, and increases consistency with other passes.
2010-08-17 13:47:15 -07:00
Ian Romanick
664364052f ir_constant: Don't assert on out-of-bounds array accesses
Several optimization paths, including constant folding, can lead to
accessing an ir_constant array with an out of bounds index.  The GLSL
spec lets us produce "undefined" results, but it does not let us
crash.

Fixes piglit test case glsl-array-bounds-01 and glsl-array-bounds-03.
2010-08-17 13:00:03 -07:00
Eric Anholt
1b708d8f4d mesa: Dump shader source before validating the shader.
This will make extracting source to produce minimal testcases for
shader compile issues easier.
2010-08-17 12:39:03 -07:00
Alex Deucher
6cee1d6adf r600c: fix dword miscount in blit emit code 2010-08-17 10:42:06 -04:00
Chia-I Wu
7f36b2980b targets/egl: Link with DRI_LIB_DEPS.
Use DRI_LIB_DEPS when linking GL/GLES state trackers.  This fixes
missing talloc symbol errors, and is hopefully more future proof.
2010-08-17 19:30:41 +08:00
nobled
37e5f78422 gallivm: Fix and re-enable MMX-disabling code
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2010-08-17 12:25:10 +01:00
Dave Airlie
0aa41e1d96 mesa: fix es1/2 build hopefully
needed to add cpp rules and includes properly for es1/es2
2010-08-17 20:54:45 +10:00
Dave Airlie
1c2a44e445 r300g: fix context destroy under hyperz
we were destroying the mm before unrefing all the objects, so segfault.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-17 19:01:18 +10:00
Vinson Lee
462e8a8b0d scons: Add -fno-common for 64-bit builds on Mac OS X.
This option is also needed for 64-bit builds if llvm is enabled.
Other the build fails during linking.
2010-08-17 00:20:58 -07:00
Dave Airlie
6043ee6e62 r600g: kill event type magic number in winsys
these events have names, use them.
2010-08-17 16:07:48 +10:00
Vinson Lee
279aeebff5 configs: Add -ltalloc to linux-dri.
Fixes build after glsl2 branch merge, which added talloc dependency.
2010-08-16 22:42:29 -07:00
Dave Airlie
3e58007892 r600g: add user clip plane support.
Apart from the fact that the radeon.h/r600_states.h editing is a nightmare, this
wasn't so bad.

passes piglit user-clip test now also trivial tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-17 14:19:09 +10:00
Eric Anholt
00ce188eb8 i965: Use the implied move available in most brw_wm_emit brw_math() calls.
This saves an extra message reg move in the program, though I'm not
clear on whether it will have any performance impact other than cache
footprint.  It will also fix those math calls on Sandybridge, where
the brw_eu_emit.c brw_math() support relies on the implied move being
used.
2010-08-16 20:09:53 -07:00
Eric Anholt
62383ae6fe i965: Add disasm for Compr4 instruction compression. 2010-08-16 20:06:55 -07:00
Ian Romanick
6c03c576cc Merge branch 'glsl2'
Conflicts:
	src/mesa/program/prog_optimize.c
2010-08-16 19:08:53 -07:00
Vinson Lee
15a3b42e13 util: Remove check_os_katmai_support.
check_os_katmai_support checks that the operating system running on a
SSE-capable processor supports SSE. This is necessary for unpatched
2.2.x and earlier kernels. 2.4.x and later kernels support SSE.

check_os_katmai_support will disable SSE capabilities for 32-bit x86
operating systems for which there is no code path. Currently, this
function handles Linux, Windows, and several BSDs. Mac OS, Cygwin, and
Solaris are several operating systems with no code paths.

Rather than add code for the unhandled operating systems, remove this
function altogether. This will fix SSE detection on all recent 32-bit
x86 operating systems. This completely breaks functionality on unpatched
2.2.x and earlier kernels, although there are likely no Gallium3D users
on such operating systems.
2010-08-16 18:52:37 -07:00
Dave Airlie
f50df65fcc r600g: drop libdrm_radeon link 2010-08-17 10:56:58 +10:00
Kenneth Graunke
a433cd286c glsl2: Refresh autogenerated file builtin_function.cpp. 2010-08-16 15:18:44 -07:00
Kenneth Graunke
2f9ecc818d glsl2: Add builtins profile for GLSL 1.30.
Many functions are currently wrapped with #if 0 since we haven't
implemented them yet.
2010-08-16 15:18:44 -07:00
Ian Romanick
45d97dd6d5 linker: Include compiler.h to avoid spurious warnings about INLINE 2010-08-16 13:59:34 -07:00
Ian Romanick
d0a9cbd20e glsl2: Silence unused variable warning 2010-08-16 13:59:01 -07:00
Vinson Lee
f437ee85f4 translate: Move loop variable declaration outside for loop.
Fixes MSVC build.
2010-08-16 13:52:57 -07:00
Kenneth Graunke
2e26145862 glcpp: Refresh autogenerated lexer and parser. 2010-08-16 13:43:43 -07:00
Kenneth Graunke
6be3a8b70a glcpp: Remove spurious newline generated by #version handling.
This was causing line numbering to be off by one.  The newline comes
from the NEWLINE token at the end of the line; there's no need to
insert one.
2010-08-16 13:43:35 -07:00
Marek Olšák
ecec6df9cf r300g: fix assert in the rasterizer block for r3xx-r4xx
Reported-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
2010-08-16 19:19:17 +02:00
Ian Romanick
fc63e37b97 ir_to_mesa: Silence unused variable warnings 2010-08-16 09:45:01 -07:00
Ian Romanick
68772031e6 ir_to_mesa: Clean up assertions in ir_to_mesa_visitor::visit(ir_texture *) 2010-08-16 09:43:00 -07:00
Ian Romanick
0bf63733e5 ir_to_mesa: Support texture rectangle targets 2010-08-16 09:39:58 -07:00
José Fonseca
b421cb9546 translate: Remove unused temporary register.
Assuming the side-effect of x86_make_reg is also unnecessary.
2010-08-16 17:21:14 +01:00
José Fonseca
ded92e5dd8 translate: Eliminate void pointer arithmetic.
Non-portable.
2010-08-16 17:21:14 +01:00
Chia-I Wu
f945cb6515 st/egl: Add support for EGL_KHR_fence_sync.
The extension is implemented by pipe_fence_handle.
2010-08-17 00:06:19 +08:00
Chia-I Wu
2b2c5c4f5c egl: Add support for EGL_KHR_fence_sync.
Individual drivers still need to support and enable the extension.
2010-08-17 00:06:19 +08:00
Chia-I Wu
4b2495661f st/egl: Add support for EGL_KHR_reusable_sync.
The extension is implemented by pipe_condvar.
2010-08-17 00:06:19 +08:00