Commit graph

9896 commits

Author SHA1 Message Date
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
Jerome Glisse
6c288d06ac r600g: fix typo in tex instruction + shader semantic id fix
It seems we never get semantic id from TGSI so fallback
to use output number as id.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-30 11:12:10 -04:00
Keith Whitwell
f623d06c49 util: more helpers for old draw code 2010-07-30 10:47:20 +01:00
Brian Paul
e75da1a8d6 llvmpipe: fix on-debug build breakage 2010-07-29 17:49:49 -06:00
Brian Paul
6c1625cc40 llvmpipe: added some jit debug code
If we crash in the jitted function we can examine jit_line and
jit_state in gdb to learn more about the shader.
2010-07-29 17:31:18 -06: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
d1f38baa01 llvmpipe: silence warnings in lp_test_sincos.c 2010-07-29 17:25:54 -06:00
Jerome Glisse
7a73390f91 r600g: mipmap early support + EX2/ABS instruction + culling
Add mipmap support (demos/src/redbook/mipmap is working)
Add EX2/ABS shader instruction support.
Add face culling support.

Misc fixes.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-29 19:05:57 -04:00
Marek Olšák
d8d7a3e0f9 r300g/swtcl: fix crash in ETQW and minor fixups
The Draw flush inside r300_flush was the culprit.

Also, no need to flush Draw when changing a state since the flush is
already inside swtcl_draw_vbo.
2010-07-29 20:57:18 +02:00
Marek Olšák
3f4680d8e2 r300g/swtcl: fix crash after the draw_vbo merge 2010-07-29 20:57:17 +02:00
Brian Paul
330852b3b3 llvmpipe: also test the new lp_build_assert() function 2010-07-29 12:51:45 -06:00
Brian Paul
d05cb9f018 llvmpipe: don't call LLVMCreateJITCompiler() twice
Fixes a failed assertion with LLVM 2.6:

<unnamed>::JITResolver::JITResolver(llvm::JIT&): Assertion
`TheJITResolver == 0&&  "Multiple JIT resolvers?"' failed.

Though, not everyone seems to experience this problem.
2010-07-29 12:51:45 -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
ab25c1597d st/python: Adapt to interface change.
This is only compile tested.
2010-07-29 19:40:21 +08:00
Chia-I Wu
d4d62b6178 graw/tests: Use pipe_context::draw_vbo.
The other drawing variants such as draw_arrays or
draw_elements_instanced were removed.

This fixes fdo bug #29287.
2010-07-29 16:21:10 +08:00
Chia-I Wu
92f9b05499 gallium: Avoid void pointer arithmetic.
This fixes fdo bug #29286.
2010-07-29 15:55:14 +08:00
Chia-I Wu
e7f69c459a gallium/docs: Document draw_vbo and set_index_buffer.
Document the new unified drawing method and remove references to old
ones.
2010-07-29 13:45:31 +08:00
Chia-I Wu
a57f842519 gallium: Keep only pipe_context::draw_vbo.
That is, remove pipe_context::draw_arrays, pipe_context::draw_elements,
pipe_context::draw_arrays_instanced,
pipe_context::draw_elements_instanced,
pipe_context::draw_range_elements.
2010-07-29 13:45:31 +08: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
Chia-I Wu
c5e9d3114a gallium: Add pipe_context::draw_vbo and pipe_context::set_index_buffer.
This commit adds a new unified draw_vbo method to pipe_context.  Unlike
other draw methods, draw_vbo treats the index buffer as a state which is
set with set_index_buffer.
2010-07-29 13:45:30 +08:00
Kristian Høgsberg
aa44bd9189 Untangle gallium/egl/glx source sharing mess and make it compile again 2010-07-28 22:18:58 -04:00
Jerome Glisse
42c1f27149 r600g: state context ptr in sampler_view & add I8/L8 buffer format
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 20:09:15 -04:00
Jerome Glisse
35e044ab56 r600g: switch btw flat/linear interpolation
I am not sure how to properly handle flat shading regarding
non color parameter to fragment shader. It seems we should
still interpolate non color using linear interpolation and
flat shade only apply to color.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 19:59:38 -04:00
Jerome Glisse
6f0f6c6459 r600g: split pipe state creating/binding from hw state creation
Split hw vs pipe states creation handling as hw states group doesn't
match pipe state group exactly. Right now be dumb about that and
rebuild all hw states on each draw call. More optimization on that
side coming.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 19:36:16 -04:00
Jerome Glisse
742ee7935d r600g: cleanup resource buffer/texture mess
Use a common function, fix the mess it was before.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 12:18:19 -04:00
Jerome Glisse
b346c4205d r600g: add lrp instruction support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 10:35:32 -04:00
Jerome Glisse
9961a0b92d r600g: actualy fix the literal emission
Previous patch added literal emission to wrong place, we
want to emit literal before emitting a new alu group.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 09:11:14 -04:00
Vinson Lee
8bae190f18 gallium/docs: Fix VMware spelling. 2010-07-28 01:09:40 -07:00
Vinson Lee
da30209afd draw: Fix VMware spelling. 2010-07-28 01:07:03 -07:00
Dave Airlie
2ab24a6fae r600g: fix up segfault with variation between views and count.
For some reason gallium hands us something with lots of empty views, and
we are expected to deal with it, just do what r300g does for this bit.
2010-07-28 15:28:18 +10:00
Corbin Simpson
0a663bb4db gallium/docs: Fix VMware spelling. 2010-07-27 21:43:00 -07:00
Dave Airlie
f514ad0a9b r600g: use gallium util for float->ui conversion 2010-07-28 11:55:09 +10:00
Vinson Lee
b172aebfdf scons: Fix sunos5 build. 2010-07-27 18:13:47 -07:00
Jerome Glisse
641c9adb09 r600g: texture support
Add texture mapping support, redbook/texbind works if
you comment out glClear and second checkboard. Need to
fix :
 - texture overwritting
 - lod & mip/map handling
 - unormalized coordinate handling
 - texture view with first leve > 0
 - and many other things

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-27 20:18:32 -04:00
Brian Paul
25472942c9 llvmpipe: pass face+slice to llvmpipe_unswizzle_cbuf_tile()
Cube map faces and 3D texture slices are treated the same in llvmpipe
textures.  Need to pass the sum of these fields to
llvmpipe_unswizzle_cbuf_tile() as we do elsewhere.

Fixes piglit fbo-3d test (fd.o bug 29135).
2010-07-27 17:42:27 -06:00
Vinson Lee
6a20539580 r600g: Move declaration before code.
Fixes SCons build.
2010-07-27 15:33:45 -07:00
Jakob Bornecrantz
cc09dc2773 swrastg: Add SWRAST_NO_PRESENT option to not send updates to X server
There seem to be a problem with this path and freeglut where
the window wont open if SWRAST_NO_PRESENT is set to true.
2010-07-27 13:54:37 -07:00
Jerome Glisse
2b3b76a4a0 r600g: always emit literal after emiting an alu instruction
Make sure we always fill in the literal after alu instruction.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-27 13:50:11 -04:00