summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: add STATIC_ASSERT() macro for compile-time assertionsBrian Paul2011-11-301-0/+12
| | | | | | | | | This can be used to check that tables have the right number of entries, etc. at compile-time. This will hopefully catch things that are missed if particular drivers aren't tested, for example. v2: Simplify the macro to omit the extra line number info (the compiler already indicates the line number). And wrap the macro for readability.
* mesa: access pixels as GLushort in unpack_SL8()Brian Paul2011-11-301-3/+3
| | | | | Per the format comments and the texstore code, use a GLushort to access the pixel. The code was OK as-is on little endian machines.
* mesa: Make _mesa_is_stencil_format() consistent with _mesa_is_depth_format().Eric Anholt2011-11-291-1/+0
| | | | | | | | | | | | | | | | | There was only one consumer of this API, meta.c, which was intending to ask "is this format just stencil index (and nothing else)?". Instead, if one tried to glDrawPixels of GL_DEPTH_STENCIL-type formats, it would just try to draw the stencil parts. Nothing good came of this. This function looks rather silly at this point, but I'm leaving it in place to be the obvious parallel API to _mesa_is_depth_format(). Note that if you want the old behavior, you should use it as (_mesa_is_stencil_format() || _mesa_is_depthstencil_format()) like is commonly done for depth-related tests. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix the datatype of GL_DEPTH32F_STENCIL8's depth channel.Eric Anholt2011-11-291-1/+4
| | | | | | | | | | | | | | | | | Asking for the datatype of MESA_FORMAT_Z32_FLOAT_X24S8 is a bit funny -- there's a float depth channel, and a stencil channel that doesn't have a particular GLenum associated with its type, so what's the correct response? Because there is no query for stencil, just make this format's datatype be that of the depth channel. It fixes the depth query (and thus a failure in piglit gl-3.0-required-sized-formats), and none of the other consumers of the _mesa_get_format_datatype() API care. v2: Add a comment for why the DataType is this way for this format. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Always handle GL_DEPTH_TEXTURE_MODE through the shader.Eric Anholt2011-11-292-32/+30
| | | | | | | | | | | | We were already doing it through the shader (layered underneath GL_EXT_texture_swizzle) in the shadow compare case. This avoids having per-format logic for switching out the surface format dependent on the depth mode. v2: Also do the swizzling for DEPTH_STENCIL. oops. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Fix EXT_texture_swizzle with a writemask in the FFFS/FP backend.Eric Anholt2011-11-291-6/+16
| | | | | | | | | | | | I tripped over this bug in the next commit, relying on our EXT_texture_swizzle to do some shadow sampler-related swizzling. If a writemask was masking out a channel of the destination that was a live channel of the texture swizzle, it would read undefined values. Fixes piglit ARB_fragment_program_shadow/masked. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Base HW depth format setup based on MESA_FORMAT, not bpp.Eric Anholt2011-11-295-54/+39
| | | | | | | | | | This will make handling new formats (like actually exposing Z32F) easier and more reliable. v2: Remove the check for hiz buffer -- the MESA_FORMAT should really be giving us the value we want even for hiz. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Don't depth test the fake depthbuffer when one isn't present.Eric Anholt2011-11-291-1/+6
| | | | | | | | | | | | For the non-separate-stencil-only case, we've been using a NULL surface for depth, so we didn't have to care. However, to support separate stencil with no depthbuffer, we have to make the depth surface non-NULL or the stencil test always fails thanks to separate stencil inheriting the surface type of depth. Fixes hiz-depth-stencil-test-d0-s8. Reviewed-by: Chad Versace <[email protected]>
* mesa: Allow generic attributes for glGetActiveAttrib and GL_ACTIVE_ATTRIBUTESIan Romanick2011-11-291-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Page 77 (page 91 of the PDF) says about glGetActiveAttrib: "The returned attribute name can be the name of a generic attribute or a conventional attribute (which begin with the prefix "gl_", see the OpenGL Shading Language specification for a complete list)." Page 261 (page 275 of the PDF) says about glGetProgramiv: "If pname is ACTIVE_ATTRIBUTES, the number of active attributes in program is returned." It doesn't say anything about built-in vs. user-defined attributes. From the language around glGetActiveAttrib and the lack of an exclusion of built-in attributes, which exists other places (e.g., around glBindAttribLocation), we can infer that GL_ACTIVE_ATTRIBUTES should include the active attribute count. It should also be included in the values returned by glGetActiveAttrib. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43138 Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Tested-by: Yi Sun <[email protected]>
* swrast: Fix some static analysis warningsChad Versace2011-11-291-0/+9
| | | | | | | | | | | To each switch statement in s_texfilter.c, add a break statement to the default case. Eliminates the Eclipse static analysis warning: No break at the end of this case. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: distinct gl_client_array arrays are goneChia-I Wu2011-11-293-6/+4
| | | | | | Fix build errors since 762c9766c93697af8d7fbaa729aed118789dbe8e. Acked-by: Jose Fonseca <[email protected]>
* mesa: Use VERT_ATTRIB_* indexed array in gl_array_object.Mathias Fröhlich2011-11-2914-385/+287
| | | | | | | | | | | | Replace the distinct struct gl_client_array members in gl_array_object by an array of gl_client_arrays indexed by VERT_ATTRIB_*. Renumber the vertex attributes slightly to keep the old semantics of the distinct array members. Make use of the upper 32 bits in VERT_BIT_*. Update all occurances of the distinct struct members with the array equivalents. Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Make gl_program::InputsRead 64 bits.Mathias Fröhlich2011-11-2924-59/+75
| | | | | | | | | Make gl_program::InputsRead a 64 bits bitfield. Adapt the intel and radeon driver to handle a 64 bits InputsRead value. Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Make gl_array_object::_Enabled 64 bits.Mathias Fröhlich2011-11-293-29/+29
| | | | | | Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: Use The VERT_{ATTRIB,BIT} defines.Mathias Fröhlich2011-11-297-70/+87
| | | | | | Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Replace _NEW_ARRAY_* bits with VERT_BIT_*Mathias Fröhlich2011-11-294-64/+31
| | | | | | | | Consolidate the two distinct set of flags to use VERT_BIT_*. Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Introduce more symbolic VERT_{ATTRIB,BIT}* defines.Mathias Fröhlich2011-11-291-18/+45
| | | | | | | | Introduce a set of defines for VERT_ATTRIB_* and VERT_BIT_* that will be used in the followup patches. Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: move ElementArrayBufferObj to gl_array_objectYuanhan Liu2011-11-2910-44/+44
| | | | | | | | | | | | | | | According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at page 515, the element buffer object is listed in vertex array object. So, move the ElementArrayBufferObj inside gl_array_object to make element buffer object per-vao. This would fix most of(3 left) intel oglc vao test fail NOTE: this is a candidate for the 7.11 branch. Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: update comments for _mesa_format_matches_format_and_type(), 80-column ↵Brian Paul2011-11-281-10/+9
| | | | wrapping
* mesa: add component comments for sRGB formatsBrian Paul2011-11-281-5/+5
|
* mesa: update texstore comments for R/G texturesBrian Paul2011-11-281-2/+2
|
* mesa: fix comments for RG formatsBrian Paul2011-11-281-4/+4
| | | | | | The position of the red and green bits was misstated in the comments. Arguably, the names of these formats should be changed to "GR" to reflect the component ordering and to be consistent with other formats.
* st/mesa: don't try to allocate zero-sized renderbuffersBrian Paul2011-11-281-0/+5
| | | | | | | | | | Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43047 and https://bugs.freedesktop.org/show_bug.cgi?id=43048 Note: This is a candidate for the 7.11 branch. Tested-by: Vinson Lee <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* swrast: add missing texfetch table entry for MESA_FORMAT_ARGB2101010_UINTBrian Paul2011-11-281-0/+7
| | | | | | | | | | As with the other integer-valued formats, use NULL until we support integer textures. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43316 Tested-by: Vinson Lee <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* mesa: remove unused gl_texture_object::DriverData fieldBrian Paul2011-11-281-9/+0
|
* mesa: handle MapTextureImage() failures in mipmap generation codeBrian Paul2011-11-281-24/+57
| | | | | | And handle potential malloc failures too. Reviewed-by: Eric Anholt <[email protected]>
* mesa: handle MapTextureImage() failures in glGetTexImage codeBrian Paul2011-11-281-114/+153
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: handle MapTextureImage() failures in glTexImage codeBrian Paul2011-11-281-76/+123
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix frag shader generation for alpha test with no color buffersBrian Paul2011-11-282-1/+7
| | | | | | | | | | | | If alpha test is enabled and there's no color buffers we still need the fragment shader to emit a color. v2: add _NEW_COLOR flag in _mesa_update_state_locked() Fixes piglit fbo-alphatest-nocolor-ff failures with Gallium drivers. Reviewed-by: Eric Anholt <[email protected]> Tested-by: Eric Anholt <[email protected]> (i965)
* mesa: check for null ptr in _mesa_is_bufferobj()Brian Paul2011-11-283-9/+9
| | | | | | | This simplifies a few callers. And it adds a bit of robustness. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Yuanhan Liu <[email protected]>
* mesa: move _mesa_base_format_has_channel() into image.cBrian Paul2011-11-285-87/+92
| | | | | | This is where other format-related functions live. Reviewed-by: Eric Anholt <[email protected]>
* mesa: combine GL_TEXTURE_INTENSITY/LUMINANCE_SIZE queriesBrian Paul2011-11-281-17/+8
| | | | | | | Use the _mesa_base_format_has_channel() helper as we do for the other texture format component queries. Reviewed-by: Eric Anholt <[email protected]>
* mesa: use _mesa_base_format_has_channel() in fbobject.c queriesBrian Paul2011-11-283-45/+28
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix indexing error in unpack_Z32_FLOAT_X24S8()Brian Paul2011-11-281-1/+1
| | | | | | | The source array elements are 8-bytes (float + uint) so we need to multiply the src index by 2 to get the right array stride. Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: add ARB_texture_rgb10_a2ui supportDave Airlie2011-11-282-2/+15
| | | | | | Add support to the state tracker format and extension enablement code. Signed-off-by: Dave Airlie <[email protected]>
* mesa/format: add mesa MESA_FORMAT_ARGB2101010_UINT support.Dave Airlie2011-11-288-0/+110
| | | | | | | | | | | | | | This format is used in the ARB_texture_rgb10_a2ui spec. It adds core mesa support, texformat + texstore support, format_unpack and fbobject.c (all patches from list merged + fixed up). also fixes some whitespace issues. Parts were: Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* image/pack: fix missing GL_BGR(A)_INTEGER support.Dave Airlie2011-11-282-0/+4
| | | | | | | These codepaths were missing the cases for BGR_INTEGER/BGRA_INTEGER. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* image: fix legal types for packed integer formats.Dave Airlie2011-11-271-2/+4
| | | | | | | | | After reading ARB_texture_rgb10_a2ui it appears the packed formats for integer types are only specified via this extension, and not via the original ones. So condition the checks on this. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* pack: fix indentation (trivial)Dave Airlie2011-11-271-1/+1
| | | | | | just saw this while looking for other problems. Signed-off-by: Dave Airlie <[email protected]>
* glapi: add ARB_texture_rgb10_a2ui support.Dave Airlie2011-11-271-1165/+1168
| | | | | | | | This just adds one enum. regenerate enums.c. Signed-off-by: Dave Airlie <[email protected]>
* mesa: add MESA_FORMAT_RGBX8888 and MESA_FORMAT_RGBX8888_REVChia-I Wu2011-11-277-6/+139
| | | | | | | | | | | | | MESA_FORMAT_RGBX8888_REV is one of the opaque pixel formats used on Android. Thanks to texture-from-pixmap, drivers may actually see texture images with this format on Android. MESA_FORMAT_RGBX8888 is added only for completeness. Reviewed-by: Brian Paul <[email protected]> [olv: Move the new formats after MESA_FORMAT_ARGB8888_REV in gl_format. I accidentally moved them to the wrong place when preparing the patch.]
* android: pass -std=c99 by defaultChia-I Wu2011-11-263-8/+2
| | | | | Several modules expect a C99 compiler already. It is also the default for Makefile build.
* vbo: fix !FEATURE_beginend buildChia-I Wu2011-11-251-0/+6
| | | | Fix a build error in GLES-only build.
* i965/gen6: Fix GPU hang when using stencil buffer without depthChad Versace2011-11-231-0/+5
| | | | | | | | | | | | | | Enable the bit 3DSTATE_DEPTH_BUFFER.Tiled_Surface. From the Sandybridge PRM, Volume 2, Part 1, Section 7.5.5.1.1 3DSTATE_DEPTH_BUFFER, Bit 1.27 Tiled Surface: [DevGT+]: This field must be set to TRUE. Fixes GPU hangs on the following Piglit tests: hiz-stencil-test-fbo-d0-s8 hiz-stencil-read-fbo-d0-s8 Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* i915: Fix complete texturing regression since 27505a105aEric Anholt2011-11-231-0/+2
| | | | | | I had notes to myself to test gen3 and gen4, and then I tested gen4 and called it good. Turns out I forgot to actually call the new function on gen3.
* i915: Fix build since hiz merge.Eric Anholt2011-11-236-24/+29
| | | | | | | | v2: Guard against rb->mt being NULL, since we may enter the draw regions path before intel_prepare_render() has been called to set them. Reviewed-by: Chad Versace <[email protected]> (v1)
* mesa: fix incorrect error message in format_unpack.cBrian Paul2011-11-231-1/+2
|
* mesa: update comment for clear_teximage_fields()Brian Paul2011-11-221-9/+2
|
* mesa: re-implement unpacking of DEPTH_COMPONENT32FMarek Olšák2011-11-231-0/+9
| | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43122 Reviewed-by: Eric Anholt <[email protected]> Tested-by: Kai Wasserbäch <[email protected]>
* i915: Move the texture format setup for this driver out of shared code.Eric Anholt2011-11-224-42/+54
| | | | | | | The i965 driver is now enabling all of these formats on its own from the surface format table. Reviewed-by: Kenneth Graunke <[email protected]>