Chia-I Wu
0e7d7d3051
util: Fix the range of util_draw_elements_instanced.
...
Keep min_index and max_index at their defaults (0 and ~0).
2010-07-30 23:45:56 +08:00
Zack Rusin
042018a943
llvmpipe: delete function bodies after generating machine code
2010-07-30 16:25:29 +01:00
Keith Whitwell
f623d06c49
util: more helpers for old draw code
2010-07-30 10:47:20 +01:00
Brian Paul
b4c8de1ff2
draw: do bounds checking of array elements (debug only)
...
Make sure that all the element indexes actually lie inside the vertex
buffer.
Also, rename pipe_run() to pipe_run_elts() to be more specific.
And assert/check the vertex count for the non-indexed case.
2010-07-29 17:25:54 -06:00
Brian Paul
d88b6e19c1
draw: assorted clean-ups in clipper code
2010-07-29 17:25:54 -06:00
Brian Paul
ba2cc3b8e6
gallium: implement bounds checking for constant buffers
...
Plumb the constant buffer sizes down into the tgsi interpreter where
we can do bounds checking. Optional debug code warns upon out-of-bounds
reading. Plus add a few other assertions in the TGSI interpreter.
2010-07-29 17:25:54 -06:00
Brian Paul
8a2933f366
draw: add vertex buffer offset in draw_print_arrays()
2010-07-29 17:25:54 -06:00
Brian Paul
8f3fe7e2f0
gallivm: added lp_build_assert() function to make assertions in LLVM code
2010-07-29 12:51:45 -06:00
José Fonseca
02da55676b
Revert "gallivm: fix lp_build_sample_offset() crash when indexing a 1-D texture"
...
This reverts commit 5f90e76c54 .
Bad cherry-pick.
2010-07-29 19:38:02 +01:00
Brian Paul
5f90e76c54
gallivm: fix lp_build_sample_offset() crash when indexing a 1-D texture
...
If y==NULL and y_stride==NULL it means the texture is 1D. Return
zero for out_i and the offset instead of garbage.
2010-07-29 19:19:05 +01:00
Keith Whitwell
a258701cd9
util: add uint version of pack_z_stencil
...
Useful for packing mask values.
2010-07-29 19:15:10 +01:00
José Fonseca
bdaa8be5b7
scons: Use the current python executable for code generation.
...
Less susceptible to be broken.
2010-07-29 19:11:50 +01:00
José Fonseca
111902f2c4
draw: Also emit EMMS on generated LLVM IR.
2010-07-29 19:11:06 +01:00
José Fonseca
e3d2ebac11
llvmpipe: Avoid corrupting the FPU stack with MMX instructions on 32bit OSes.
...
Unfortunately LLVM doesn't emit EMMS itself, and there is no
easy/effective way to disable MMX.
http://llvm.org/bugs/show_bug.cgi?id=3287
2010-07-29 19:10:59 +01:00
José Fonseca
38f5b1bc38
util: Don't include xmmintrin.h.
...
Unnecessary.
2010-07-29 19:10:56 +01:00
Chia-I Wu
cd3ef7592c
gallium: Use unified pipe_context::draw_vbo.
...
Update u_draw_quad, st/vega, and st/mesa to use pipe_context::draw_vbo.
2010-07-29 13:45:31 +08:00
Chia-I Wu
6d28bf917f
gallium: Implement draw_vbo and set_index_buffer for all drivers.
...
Some drivers define a generic function that is called by all drawing
functions. To implement draw_vbo for such drivers, either draw_vbo
calls the generic function or the prototype of the generic function is
changed to match draw_vbo.
Other drivers have no such generic function. draw_vbo is implemented by
calling either draw_arrays and draw_elements.
For most drivers, set_index_buffer does not mark the state dirty for
tracking. Instead, the index buffer state is emitted whenever draw_vbo
is called, just like the case with draw_elements. It surely can be
improved.
2010-07-29 13:45:30 +08:00
Vinson Lee
da30209afd
draw: Fix VMware spelling.
2010-07-28 01:07:03 -07:00
José Fonseca
2a45972fb2
gallivm: Add lp_build_select_bitwise() alternative to lp_build_select_bitwise
...
When
(mask & a) | (~mask & b)
is meant instead of
mask ? a : b
2010-07-27 13:09:46 +01:00
Brian Paul
b17ee335e3
util: fix unused function warning on non-x86
2010-07-26 20:48:29 -06: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
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
Vinson Lee
80b331c7f6
util: Add PIPE_OS_CYGWIN to u_network.
2010-07-23 18:50:04 -07:00
Brian Paul
41e7347a17
draw: add small ybias factor for drawing wide points
...
Fixes minor rasterization error detected by some tests.
2010-07-23 10:32:58 -06:00
Jakob Bornecrantz
e36a082214
tgsi: Fix error message on invalid swizzle parse
2010-07-22 20:26:35 -07:00
Brian Paul
815e79e72c
draw: re-order optimization passes depending on LLVM version, 32/64-bit
...
This is a work-around for an apparent bug in LLVM seen with piglit's
glsl-vs-sqrt-zero test.
2010-07-22 16:09:03 -06:00
Brian Paul
ca3238f3fc
draw: added new assertions to clipping code
2010-07-22 11:18:54 -06:00
Marek Olšák
9ca48de106
draw: disable depth clipping if depth clamp is enabled
2010-07-21 22:54:34 +02:00
Marek Olšák
4460e9f0a1
cso: handle depth clamp
2010-07-21 22:54:34 +02:00
Brian Paul
aa9003e20e
draw: tweak aa line width threshold and sampling
...
Set sampler max_lod to avoid sampling the 1x1 and 2x2 mipmap levels.
Fixes piglit line-aa-width test, fd.o bug 29160.
2010-07-21 11:38:43 -06:00
Brian Paul
3662afd87d
gallivm: replace has_indirect_addressing field with indirect_files field
...
Instead of one big boolean indicating indirect addressing, use a
bitfield indicating which register files are accessed with indirect
addressing.
Most shaders that use indirect addressing only use it to access the
constant buffer. So no need to use an array for temporary registers
in this case.
2010-07-21 10:16:32 -06:00
Brian Paul
85206e56a1
tgsi: added tgsi_shader_info::indirect_files field
...
Indicates which register files are accessed with indirect addressing.
2010-07-21 10:16:32 -06:00
Brian Paul
0115f07507
gallivm: refactor code into get_indirect_offsets() function
2010-07-21 10:16:32 -06:00
Brian Paul
890976e02d
gallivm: added comment
2010-07-21 10:16:32 -06:00
Brian Paul
be22e1e781
gallivm: remove extraneous braces
2010-07-21 10:16:32 -06:00
Brian Paul
f674ed6b06
gallivm: no longer do indirect addressing in get_temp_ptr()
2010-07-21 10:16:32 -06:00
Brian Paul
105ed7dfd4
gallivm: implement correct indirect addressing of temp registers
...
As with indexing the const buffer, the ADDR reg may have totally
different values for each element. Need to use a gather operation.
2010-07-21 10:16:32 -06:00
Brian Paul
695814a15b
gallivm: re-org, comments for get_temp_ptr()
2010-07-21 10:16:31 -06:00
Brian Paul
6921a6dd4e
draw: whitespace clean-up
2010-07-21 10:16:31 -06:00
Brian Paul
ec0e7b16bb
gallivm: rename a var to avoid compiler warnings
2010-07-21 08:08:12 -06:00
Brian Paul
4363d4d0b9
gallivm: fix indirect addressing of constant buffer
...
The previous code assumed that all elements of the address register
were the same. But it can vary from pixel to pixel or vertex to
vertex so we must use a gather operation when dynamically indexing
the constant buffer.
Still need to fix this for the temporary register file...
2010-07-20 18:50:35 -06:00
Brian Paul
b0636f78aa
gallivm: added lp_build_const_int32() helper
2010-07-20 18:50:35 -06:00
Brian Paul
691c1fb074
draw: correctly handle max_index=0xffffffff case in vcache code
...
If max_index=0xffffffff and elt_bias > 0 the test for
elt_bias + max_index >= DRAW_PIPE_MAX_VERTICES
was wrong. Check earlier if max_index=0xffffffff and do the
"fail" case.
This fixes the piglit draw-elements-base-vertex test (and probably
some other things).
2010-07-20 11:53:43 -06:00
Marek Olšák
bdde9d2fce
util: mempool: initialize last block's magic number in a page
2010-07-20 10:23:54 +02:00
Brian Paul
37692e5dc9
draw: fix incorrect instancing divisor in LLVM code
2010-07-19 18:29:12 -06:00
Marek Olšák
fd03dd203f
util: remove the dummy field in mempool
...
It should allocate less memory now.
2010-07-19 21:05:47 +02:00
Brian Paul
369e9272de
util: add dummy field to empty structure types
...
Empty structure types aren't allowed with MSVC.
I haven't tested this change. Hope I haven't broken it...
2010-07-19 10:50:11 -06:00
Marek Olšák
ad44b775e3
util: add a memory pool for equally sized memory allocations
...
malloc/free are in O(1).
2010-07-19 17:12:11 +02:00
Vinson Lee
5cf0789f91
scons: Fix Cygwin build.
...
The Cygwin SCons build needed several file names to be fully qualified.
2010-07-16 12:34:22 -07:00