Commit Graph

13393 Commits

Author SHA1 Message Date
Kristian Høgsberg 57d78067bd Don't mess with emacs tab width. 2008-11-11 13:41:43 -05:00
Xiang, Haihao 09623fe551 intel: reset cliprect_mode to IGNORE_CLIPRECTS.
This ensures all batchbuffers have a same cliprect mode after calling
_intel_batchbuffer_flush even if there aren't invalid commands in the
current batch buffer. (fix bug#18362).
2008-11-11 13:58:15 +08:00
Xiang, Haihao 8412b06b67 mesa: restore the negate flag of dots in build_lighting.
Dots is re-used if more than one light is enabled. Previously
the negate flag of dots may affect next light.
2008-11-11 13:36:32 +08:00
Xiang, Haihao 064b04d464 mesa: update new state for RasterPos like other operations.
This fixes a lighting issue when drawing a bitmap.
2008-11-11 13:35:51 +08:00
Brian be1b8e5d6c mesa: new _mesa_is_pow_two() function 2008-11-10 20:16:00 -07:00
Brian Paul 8df4f6667f mesa: restore glapi/ prefix on #include 2008-11-10 16:38:47 -07:00
Brian Paul 59cc973940 mesa: fix some misc breakage caused by editing auto-generated files rather than the python generators
Specifically:
  #include "glapitable.h" in src/mesa/main/glapi/dispatch.h
  Call _mesa_bsearch() in src/mesa/main/enums.c.
2008-11-10 14:42:02 -07:00
Brian Paul 13f96c5401 GLX: fix out-of-bounds memory issue in indirect glAreTexturesResident()
See bug 18445.
When getting array results, __glXReadReply() always reads a multiple of
four bytes.  This can cause writing to invalid memory when 'n' is not a
multiple of four.

Special-case the glAreTexturesResident() functions now.
To fix the bug, we use a temporary buffer that's a multiple of four bytes
in length.

NOTE: this commit also reverts part of commit 919ec22ecf
(glx/x11: Added some #ifdef GLX_DIRECT_RENDERING protection) which
directly edited the indirect.c file rather than the python generator!
I'm not repairing that issue at this time.
2008-11-10 14:27:42 -07:00
Brian Paul 6186e7a206 dri: alloc __DRIscreen object with calloc() 2008-11-10 12:39:36 -07:00
Brian Paul 2d76a0d77a mesa: track initialization status of uniform variables. Plus, asst clean-ups. 2008-11-10 12:39:36 -07:00
Brian Paul 379ff8c956 mesa: initial support for uniform variable initializers.
This lets one specify initial values for uniforms in the code, avoiding
the need to call glUniform() in some cases.
2008-11-10 12:39:36 -07:00
Brian Paul 242c0cb543 mesa: fix logic error in GLSL linker when looking for main() shaders 2008-11-10 12:39:36 -07:00
Brian Paul 80c8017a64 mesa: allows 'f' suffix on GLSL float literals 2008-11-10 12:39:36 -07:00
Brian Paul e5359401d6 undo accidental changes to multitex.frag shader 2008-11-10 12:39:36 -07:00
Brian f1c9016af1 mesa: remove OPCODE_INT #define 2008-11-08 10:33:30 -07:00
Brian e24afc808f mesa: use NRM3 in emit_normalize_vec3() when drivers are ready 2008-11-08 10:29:03 -07:00
Brian Paul 87d1a26ba3 mesa: add support for 'centroid' qualifier in GLSL 1.20 2008-11-07 16:08:21 -07:00
Brian Paul 448156f769 mesa: add support for 'invariant' keyword for GLSL 1.20 2008-11-07 15:51:10 -07:00
Brian Paul b632e5aa7f mesa: reformat comments, rewrap lines, etc for a little better readability 2008-11-07 14:28:00 -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
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 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
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
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 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 dea4826b84 mesa: remove extra \n from printf string 2008-11-05 09:34:15 -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 aab429c8df added glsl/skinning.c test to test matrix blending/weighting 2008-11-04 16:56:59 -07:00
Brian Paul 6c8274078d mesa: fix float-valued GLSL vertex attribute variables
The swizzle mask for such variables wasn't set up properly.
2008-11-04 16:55:18 -07:00
Brian Paul 35a9f1bccf print err msg if unable to open shader file 2008-11-04 16:55:18 -07:00
Brian Paul d3222cb1d4 remove old debug glFlush/Finish calls from demos 2008-11-04 16:55:18 -07:00
Eric Anholt 4be624d693 i965: Clean up stale NDC comment. 2008-11-02 12:30:01 -08:00
Eric Anholt 9fd4c27ae3 i965: Avoid vs header computation for negative rhw on G4X.
This cuts one MOV out when setting a zero header.
2008-11-02 12:30:01 -08:00
Eric Anholt 34b1776e8d i965: Merge GM45 into the G4X chipset define.
The mobile and desktop chipsets are the same, and having them separate is
more typing and more chances to screw up.
2008-11-02 12:30:00 -08:00
Eric Anholt d758c48761 i965: Fix copy'n'paste issue that made brw->urb.constrained useless.
Also, add a comment explaining what brw->urb.constrained tries to do.
2008-11-02 12:30:00 -08:00
Brian Paul bbffed0857 mesa: silence warnings 2008-11-01 16:05:40 -06:00
Brian Paul b625a0a475 mesa: do scope replacement for while/for loops too
This fixes a function inlining bug involving vars declared inside loop bodies.
2008-11-01 16:05:40 -06:00
Brian Paul 3d0d803313 mesa: glsl tree print improvements 2008-11-01 16:05:40 -06:00
Brian Paul 1e1ba54a94 mesa: fix assignment / parameter passing of sampler types 2008-11-01 16:05:40 -06:00
Brian Paul 131d42573c mesa: additional debug flags for glsl debug/disassembly 2008-11-01 16:05:40 -06:00
Keith Packard 72c914805b Fix for 58dc8b7: dest regions must not use HorzStride 0 in ExecSize 1
Quoting section 11.3.10, paragraph 10.2 of the 965PRM:

10.2. 	If ExecSize is 1, dst.HorzStride must not be 0. Note that this is
	relaxed from rule 10.1.2. Also note that this rule for destination
	horizontal stride is different from that for source as stated in
	rule #7.

GM45 gets very angry when rule 10.2 is violated.

Patch 58dc8b7 (i965: support destination horiz strides in align1 access mode)
added support for additional horizontal strides in the ExecSize 1 case, but
failed to notice that mesa occasionally re-purposes a register as a
temporary destination, even though it was constructed as a repeating source
with HorzStride = 0.

While, ideally, we should probably fix the code using these register
specifications, this patch simply rewrites them to use HorzStride 1 as the
pre-58dc8b7 code did.

Signed-off-by: Keith Packard <keithp@keithp.com>
2008-11-01 14:38:19 -07:00
Brian Paul 06fe728e5b mesa: fix some bugs with precision qualifier parsing 2008-10-31 17:42:26 -06:00