summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Allow glTexImage2D with a depth component cube map.Anuj Phogat2011-12-051-2/+5
| | | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Reject glDrawPixels(integer format).Eric Anholt2011-12-041-0/+18
| | | | | | | When folding GL_EXT_texture_integer into the core, a new (and very sensible) restriction was added. Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix assertions for block size handling in glCompressedTexSubImage2D.Eric Anholt2011-12-021-2/+2
| | | | | | | | | | | Anything of less than (bw, bh) size is possible when you consider rectangular textures, and this code is (now) safe for those. Even for power-of-two textures, width could be 4 for FXT1 while not being aligned to block size. Fixes piglit compressedteximage GL_COMPRESSED_RGB_FXT1_3DFX Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix glCompressedTexSubImage (and non-Sub) for height == 2 or 1.Eric Anholt2011-12-021-1/+1
| | | | | | | | | | Generally this code works with width and height aligned to compressed blocks, but at the 2x2 and 1x1 levels of a square texture (or height < bh in general), we were skipping uploading our single row of blocks. Fixes piglit compressedteximage GL_COMPRESSED_RGBA_S3TC_DXT5_EXT. Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix glCompressedTexImage when dstRowStride != srcRowStride.Eric Anholt2011-12-021-28/+9
| | | | | | | | | | | | | | | | | | | | | | Since the MapTextureImage changes on Intel, nwn had corruption in the scrollbar at the load game menu, and corrupted ground textures in the starting zone. Heroes of Newerth's intro screen was also thoroughly garbled. A new piglit test "compressedteximage" was created to regression test this. The issue was this code now seeing dstRowStride aligned to hardware requirements instead of a temporary buffer that gets uploaded to hardware later. The existing code was just trying to memcpy srcRowStride * height / bh, while the glCompressedTexSubImage2D() storage code nearby did the correct walking by blockheight rows at a time. Just reuse the subimage upload instead of duplicating that logic. v2: Update comment at the top of the function (suggestion by Joel Forsberg) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41451 Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* mesa: add casts to fix unpack_SIGNED_GR1616()Brian Paul2011-12-021-2/+2
| | | | We were passing unsigned values to the macro before.
* mesa: remove unreachable code in _mesa_unpack_color_span_ubyte()Brian Paul2011-12-021-64/+0
| | | | | | | | We checked if srcType == GL_UNSIGNED_BYTE earlier so there was no way to reach this code. This was left-over code from the GLchan removal work. Reviewed-by: José Fonseca <[email protected]>
* mesa: move _mesa_error() call in compressedteximage()Brian Paul2011-12-021-7/+2
| | | | | | | | We shouldn't call _mesa_error() if the target is a proxy texture. Errors are handled later in the function. Fixes a Coverity warning. Reviewed-by: José Fonseca <[email protected]>
* mesa: fix potential mem leak in generate_mipmap_compressed()Brian Paul2011-12-021-0/+1
| | | | | | Fixes a coverity warning. Reviewed-by: Vinson Lee <[email protected]>
* mesa: fix some minor texstore commentsBrian Paul2011-12-021-3/+3
| | | | For the texsubimage commands, we're not mapping the whole image/region.
* mesa: rename MESA_FORMAT_RG88_REV to MESA_FORMAT_RG88Brian Paul2011-12-024-10/+10
| | | | R is in the high byte, G in the low byte.
* mesa: rename MESA_FORMAT_RG88 to MESA_FORMAT_GR88Brian Paul2011-12-026-17/+17
| | | | | To better reflect the component ordering and be consistent with other format names.
* mesa: fix unpacking of RG88_REV texelsBrian Paul2011-12-021-2/+2
| | | | R should be in the high byte and G in the low byte for this format.
* mesa: Extend BITSET64_*_RANGE to work on arbitrary ranges.Mathias Fröhlich2011-12-021-3/+18
| | | | | | | | | | The BITSET64_{TEST,SET,CLEAR}_RANGE macros only work on ranges wither in the lower 32 or in the upper 32 bits of the bitset. This change extends these macros to work on arbitrary ranges possibly crossing the bitset word boundary. Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add support for GL_OES_compressed_ETC1_RGB8_textureChia-I Wu2011-12-0212-0/+122
| | | | | | | | | | | Add support for GL_OES_compressed_ETC1_RGB8_texture to core mesa. There is no driver support yet. Unlike desktop GL compressed texture formats, GLES compressed texture formats usually can only be used with glCompressedTexImage2D. All other gl*Tex*Image* functions are updated to check for that. Reviewed-by: Brian Paul <[email protected]>
* mesa: add ETC1 decoding routinesChia-I Wu2011-12-023-0/+247
| | | | | | | The format is defined by GL_OES_compressed_ETC1_RGB8_texture. These routines will be used in the following commit. Reviewed-by: Brian Paul <[email protected]>
* glapi: regenerate files for GL_OES_compressed_ETC1_RGB8_textureChia-I Wu2011-12-021-3035/+3038
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: fix unpack_ARGB1555_REV()Brian Paul2011-12-011-4/+5
| | | | | | | | We weren't doing the necessary byte swap. v2: use same arithmetic as unpack_ARGB1555() to be consistent. Reviewed-by: Michel Dänzer <[email protected]>
* mesa: fix indentation in attrib.cBrian Paul2011-11-301-1/+1
|
* mesa: use _mesa_is_bufferobj() in update_array()Brian Paul2011-11-301-1/+1
|
* mesa: fix signed/unsigned comparison warningBrian Paul2011-11-301-1/+1
|
* mesa: fix MESA_FORMAT_RG88 format match testBrian Paul2011-11-301-1/+1
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: regenerated dispatch.h (s/INLINE/inline/)Brian Paul2011-11-301-1946/+1946
|
* 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]>
* 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]>
* 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-2912-320/+252
| | | | | | | | | | | | 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-296-15/+15
| | | | | | | | | 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]>
* 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-298-21/+21
| | | | | | | | | | | | | | | 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.
* 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-282-4/+4
| | | | | | | 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]>
* 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]>