Commit Graph

23269 Commits

Author SHA1 Message Date
Brian Paul 1045481dd9 mesa: fix loop over generic attribs in update_arrays() 2009-05-22 13:50:31 -06:00
Brian Paul 4b55e36952 vbo: asst. reformatting, clean-ups 2009-05-22 13:44:59 -06:00
Brian Paul 9be72f54ac Merge branch 'mesa_7_5_branch' 2009-05-22 13:21:23 -06:00
Brian Paul c3538969e1 vbo: fix crash in vbo_exec_bind_arrays()
When a vertex shader uses generic vertex attribute 0, but not gl_Vertex,
we need to set attribute[16] to point to attribute[0].  We were setting the
attribute size, but not the pointer.

Fixes crash in glsl/multitex.c when using the VertCoord attribute instead
of gl_Vertex.
2009-05-22 13:15:41 -06:00
Brian Paul 891a2bdd7d demos: extend glsl/multitex.c to use a vertex buffer object 2009-05-22 13:12:28 -06:00
Brian Paul 96370113f1 demos/util: add funcs for GL_ARB_buffer_object 2009-05-22 13:12:01 -06:00
Brian Paul 58fadc6242 demos: fix multitex.c VertCoord attribute mapping
If the multitex.vert shader uses the VertCoord generic vertex attribute
instead of the pre-defined gl_Vertex attribute, we need to make sure that
VertCoord gets bound to generic vertex attribute zero.

That's because we need to call glVertexAttrib2fv(0, xy) after all the other
vertex attributes have been set since setting generic attribute 0 triggers
vertex submission.  Before, we wound up issuing the vertex attributes in
the order 0, 1, 2 which caused the first vertex to be submitted before all
the attributes were set.  Now, the attributes are set in 1, 2, 0 order.
2009-05-22 13:00:49 -06:00
Brian Paul 1b3f5df1e0 Merge branch 'mesa_7_5_branch' 2009-05-22 09:40:50 -06:00
Brian Paul 995456f930 mesa: allow GL_BITMAP type in _mesa_image_image_stride()
It's possible to hand a GL_COLOR_INDEX/GL_BITMAP image to glTexImage3D()
which gets converted to RGBA via the glPixelMap tables.

This fixes a failure with piglit/fdo10370 with Gallium.
2009-05-22 09:35:02 -06:00
Brian Paul a545f1ab6d mesa: added some assertions 2009-05-22 07:51:35 -06:00
Brian Paul 42ae2a8648 mesa: use Elements() macro to limit loops instead of constants 2009-05-22 07:51:13 -06:00
Brian Paul 882cd6c839 mesa: remove MAX_VERTEX_PROGRAM_ATTRIBS
Use MAX_VERTEX_GENERIC_ATTRIBS instead.  No need for two #defines for
the same quantity.
2009-05-22 07:30:05 -06:00
Brian Paul 4a95185c9f mesa: rename MAX_VERTEX_ATTRIBS to MAX_VERTEX_GENERIC_ATTRIBS
Be clearer that this is the number of generic vertex program/shader
attributes, not counting the legacy attributes (pos, normal, color, etc).
2009-05-22 07:26:08 -06:00
Brian Paul 4dc426c016 mesa: s/MAX_VERTEX_PROGRAM_ATTRIBS/MAX_NV_VERTEX_PROGRAM_INPUTS/ in NV funcs 2009-05-22 07:19:27 -06:00
Brian Paul 42b747e57d mesa: added comment 2009-05-22 07:14:16 -06:00
Brian Paul 70c4b81e88 mesa: add missing glGet*() case for GL_VERTEX_ARRAY_BINDING_APPLE 2009-05-21 21:49:57 -06:00
Brian Paul 8b91778f46 vbo: fix build breakage...oops 2009-05-21 17:07:33 -06:00
Brian Paul 3bfe312d01 vbo: comments, whitespace clean-ups 2009-05-21 17:03:52 -06:00
Brian Paul d2a74d76c9 mesa: s/MAX_VERTEX_PROGRAM_ATTRIBS/MAX_NV_VERTEX_PROGRAM_INPUTS 2009-05-21 17:03:21 -06:00
Brian Paul 7e2fb12981 Merge branch 'mesa_7_5_branch' 2009-05-21 16:57:28 -06:00
Brian Paul 8da09e6924 vbo: fix incorrect loop limit in bind_array_obj()
The generic_array[] is 16 elements in size, but the loop was doing 32
iterations.  The out of bounds array write was clobbering the following
inputs[] array but as luck would have it, that didn't matter.
2009-05-21 16:54:35 -06:00
Brian Paul d4fb7615b5 mesa: use MAX_ values instead of literals 2009-05-21 16:52:45 -06:00
Brian Paul 54a5ffbfa1 mesa: freshen comments for update_array() 2009-05-21 16:10:45 -06:00
Brian Paul 667a4037fa mesa: minor code simplification in _mesa_GetVertexAttrib*NV() 2009-05-21 16:10:45 -06:00
Brian Paul 024de60348 mesa: comment for _mesa_GetVertexAttribfvARB() 2009-05-21 16:10:45 -06:00
Brian Paul 254845fad0 mesa: minor code simplification in _mesa_GetVertexAttribfvARB() 2009-05-21 16:10:45 -06:00
Brian Paul 6a2211f000 mesa: remove const qualifier 2009-05-21 16:10:45 -06:00
Brian Paul a554d7c4d8 mesa: VertexAttribPointer comments 2009-05-21 16:10:45 -06:00
Brian Paul 8fe3134622 mesa: call _mesa_update_array_object_max_element() before printing array info 2009-05-21 16:10:45 -06:00
Brian Paul 8fa0cb2b42 mesa: added gl_array_object::Weight array field
We don't really implement vertex weights but in the VBO code this
fixes and odd case for the legacy_array[] setup.  Before, the
vbo->draw_prims() call was always indicating that the vertex weight
array was present/enabled when it really wasn't.
2009-05-21 16:10:45 -06:00
Brian Paul 1889890c88 mesa: check FEATURE_point_size_array for PointSize array 2009-05-21 16:10:45 -06:00
Brian Paul aac19609bf mesa: fix some potential state-restore issues in pop_texture_group()
Call the _mesa_set_enable() functions instead of driver functions, etc.

Also, add missing code for 1D/2D texture arrays.
2009-05-21 16:10:45 -06:00
Brian Paul de1cfc5e8a mesa: new _mesa_update_array_object_max_element() function
This will replace the code in state.c
2009-05-21 16:10:45 -06:00
Brian Paul dda82137d2 vbo: return VP_NONE from get_program_mode() if running fixed-func vertex program
If we're running a vertex program to emulated fixed-function, we still need
to treat vertex arrays/attributes as if we're in fixed-function mode.

This should probably be back-ported to Mesa 7.5 after a bit more testing.
2009-05-21 16:10:45 -06:00
Brian Paul a1f6f82e82 vbo: move vp_mode enum to vbo_exec.h, use enum instead of GLuint 2009-05-21 16:10:45 -06:00
Eric Anholt bd0861e274 i965: fix whitespace in brw_tex_layout.c
The broken indentation was driving me crazy, so fix other stuff while
I'm here.
2009-05-21 10:41:49 -07:00
Eric Anholt 3a521d84ec i956: Make state dependency of SF on drawbuffer bounds match Mesa's.
Noticed while debugging a weird 1D FBO testcase that left its existing
viewport and projection matrix in place when switching drawbuffers.  Didn't
fix the testcase, though.
2009-05-21 10:41:39 -07:00
Eric Anholt e78a6aa2b9 intel: Fall back on any rendering to texture with no miptree.
Fixes segfault on an fbo.c negative test for FBO with texture width/height
of 0.  Previously we just tested for border != 0 to work around this
segfault.
2009-05-21 10:40:11 -07:00
Eric Anholt 8bba183b9e intel: Mark the FBO as incomplete if there's no intel_renderbuffer for it.
This happens to rendering with textures with a border, which had resulted
in a segfault on dereferencing the irb.
2009-05-21 10:40:11 -07:00
Eric Anholt 467f18f7a5 intel: Don't segfault on glGenerateMipmaps of a cube map with one face defined.
This presumably applies to SGIS_generate_mipmaps as well.
2009-05-21 10:40:11 -07:00
Eric Anholt 4da58bbab0 intel: Use _mesa_CheckFramebufferStatusEXT insteaad of glCheck...
Fixes a segfault in our oglconform fbo test.
2009-05-21 10:40:11 -07:00
Brian Paul 02f73c43b4 mesa: added debug functions for dumping color/depth/stencil buffers 2009-05-21 09:17:09 -06:00
Brian Paul 840c09fc71 i965: rename var: s/tmp/vs_inputs/ 2009-05-21 09:17:09 -06:00
Brian Paul f7ca97f85e mesa: remove pointless null ptr check, improved some error messages 2009-05-21 09:17:09 -06:00
Brian Paul 39d7524f7b mesa: added _mesa_print_arrays() for debugging 2009-05-21 09:17:09 -06:00
Brian Paul 15f21bf357 mesa: updated comment for _MaxElement field
It's the largest array index, plus one.
2009-05-21 09:17:09 -06:00
Brian Paul a185bcbdec mesa: move gl_array_attrib::_MaxElement to gl_array_object::_MaxElement
This value is per array object.
2009-05-21 09:17:08 -06:00
Brian Paul 899c524a49 vbo: s/8/MAX_TEXTURE_COORD_UNITS/ 2009-05-21 09:17:08 -06:00
Jonathan Adamczewski 2c007517b5 cell: perform triangle cull a little earlier
In spu_tri.c:setup_sort_vertices() triangles are culled after the
vertices are sorted.  This patch moves the check a little earlier
and performs the actual check a little faster through intrinsics and
a little trickery.

Reduced code size and less work is done before a triangle is deemed
OK to skip.
2009-05-21 08:19:00 -06:00
Jonathan Adamczewski b4824520ec cell: unroll inner loop of spu_render.c:cmd_render()
It was taking approximately 50 cycles to extract the vertex indices,
calculate the vertex_header pointers and call tri_draw() for each
three vertices - .

Unrolled, it takes less than 100 cycles to extract, unpack,
calculate pointers and call tri_draw() eight times.  It does have a
nasty jump-tabled switch.  I'm sure that there's a better way...

Code size of spu_render.o gets larger due to the extra constants and
work in the inner loop, there are extra stack saves and loads
because there are more registers in use, and an assert.  spu_tri.o
gets a little smaller.
2009-05-21 08:18:03 -06:00