summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Remove now unused main/bitset.h.Mathias Fröhlich2011-12-281-160/+0
| | | | Signed-off-by: Mathias Froehlich <[email protected]>
* mesa: Remove remaining FEATURE_ARB_vertex_buffer_object guards.Mathias Fröhlich2011-12-286-21/+0
| | | | | | | | | Since commit 82b9661894315362f857192439bdcbc9db090387 and 34eae1c72a9b3a8eb0634cda52fca0208cd2f40d vbo support is mandatory for all drivers. So, remove the remaining FEATURE_ARB_vertex_buffer_object guards. Signed-off-by: Mathias Froehlich <[email protected]>
* mesa: Convert RENDERINPUTS* macros to GLbitfield64.Mathias Fröhlich2011-12-281-0/+6
| | | | | Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fpclassify is available on HaikuAlexander von Gluck2011-12-271-1/+1
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* mesa: fix signed/unsigned comparison warningsBrian Paul2011-12-261-2/+2
|
* mesa: remove leftovers from color indexed rendering.Mathias Fröhlich2011-12-261-2/+0
| | | | | | | | | Remove gl_light::_dli and gl_light::_sli. Both are only used for a value previously used in color indexed rendering. Also both variables are only used and never written. Signed-off-by: Mathias Froehlich <[email protected]>
* mesa: remove unused _mesa_copy_materials.Mathias Fröhlich2011-12-262-20/+0
| | | | Signed-off-by: Mathias Froehlich <[email protected]>
* mesa: consolidate texstore functionsBrian Paul2011-12-241-331/+153
| | | | | | | | | The code for storing 1D, 2D and 3D tex images (whole or sub-images) was all pretty similar. This consolidates those six paths. v2: rework switch statement to catch unexpected targets Reviewed-by: José Fonseca <[email protected]>
* mesa: fix _mesa_store_texsubimage2d() for GL_TEXTURE_1D_ARRAYBrian Paul2011-12-241-23/+44
| | | | | | | For 1D arrays, map each slice separately. Note that this was handled correctly in _mesa_store_teximage2d() but not here. Reviewed-by: José Fonseca <[email protected]>
* mesa: update comment for MapTextureImage()Brian Paul2011-12-241-0/+2
|
* mesa: remove gl_renderbuffer::PutRowRGB()Brian Paul2011-12-242-10/+0
| | | | | | No longer used anywhere. Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove gl_renderbufer::PutMonoRow() and PutMonoValues()Brian Paul2011-12-242-14/+0
| | | | | | | The former was only used for clearing buffers. The later wasn't used anywhere! Remove them and all implementations of those functions. Reviewed-by: Eric Anholt <[email protected]>
* mesa: add _mesa_pack_colormask()Brian Paul2011-12-242-0/+78
| | | | | | For generating bit-wise colormasks for arbitrary pixel formats. Reviewed-by: José Fonseca <[email protected]>
* mesa: add _mesa_get_format_max_bits()Brian Paul2011-12-242-0/+19
| | | | | | Returns max bits per channel for the given format. Reviewed-by: José Fonseca <[email protected]>
* mesa: split get_tex_rgba() into compressed/uncompressed versionsBrian Paul2011-12-241-145/+175
| | | | | | | This just splits one big function into two smaller ones for better readability. Reviewed-by: José Fonseca <[email protected]>
* mesa: fix comments in getteximage_error_check()Brian Paul2011-12-241-2/+2
|
* mesa: move the format and type check before select_tex_image()Jian Zhao2011-12-241-6/+6
| | | | | | | | | | Move the format and type check before select_tex_image, or it will fail to report the mismatch error if the teximage is null. Reported-by: Anuj Phogat <[email protected]> Signed-off-by: Jian Zhao <[email protected]> Reviewed-by: Yuanhan Liu <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* mesa: Disable certain error checks when transform feedback is pausedPaul Berry2011-12-232-3/+5
| | | | | | | | | | When transform feedback is paused, it is legal to change programs or to perform drawing operations using a drawing mode that doesn't match the transform feedback mode. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Ensure that Paused is reset to false on EndTransformFeedback.Paul Berry2011-12-231-0/+1
| | | | | | | | | | | | If a client calls BeginTransformFeedback(), then PauseTransformFeedback(), then EndTransformFeedback(), we need to make sure that the transform feedback object is not left in a "paused" state, otherwise the next call to BeginTransformFeedback() will leave transform feedback paused. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* format_unpack: add 8/16 rgba/rgb types.Dave Airlie2011-12-221-0/+134
| | | | | | | | | | fixing these makes piglit fbo-integer pass on softpipe. modified to re-order things, haven't addressed Eric's concerns, can't find anything in spec that mentions sign extensions, it does say integers aren't clamped or modified. Signed-off-by: Dave Airlie <[email protected]>
* mesa: Add _NEW_RASTERIZER_DISCARD as synonym for _NEW_TRANSFORM.Paul Berry2011-12-212-1/+7
| | | | | | | | | | This makes it easier to keep track of which dirty bits correspond to which pieces of context, since it makes _NEW_RASTERIZER_DISCARD correspond with ctx->RasterDiscard. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Move RasterDiscard to toplevel of gl_context.Paul Berry2011-12-216-17/+17
| | | | | | | | | | | | | | | | | | | | Previously we were storing the RasterDiscard flag (for GL_RASTERIZER_DISCARD) in gl_context::TransformFeedback. This was confusing, because we use the _NEW_TRANSFORM flag (not _NEW_TRANSFORM_FEEDBACK) to track state updates to it, and because rasterizer discard has effects even when transform feedback is not in use. This patch makes RasterDiscard a toplevel element in gl_context rather than a subfield of gl_context::TransformFeedback. Note: We can't put RasterDiscard inside gl_context::Transform, since all items inside gl_context::Transform need to be pieces of state that are saved and restored using PushAttrib and PopAttrib. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Remove unnecessary FLUSH_VERTICES in bind_buffer_rangePaul Berry2011-12-201-1/+5
| | | | | | | | | | It isn't necessary to call FLUSH_VERTICES from bind_buffer_range, because transform feedback buffers are not allowed to be changed when transform feedback is active. Thanks to Marek Olšák for pointing out this bug. Reviewed-by: Marek Olšák <[email protected]>
* mesa: Fix off-by-one error in transform feedback size check.Paul Berry2011-12-201-1/+1
| | | | | | | | | | | In _mesa_BindBufferRange(), we need to verify that the offset and size specified by the client do not exceed the size of the underlying buffer. We were accidentally doing this check using ">=" rather than ">", so we were generating a bogus error if the client specified an offset and size that fit exactly in the underlying buffer. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Record transform feedback strides/offsets in linker output.Paul Berry2011-12-201-0/+10
| | | | | | | | | | | | | | | | | | | | | | This patch adds two new fields to the gl_transform_feedback_info struct: - BufferStride records the total number of components (per vertex) that transform feedback is being instructed to store in each buffer. - Outputs[i].DstOffset records the offset within the interleaved structure of each transform feedback output. These values are needed by the i965 gen6 and r600g back-ends, so it seems better to have the linker provide them rather than force each back-end to compute them independently. Also, DstOffset helps pave the way for supporting ARB_transform_feedback3, which allows the transform feedback output to contain holes between attributes by specifying gl_SkipComponents{1,2,3,4} as the varying name. Reviewed-by: Marek Olšák <[email protected]>
* Fix compilation on cygwin after commit 762c9766c93697af8d7fbaa729aed118789dbe8eJon TURNEY2011-12-201-1/+1
| | | | | | | | | | | | | Fix compilation on cygwin after commit 762c9766c93697af8d7fbaa729aed118789dbe8e "Use VERT_ATTRIB_* indexed array in gl_array_object" added the first non-driver use of ffsll(), which exposes the fact that this isn't provided on cygwin. Found by tinderbox, see [1] [1] http://tinderbox.freedesktop.org/builds/2011-11-30-0017/logs/libGL/#build Signed-off-by: Jon TURNEY <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fix a leak in _mesa_delete_texture_image()Pekka Paalanen2011-12-201-0/+1
| | | | | | | | | | | | | Valgrind complains about a definitely lost block allocated in intelNewTextureImage(). This leak was apparently created by 6e0f9001fe3fb191c2928bd09aa9e9d05ddf4ea9, "mesa: move gl_texture_image::Data, RowStride, ImageOffsets to swrast", as it removes the free() from _mesa_delete_texture_image(). Put the free() back, fixes a Valgrind error. Signed-off-by: Pekka Paalanen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: make _mesa_set_tex_image() static since it's not called anywhere elseBrian Paul2011-12-182-13/+7
|
* 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]>