summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: new _mesa_prepare_mipmap_level() function for mipmap generationBrian Paul2011-12-162-33/+101
| | | | | | | | | | | | | | | | This helper function is used during mipmap generation to prepare space for the destination mipmap levels. This improves/fixes two things: 1. If the texture object was created with glTexStorage2D, calling _mesa_TexImage2D() to allocate the new image would generate INVALID_OPERATION since the texture is marked as immutable. 2. _mesa_TexImage2D() always frees any existing texture image memory before allocating new memory. That's inefficient if the existing image is the right size already. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: make update_fbo_texture() non-staticBrian Paul2011-12-162-5/+10
| | | | | | | We'll call this from the mipmap generation code. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: whitespace and comment fixes in fbobject.cBrian Paul2011-12-161-9/+11
|
* mesa: add MESA_FORMAT_RGB565[_REV] as candidates for GL_R3_G3_B2Brian Paul2011-12-161-0/+2
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: add a few comments for the z unpacking functionsBrian Paul2011-12-161-0/+8
|
* Enabling display list support for glClearBuffer functions with minor fixesAnuj Phogat2011-12-151-11/+11
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: implement DrawTransformFeedback from ARB_transform_feedback2Marek Olšák2011-12-158-60/+64
| | | | | | | | | | | | | | It's like DrawArrays, but the count is taken from a transform feedback object. This removes DrawTransformFeedback from dd_function_table and adds the same function to GLvertexformat (with the function parameters matching GL). The vbo_draw_func callback has a new parameter "struct gl_transform_feedback_object *tfb_vertcount". The rest of the code just validates states and forwards the transform feedback object into vbo_draw_func.
* Add mismatch check for glGetTexImage or it will return -1 and may lead to ↵Jian Zhao2011-12-141-0/+8
| | | | | | segment fault. Reviewed-by: Brian Paul <[email protected]>
* Regenerate files from previous commitsIan Romanick2011-12-132-2049/+2049
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* mesa: add const flags to skip MaxVarying and MaxUniform linker checks (v2)Marek Olšák2011-12-131-0/+9
| | | | | | | | | This is only temporary until a better solution is available. v2: print warnings and add gallium CAPs Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: update comments for _DepthBuffer, _StencilBuffer fieldsBrian Paul2011-12-131-2/+3
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove _DepthBuffer, _StencilBuffer resize codeBrian Paul2011-12-131-18/+0
| | | | | | This is handled in swrast now when we validate the framebuffer state. Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove unused depthstencil.[ch] filesBrian Paul2011-12-132-1072/+0
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: move depth/stencil buffer validation to swrastBrian Paul2011-12-131-3/+0
| | | | | | | | | Since gl_framebuffer::_DepthBuffer and _StencilBuffer are only used by swrast, do the validation of those fields in swrast too. The main/depthstencil.[ch] code is no longer used and will be removed next. Reviewed-by: Eric Anholt <[email protected]>
* mesa: move update_depth/stencil_buffer() functionsBrian Paul2011-12-133-96/+89
| | | | | | | | | These functions update the gl_framebuffer::_DepthBuffer and _StencilBuffer fields, possibly creating renderbuffer wrappers that make a shared depth+stencil accessible as depth-only or stencil only. This stuff is only used by swrast now and will be moved there next. Reviewed-by: Eric Anholt <[email protected]>
* mesa: stop using _Depth, _StencilBuffer fields in _mesa_BlitFramebufferEXT()Brian Paul2011-12-131-6/+8
| | | | | | | | We're just looking at the depth/stencil renderbuffers to do error checking. We don't need to look at the depth/stencil wrappers to do that. Also, remove pointless readRb = depthRb = NULL assignments. Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix possible precision issues in pack/unpack/fetch functionsMarek Olšák2011-12-122-14/+14
| | | | | | | | | | | | | | | | | GLfloat doesn't have enough precision to exactly represent 0xffffff and 0xffffffff. (and a reciprocal of those, if I am not mistaken) If -ffast-math is enabled, using GLfloat causes assertion failures in: - fbo-blit-d24s8 - fbo-depth-sample-compare - fbo-readpixels-depth-formats - glean/depthStencil For example: fbo-depth-sample-compare: main/format_unpack.c:1769: unpack_float_z_Z24_X8: Assertion `dst[i] <= 1.0F' failed. Reviewed-by: Brian Paul <[email protected]>
* mesa: add missing RG_INTEGER and some RED_INTEGER_EXT checks.Dave Airlie2011-12-104-0/+21
| | | | | | | | | | | This just adds the correct checks and asserts in the right places. This doesn't fix all the tests that I've sent to piglit, need to add int paths to go alongside the uint paths that don't go via float to fix it up properly. I'm not sure how much of that could be templated/shared will have a look once I write it the long way. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa,intel: use _mesa_image_offset() for PBOsnobled2011-12-081-13/+16
| | | | | | | | This avoids forming invalid pointers needlessly, which even if never dereferenced is undefined behavior. It also makes _mesa_validate_pbo_access() more comprehensible. Reviewed-by: Brian Paul <[email protected]>
* mesa: add _mesa_image_offset()nobled2011-12-082-17/+57
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa/image: assert on bad formatnobled2011-12-081-11/+9
| | | | | | | | | | | | | | | | | NULL as an error indicator is meaningless, since it will return NULL on success anyway if the caller passes in zero as the image's address and asks to calculate the offset of the first pixel. For example, _mesa_validate_pbo_access() does this. This also matches the code in the non-GL_BITMAP codepath, which already has an assert like this. v2: Per Brian Paul's review, remove the function call entirely and tighten the assert to only accept the two formats compatible with GL_BITMAP. They always have one component per pixel. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa/image: delete dead storenobled2011-12-081-7/+0
| | | | | | The return value here is a) always zero, b) never used. Reviewed-by: Brian Paul <[email protected]>
* mesa: use malloc instead of MAX_WIDTH array in glReadPixels()Brian Paul2011-12-081-9/+14
| | | | | Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: use malloc instead of MAX_WIDTH array in _mesa_convert_colors()Brian Paul2011-12-081-1/+7
| | | | | Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: add MAX_PIXEL_BYTES defineBrian Paul2011-12-082-0/+10
| | | | | | | | | In a few places we need to allocate space for some number of generic pixels. Use this new define instead of a magic number like 16 or 4 * sizeof(GLuint). Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: simplify _mesa_remove_renderbuffer()Brian Paul2011-12-081-10/+2
|
* mesa: remove software-based renderbuffer code from core MesaBrian Paul2011-12-082-2039/+0
| | | | | | We're now using the functions that live in swrast. Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove unused functions in depthstencil.cBrian Paul2011-12-082-171/+0
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: make some renderbuffer functions staticBrian Paul2011-12-082-76/+48
| | | | | | | The functions to allocate software color, depth, accum, etc buffers aren't called from anywhere else. Reviewed-by: Eric Anholt <[email protected]>
* mesa: rewrite accum buffer supportBrian Paul2011-12-082-1/+403
| | | | | | | | | | | | | Implemented in terms of renderbuffer mapping/unmapping and format packing/unpacking functions. The swrast and state tracker code for implementing accumulation are unused and will be removed in the next commit. v2: don't use memcpy() in _mesa_clear_accum_buffer() v3: don't allocate MAX_WIDTH arrays, be more careful with mapping flags Reviewed-by: Eric Anholt <[email protected]>
* mesa: new format_pack.c codeBrian Paul2011-12-082-0/+2594
| | | | | | This code packs colors, Z, stencil, etc. in the various mesa pixel formats. Will be used for things like glDrawPixels, glTexImage, glAccum, etc.
* mesa: remove the ctx->Driver.IsTextureResident() hookBrian Paul2011-12-083-29/+5
| | | | | | | No driver implemented this and we always returned "True" for residence queries. Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove TextureMemCpy driver hookBrian Paul2011-12-082-16/+2
| | | | There's probably no reason to use a special version of memcpy() anymore.
* mesa: Track changes to transform feedback state.Paul Berry2011-12-072-1/+9
| | | | | | | | | | | This patch adds a new bit to the ctx->NewState bitfield, _NEW_TRANSFORM_FEEDBACK, to track state changes that affect ctx->TransformFeedback. This bit can be used by driver back-ends to avoid expensive recomputations when transform feedback state has not been modified. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* 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]>