Commit graph

18858 commits

Author SHA1 Message Date
Brian Paul
a52a6d7bcd gallium: added SSE for DP2, DP2A 2008-11-07 13:03:07 -07:00
Brian Paul
cf9836cf09 gallium: implement TGSI_OPCODE_DP2A, add sqrt to NRM3/NRM4 2008-11-07 13:02:43 -07:00
Brian Paul
49680dae5d Merge commit 'origin/master' into gallium-0.2 2008-11-07 13:02:07 -07:00
Brian Paul
22459e7a9c mesa: forgot sqrt in NRM3/4 instructions 2008-11-07 12:59:36 -07:00
Brian Paul
6dc91b8371 mesa: fix opcode table order bug 2008-11-07 12:59:08 -07:00
Robert Ellison
b493fdd7e3 CELL: fix several stencil problems
This small set of changes repairs several different stenciling problems;
now redbook/stencil also runs correctly (and maybe others - I haven't
checked everything yet).

- The number of instructions that had been allocated for fragment ops
  used to be 64 (in cell/common.h).  With complicated stencil use, we
  managed to get up to 93, which caused a segfault before we noticed
  we'd overran our memory buffer.  It's now been bumped to 128,
  which should be enough for even complicated stencil and fragment op
  usage.

- The status of cell surfaces never changed beyond the initial
  PIPE_SURFACE_STATUS_UNDEFINED.  When a user called glClear()
  to clear just the Z buffer (but not the stencil buffer), this caused
  the check_clear_depth_with_quad() function to return false (because
  the surface status was believed to be undefined), and so the device
  was instructed to clear the whole buffer (including the stencil buffer),
  instead of correctly using a quad to clear just the depth, leaving the
  stencil alone.

  This has been fixed similarly to the way the i915 driver handles
  the surface status: during cell_clear_surface(), the status is
  set to PIPE_SURFACE_STATUS_DEFINED.  Then a partial buffer clear is
  handled with a quad, as expected.  Note that we are *not* using
  PIPE_SURFACE_STATUS_CLEAR (also similar to the i915); technically,
  we should be setting the surface status to CLEAR on a clear, and
  to DEFINED when we actually draw something (say on cell_vbuf_draw()),
  but it's difficult to figure out exactly which surfaces are affected
  by a cell_vbuf_draw(), so for now we're doing the easy thing.

- The fragment ops handling was very clever about only pulling out the
  parts of the Z/stencil buffer that it needed for calculations;
  but this failed when only part of the buffer was written, because
  the part that was never pulled out was inadvertently cleared.

  Now all the data from the combined Z/stencil buffer is pulled out,
  just so the proper values can be recombined later and written back
  to the buffer correctly.  As a bonus, the fragment op code generation
  is simplified.
2008-11-07 11:29:35 -07:00
Brian Paul
18a4cdcfc0 Merge commit 'origin/gallium-0.1' into gallium-0.2 2008-11-07 10:24:22 -07:00
Brian Paul
8343d0f6e4 gallium: translate DP2, DP2A, NRM3, NRM4, SSG opcodes 2008-11-07 10:20:05 -07:00
Brian Paul
3059ceb7f8 Merge commit 'origin/master' into gallium-0.2 2008-11-07 10:17:31 -07:00
Brian Paul
a98a25c25f mesa: add GLSL support for DP2, NRM3, NRM4 instructions (not actually emitted yet though) 2008-11-07 09:51:25 -07:00
Brian Paul
65cb74ecc0 mesa: added DP2, DP2A instructions 2008-11-07 09:51:25 -07:00
Brian Paul
37eef7b474 mesa: added AND/OR/NOT/XOR instructions 2008-11-07 09:51:25 -07:00
Brian Paul
d93072782a mesa: include shader/prog_instruction.h
Seems to fix a mysteriously missing build dependency.
2008-11-07 09:51:25 -07:00
Brian Paul
f6ead50827 mesa: added OPCODE_NRM3/NRM4 instructions for vector normalization.
We may emit these instructions from GLSL instead of DP3/RCP/MUL.

Also, implement SSG (set sign) instruction in the interpreter.
2008-11-07 09:51:25 -07:00
Xiang, Haihao
4550b0562d mesa: use _bfc0 instead of _col0 when building back face lighting. 2008-11-07 14:58:04 +08:00
Brian
bb8a9ce705 gallium: implement TGSI_OPCODE_NRM/NRM4 in tgsi_exec.c 2008-11-06 19:25:21 -07:00
Brian Paul
3225bc8493 gallium: s/OPCODE_INT/OPCODE_TRUNC/ 2008-11-06 17:19:54 -07:00
Brian Paul
c417a2c3f3 Merge commit 'origin/master' into gallium-0.2 2008-11-06 17:17:13 -07:00
Brian Paul
035c0cf71a mesa: rename OPCODE_INT -> OPCODE_TRUNC
Trunc is a more accurate description; there's no type conversion involved.
2008-11-06 17:14:33 -07:00
Brian Paul
517401af07 mesa: update the shader programs->TexturesUsed array at link time
If an application never calls glUniform() to set sampler variable values
they'll remain 0 (the default value/unit).
Now call _mesa_update_shader_textures_used() at link time in case glUniform()
is never called.  program->TextureUsed[] will then be correct for state
validation.
2008-11-06 15:24:18 -07:00
Brian Paul
a7d9fde24c Merge commit 'origin/gallium-0.1' into gallium-0.2 2008-11-06 15:07:11 -07:00
Brian Paul
2f1a29654a mesa: update the shader programs->TexturesUsed array at link time
If an application never calls glUniform() to set sampler variable values
they'll remain 0 (the default value/unit).
Now call _mesa_update_shader_textures_used() at link time in case glUniform()
is never called.  program->TextureUsed[] will then be correct for state
validation.
2008-11-06 15:04:11 -07:00
Brian Paul
678f80b347 gallium: added st_print_shaders() function to help w/ debugging 2008-11-06 15:00:01 -07:00
Brian Paul
6c3e7365d5 gallium: debug code to print vertex array data (disabled) 2008-11-06 14:57:20 -07:00
Brian Paul
93fd5e150b softpipe: debug code (disabled) 2008-11-06 14:56:59 -07:00
Zack Rusin
d177c9ddda gallium: actually flip the coordinates 2008-11-06 16:07:28 -05:00
Xiang, Haihao
df94fd1764 i965: Always check vertex program.
Now i965 also uses the vertex program created by Mesa Core, but this vertex program
is not only depend on mesa state _NEW_PROGRAM, so always check the current vertex
program is updated or not. This fixes broken demo cubemap.
2008-11-06 15:25:55 +08:00
Brian
5b2b064a5c gallium: check execution mask in indirect register loads
Zero-out the index for disabled execution channels to avoid using potential
garbage values (thus avoiding bad array indexing).
2008-11-05 20:04:49 -07:00
Brian
639a2b0ec8 gallium: don't range check tgsi register index for indirect accesses
Fixes progs/vp/arl.txt test.
2008-11-05 19:27:27 -07:00
Gary Wong
0060d41549 i965: Implement missing OPCODE_NOISE3 instruction in fragment shaders.
OPCODE_NOISE4 coming later.
2008-11-05 20:38:05 -05:00
Brian Paul
88360913a7 cell: minor reformatting, var renaming 2008-11-05 17:20:35 -07:00
Brian Paul
2c204bbf77 use APP_CC, not CC for skinning demo 2008-11-05 17:14:23 -07:00
Brian Paul
cbce12b540 gallium: s/mmDestroy/u_mmDestroy/ 2008-11-05 17:14:00 -07:00
Brian Paul
1bfdab781b mesa: Fix compiler warnings on Windows.
cherry-picked subset of a77976d2ee
2008-11-05 16:04:40 -07:00
Brian Paul
50beb4e6fd mesa: fix a GLSL array indexing codegen bug
Expressions like array[i] + array[j] didn't work properly before.
2008-11-05 16:02:16 -07:00
Brian Paul
80a718a63b Merge commit 'origin/gallium-0.1' into gallium-0.2
Conflicts:

	src/gallium/auxiliary/rtasm/rtasm_execmem.c
	src/mesa/shader/slang/slang_emit.c
	src/mesa/shader/slang/slang_log.c
	src/mesa/state_tracker/st_atom_framebuffer.c
2008-11-05 15:58:09 -07:00
Brian Paul
de14fdd63f gallium: added check for degenerate drawing calls 2008-11-05 14:05:42 -07:00
Brian Paul
6282c38283 gallium: if VERBOSE_GLSL flag is set, check for non-initialized uniforms at draw time
This will warn the user that the shader being run may be using uninitialized
uniform variables.
2008-11-05 14:05:04 -07:00
Brian Paul
0331c1c169 mesa: fix a GLSL array indexing codegen bug
Expressions like array[i] + array[j] didn't work properly before.
2008-11-05 14:03:15 -07:00
Brian Paul
f0debbb0bb gallium: call tgsi_set_exec_mask() and use exec mask in SSE ARL code
This prevents vertex shaders from referencing invalid memory locations when
the shader is operating on less than four vertices or fragments.
2008-11-05 14:02:07 -07:00
Brian Paul
03c0ce4c61 gallium: added tgsi_set_exec_mask() 2008-11-05 13:56:20 -07:00
Brian Paul
a137f03c56 gallium: added some sanity check assertions for constant buffer indexing 2008-11-05 13:55:56 -07:00
Brian Paul
dea4826b84 mesa: remove extra \n from printf string 2008-11-05 09:34:15 -07:00
Brian Paul
528c860a58 mesa: remove extra \n from printf string 2008-11-05 09:33:48 -07:00
Brian Paul
949e7383b5 mesa: add Initialized field to gl_uniform struct, for debugging purposes only 2008-11-05 09:17:55 -07:00
Brian Paul
2ff4636603 mesa: add Initialized field to gl_uniform struct, for debugging purposes only 2008-11-05 09:14:19 -07:00
Brian Paul
05a17f83b0 gallium: added some debug code (disabled) 2008-11-05 09:08:56 -07:00
Brian Paul
fc3b361191 gallium: disable some debug output 2008-11-05 09:08:56 -07:00
Jakob Bornecrantz
64a9908816 i915: Remove faulty assert 2008-11-05 16:49:48 +01:00
michal
7115b79b77 draw: Implement TGSI_OPCODE_TRUNC. 2008-11-05 11:59:45 +00:00