summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: remove redundant format/type checks in glReadPixels()Brian Paul2012-02-071-35/+0
| | | | | | These are done in _mesa_error_check_format_and_type(). Signed-off-by: Brian Paul <[email protected]>
* mesa: remove redundant format/type checks in glGetTexImage()Brian Paul2012-02-071-34/+0
| | | | | | | The _mesa_error_check_format_and_type() function will catch all those cases now. Signed-off-by: Brian Paul <[email protected]>
* mesa: new _mesa_error_check_format_and_type() functionBrian Paul2012-02-075-94/+178
| | | | | | | | | | | | | | | | | | | | This replaces the _mesa_is_legal_format_and_type() function. According to the spec, some invalid format/type combinations to glDrawPixels, ReadPixels and glTexImage should generate GL_INVALID_ENUM but others should generate GL_INVALID_OPERATION. With the old function we didn't make that distinction and generated GL_INVALID_ENUM errors instead of GL_INVALID_OPERATION. The new function returns one of those errors or GL_NO_ERROR. This will also let us remove some redundant format/type checks in follow-on commit. v2: add more checks for ARB_texture_rgb10_a2ui at the top of _mesa_error_check_format_and_type() per Ian. Signed-off-by: Brian Paul <[email protected]>
* mesa: support more format/type combos in _mesa_dump_image()Brian Paul2012-02-061-1/+28
|
* mesa: check_index_bounds off-by-one fixRoland Scheidegger2012-02-061-1/+1
| | | | | | | | in check_index_bounds the comparison needs to be "greater equal" since contrary to the name _MaxElement is the count of the array (this matches similar code in vbo_exec_DrawRangeElementsBaseVertex). Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix the error message function names for glFlushMappedBufferRange().Eric Anholt2012-02-031-7/+7
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix bad-enum/no-buffer error handling for buffer object functions.Eric Anholt2012-02-031-87/+39
| | | | | | | | | | | | | | | For all the extension entrypoints using the get_buffer() helper, they wanted the same error handling. In some cases, the error was doing the same error return whether target was a bad enum, or a user buffer wasn't bound. (Actually, GL_ARB_map_buffer_range doesn't specify the error for a zero buffer being bound for MapBufferRange, though it does for FlushMappedBufferRange. This appears to be an oversight). Fixes piglit GL_ARB_copy_buffer/negative-bound-zero. Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix copy-and-paste error in _mesa_pack_rgba_span_floatIan Romanick2012-02-021-3/+2
| | | | | | | | | | | GL_RG_INTEGER only has two components, not three. I'll be surprised if anyone ever tries to glReadPixels(..., GL_SHORT, GL_RG_INTEGER, ...). This was found by inspection. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix copy-and-paste bug in do_row_3DIan Romanick2012-02-021-3/+3
| | | | | | | | | | | | | Several of the half-float cases used 4 as the texel size when it should have been some smaller value. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43324 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43325
* mesa: Set the gl_array_object::ARBsemantics flag at the right timeIan Romanick2012-02-022-1/+10
| | | | | | | | | | | | | With 0963990 the flag was only set when Bind created the object. In all cases where ::ARBsemantics could be true, this path never happened. Instead, add a _Used flag to track whether a VAO has ever been bound. On the first Bind, set the _Used flag, and set the ARBsemantics flag to the correct value. NOTE: This is a candidate for release branches. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45423
* mesa: Add unpack_uint_z_row support for floating-point depth buffersIan Romanick2012-02-021-0/+32
| | | | | | | | | | | | | | | This is a hack, and it will result in incorrect rendering. However, it does eliminate spurious warnings in several piglit CopyPixels tests that involve floating-point depth buffers. The real solution is to add a zf field to SWspan to store float Z values. When a float depth buffer is involved, swrast should also populate the zf field. I'll consider this post-8.0 work. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fix maximum allowed proxy texture size conditionAnuj Phogat2012-02-011-11/+11
| | | | | | | | | | | | | | | | | | | | width, height parameter in glTexImage2D() includes: texture image width + 2 * border (if any). So when doing the texture size check in _mesa_test_proxy_teximage() width and height should not exceed maximum supported size for target texture type. i.e. 1 << (ctx->Const.MaxTextureLevels - 1) Texture border is anyway stripped out before it is given to intel or gallium drivers. This patch fixes Intel oglconform test case: max_values Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970 Note: This is a candidate for mesa 8.0 branch. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: reference shared state in glPushAttrib(GL_TEXTURE_BIT)Brian Paul2012-02-011-0/+13
| | | | | | | | | | | | This fixes a dangling texture object pointer bug hit via wglShareLists(). When we push the GL_TEXTURE_BIT state we may push references to the default texture objects which are owned by the gl_shared_state object. We don't want to accidentally delete that shared state while the attribute stack references shared objects. So keep a reference to it. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: use new _mesa_reference_shared_state() functionBrian Paul2012-02-013-38/+49
| | | | | | | | | This cleans up the reference counting of shared context state. The next patch will use this to fix an actual bug. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: remove stray comment in PopAttrib() codeBrian Paul2012-02-011-1/+0
|
* mesa: consolidate general ubyte texstore codeBrian Paul2012-01-301-171/+71
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: use _mesa_pack_ubyte_rgba_rect() in texstore codeBrian Paul2012-01-301-219/+64
| | | | | | | Simplifies the general case code in the ubyte-valued texture format functions. More consolidation to come in subsequent commits. Reviewed-by: Eric Anholt <[email protected]>
* mesa: added _mesa_pack_ubyte_rgba_rect()Brian Paul2012-01-302-0/+46
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add a flag for forcing all GLSL extensions to "warn".Eric Anholt2012-01-301-0/+6
| | | | | NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/format_unpack: add LUMINANCE 8/16 UINT/INTDave Airlie2012-01-301-0/+58
| | | | | | | | This just copies what the LUMINANCE_ALPHA bits do. Fixes piglit tests on softpipe complaining about missing unpack. Signed-off-by: Dave Airlie <[email protected]>
* mesa: remove byteswap check in fast_read_rgba_pixels_memcpy()Brian Paul2012-01-271-5/+0
| | | | | | It's handled by _mesa_format_matches_format_and_type() now. Reviewed-by: Ian Romanick <[email protected]>
* mesa: more use of _mesa_format_matches_format_and_type() in texstore codeBrian Paul2012-01-271-12/+7
| | | | | | For rgb9_e5, r11_g11_b10f, argb2101010_uint functions. Reviewed-by: Ian Romanick <[email protected]>
* mesa: more use of _mesa_format_matches_format_and_type() in texstore codeBrian Paul2012-01-271-19/+4
| | | | | | For rgb332, signed rgba8888, signed rgba888_rev functions. Reviewed-by: Ian Romanick <[email protected]>
* mesa: more use of _mesa_format_matches_format_and_type() in texstore codeBrian Paul2012-01-271-13/+7
| | | | | | For rgba5551, argb1555, argb2101010 formats. Reviewed-by: Ian Romanick <[email protected]>
* mesa: more use of _mesa_format_matches_format_and_type() in texstore codeBrian Paul2012-01-271-18/+8
| | | | For rgb565, argb8888, rgb888, argb4444 functions.
* mesa: use _mesa_format_matches_format_and_type() in texstore codeBrian Paul2012-01-271-44/+4
| | | | | | | | | | This simplifies the code quite a bit, consolidates some cases and possibly catches more cases for the memcpy path. More such changes will follow. Do just a few at a time to help bisect any possible regressions. Reviewed-by: Ian Romanick <[email protected]>
* mesa: implement more cases in _mesa_format_matches_format_and_type()Brian Paul2012-01-271-2/+22
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: use swapBytes parameter in _mesa_format_matches_format_and_type()Brian Paul2012-01-271-38/+93
| | | | | | | | This will let us use memcpy in more situations. We can also remove the checks for byte spapping that happen before the calls to _mesa_format_matches_format_and_type(). Reviewed-by: Ian Romanick <[email protected]>
* mesa: added swapBytes parameter to _mesa_format_matches_format_and_type()Brian Paul2012-01-273-6/+10
| | | | | | Not actually used yet though. Reviewed-by: Ian Romanick <[email protected]>
* mesa: rewrite, simplify some of the logic in ↵Brian Paul2012-01-271-9/+28
| | | | | | | | _mesa_format_matches_format_and_type() In preparation for adding GL_PACK/UNPACK_SWAP_BYTES support. Reviewed-by: Ian Romanick <[email protected]>
* mesa: add BGR888 code in _mesa_format_matches_format_and_type()Brian Paul2012-01-271-1/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: fix error in _mesa_format_matches_format_and_type() for RGB888Brian Paul2012-01-271-1/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove redundant byte swap checkBrian Paul2012-01-271-6/+2
| | | | | | The outer conditional already did the test. Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove LSB-first pixel packing check in glReadPixelsBrian Paul2012-01-271-2/+1
| | | | | | GL_UNPACK_LSB_FIRST only applies to bitmap data, not glReadPixels. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Avoid void * arithmetic.José Fonseca2012-01-271-1/+1
| | | | Should fix MSVC build.
* mesa: set clamp bit in glGetTexImage for GL_UNSIGNED_NORMALIZEDAnuj Phogat2012-01-271-0/+9
| | | | | | | | | | | | | Color clamping should be enabled in glGetTexImage if texture dataType is GL_UNSIGNED_NORMALIZED and format is GL_LUMINANCE or GL_LUMINANCE_ALPHA Fixes 2 Intel oglconform test cases: pxconv-gettex and pxtrans-gettex https://bugs.freedesktop.org/show_bug.cgi?id=40864 NOTE: This is a candidate for the 8.0 branch Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Don't round-trip integer texture data through a floating point temp.Eric Anholt2012-01-271-21/+24
| | | | | | | | | | | | | | | This was losing bits of precision. Fixes (with the previous commits): piglit EXT_texture_integer/getteximage-clamping piglit EXT_texture_integer/getteximage-clamping GL_ARB_texture_rg oglc advanced.mipmap.upload Regresses oglc negative.typeFormatMismatch.teximage from fail to abort, because it's been hitting texstore for a format/type combo that shouldn't happen. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]>
* mesa: When unpacking signed integer pixel data, don't clamp to 0.Eric Anholt2012-01-271-33/+12
| | | | | | | | | | | | In the core, we always treat spans of int/uint data as uint, so this extract function was truncating storage of integer pixel data to a n int texture to (0, max_int) instead of (min_int, max_int). There is probably missing code for handling truncation on conversion between pixel formats, still, but this does improve things. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]>
* mesa: Add clamping for packing of integer data.Eric Anholt2012-01-271-4/+4
| | | | | | | | | | Mostly fixes piglit EXT_texture_integer/getteximage-clamping. The remaining failure involves precision loss on storing of int32 texture data (something I knew was an issue, but wasn't trying to test). NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]>
* mesa: Add missing format unpack for some integer texture formats.Eric Anholt2012-01-271-0/+321
| | | | | | | | | | | | | This cut and paste is pretty awful. I'm tempted to do a lot of this using preprocessor tricks for customizing the parameter type from a template function, but that's just a different sort of hideous. Fixes 8 Intel oglconform int-textures cases. NOTE: This is a candidate for the 8.0 branch. v2: Add alpha formats, too. Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix handling of glCopyBufferSubData() for src == dst.Eric Anholt2012-01-271-6/+19
| | | | | | | | Fixes piglit ARB_copy_buffer-overlap, on swrast, which previously assertion failed. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix display list handling for GL_EXT_framebuffer_multisample.Eric Anholt2012-01-271-0/+3
| | | | | | | | | | | | | | | From the extension spec: Added to section 5.4, as part of the discussion of which commands are not compiled into display lists: "Certain commands, when called while compiling a display list, are not compiled into the display list but are executed immediately. These are: ..., RenderbufferStorageMultisampleEXT..." Fixes piglit EXT_framebuffer_multisample/dlist. Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix display list handling for EXT_framebuffer_object.Eric Anholt2012-01-271-0/+18
| | | | | | | | | | | | | | | | | | | | Noticed when handling a similar problem in EXT_framebuffer_multisample. From the EXT_framebuffer_object spec: Added to section 5.4, as part of the discussion of which commands are not compiled into display lists: "Certain commands, when called while compiling a display list, are not compiled into the display list but are executed immediately. These are: ..., GenFramebuffersEXT, BindFramebufferEXT, DeleteFramebuffersEXT, CheckFramebufferStatusEXT, GenRenderbuffersEXT, BindRenderbufferEXT, DeleteRenderbuffersEXT, RenderbufferStorageEXT, FramebufferTexture1DEXT, FramebufferTexture2DEXT, FramebufferTexture3DEXT, FramebufferRenderbufferEXT, GenerateMipmapEXT..." Reviewed-by: Brian Paul <[email protected]>
* mesa: remove ctx->Const.sRGBCapableMarek Olšák2012-01-253-5/+2
| | | | | | | It always had the same value as ctx->Extensions.EXT_framebuffer_sRGB. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* mesa: allow exposing GL3 without EXT_texture_integerMarek Olšák2012-01-255-16/+37
| | | | | | | | | | | Strictly speaking, it's not legal to expose EXT_texture_integer without EXT_gpu_shader4. It might be even dangerous (apps can assume EXT_gpu_shader4 is available without checking for it). The check in compute_version is removed as well, because that's already covered by GLSLVersion >= 130. Reviewed-by: Brian Paul <[email protected]>
* mesa: add missing integer alpha formats to _mesa_base_fbo_formatMarek Olšák2012-01-251-0/+9
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: remove obsolete comment in version.cMarek Olšák2012-01-251-1/+0
| | | | Pointed out by Brian Paul.
* mesa: Fix CopyTex{Sub,}Image error checks for integer vs non-integer.Eric Anholt2012-01-241-8/+31
| | | | | | | | Fixes Intel oglconform negative.typeFormatMismatch.copyteximage. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]>
* mesa: Add missing integer R/RG cases to _mesa_is_color_format().Eric Anholt2012-01-241-0/+12
| | | | | | | | | This is part of fixing Intel oglconform negative.typeFormatMismatch.copyteximage. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]>
* mesa: Add the remaining from/to types for GL_EXT_texture_integer (and R/RG).Eric Anholt2012-01-242-51/+176
| | | | | | | | | | | This aborts and crashes in intel oglconform's int-textures into being just rendering failures. Clamping isn't handled yet. v2: Add missing "break". v3: Drop the int/uint distinction, since they don't need different clamping. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Brian Paul <[email protected]> (v2)