summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Loosen glBlitFramebuffer restrictions on depthstencil buffers (v2)Chad Versace2012-01-201-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This loosens the format validation in glBlitFramebuffer. When blitting depth bits, don't require an exact match between the depth formats; only require that the two formats have the same number of depth bits and the same depth datatype (float vs uint). Ditto for stencil. Between S8_Z24 buffers, the EXT_framebuffer_blit spec allows glBlitFramebuffer to blit the depth and stencil bits separately. So I see no reason to prevent blitting the depth bits between X8_Z24 and S8_Z24 or the stencil bits between S8 and S8_Z24. However, we of course don't want to allow blitting from Z32 to Z32_FLOAT. Fixes Piglit fbo/fbo-blit-d24s8 on Intel drivers with separate stencil enabled. The problem was that, on Intel drivers with separate stencil, the default framebuffer has separate depth and stencil buffers with formats X8_Z24 and S8. The test attempts to blit the depth bits from a S8_Z24 buffer into the default framebuffer. v2: Check that depth datatypes match. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44665 Note: This is a candidate for the 8.0 branch. Reported-by: Xunx Fang <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: Avoid short-circuiting realloc of renderbuffers to new sample count.Eric Anholt2012-01-121-1/+2
| | | | | | | Fixes piglit EXT_framebuffer_multisample/renderbuffer-samples. Reviewed-by: Brian Paul <[email protected]> NOTE: This is a candidate for the 8.0 branch.
* mesa: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functionsBrian Paul2012-01-121-33/+14
| | | | | | Rather than testing the fbo's name against zero. Reviewed-by: José Fonseca <[email protected]>
* mesa: add missing color buffer datatype check for glBlitFramebuffer()Brian Paul2012-01-101-0/+44
| | | | Reviewed-By: Jose Fonseca <[email protected]>
* mesa: fix error message in _mesa_BlitFramebufferEXT()Brian Paul2012-01-091-1/+1
|
* mesa: check depth, stencil formats (not depths) in glBlitFramebufferBrian Paul2012-01-091-6/+4
| | | | | | | | | | | | We were only comparing the number of depth and stencil bits but the extension spec actually says the formats must match: The error INVALID_OPERATION is generated if BlitFramebufferEXT is called and <mask> includes DEPTH_BUFFER_BIT or STENCIL_BUFFER_BIT and the source and destination depth or stencil buffer formats do not match. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add missing error check for linear blit of integer colorsBrian Paul2012-01-091-0/+13
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: whitespace and comment fixes in fbobject.cBrian Paul2011-12-161-9/+11
|
* 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: move _mesa_base_format_has_channel() into image.cBrian Paul2011-11-281-1/+1
| | | | | | This is where other format-related functions live. Reviewed-by: Eric Anholt <[email protected]>
* mesa: use _mesa_base_format_has_channel() in fbobject.c queriesBrian Paul2011-11-281-41/+4
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa/format: add mesa MESA_FORMAT_ARGB2101010_UINT support.Dave Airlie2011-11-281-0/+3
| | | | | | | | | | | | | | 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]>
* mesa: define, use _mesa_is_cube_face() in several placesBrian Paul2011-11-191-9/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix glFramebufferTexture*() for depth and stencil attachmentsChad Versace2011-11-111-3/+55
| | | | | | | | | | | | | | | | | | | | | | | This patch solves three bugs. 1. When a texture was attached to the GL_DEPTH_STENCIL_ATTACHMENT point, Mesa attached the texture only to the depth attachment point gl_framebuffer::Attachment[BUFFER_DEPTH] and failed to attach it to the stencil attachment point gl_framebuffer::Attachment[BUFFER_STENCIL] 2. When a texture was attached to the GL_DEPTH_ATTACHMENT point and then later attached to the GL_STENCIL_ATTACHMENT point, Mesa created two separate renderbuffer wrappers. This caused a GL error in glGetFramebufferAttachmentParameteriv(). 3. Same as 2, but with depth and stencil juxtaposed. Fixes Piglit test ARB_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL Note: This is a candidate for the stable branches. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: fix a logic error in glFramebufferTexture2DChia-I Wu2011-11-031-1/+1
| | | | | | | Unrecognized texture target should give an error. Reviewed-by: Brian Paul <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]>
* mesa: fix the low limit of width and height for glRenderbufferStorageYuanhan Liu2011-11-031-2/+2
| | | | | | | | | | | | glRenderbufferStorage man page says: GL_INVALID_VALUE is generated if either of width or height is negative, or greater than the value of GL_MAX_RENDERBUFFER_SIZE. NOTE: this is a candidate for the 7.11 branch Signed-off-by: Yuanhan Liu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Round the argument to PixelStoref instead of truncating.Eric Anholt2011-10-201-0/+8
| | | | | | | | | | | | | | | From the GL 2.1 specification, page 114 (page 128 of the PDF): "The version of PixelStore that takes a floating-point value may be used to set any type of parameter; if the parameter is boolean, then it is set to FALSE if the passed value is 0.0 and TRUE otherwise, while if the parameter is an integer, then the passed value is rounded to the nearest integer." Fixes piglit roundmode-pixelstore. Note: This is a candidate for the 7.11 branch. Reviewed-by: Brian Paul <[email protected]>
* mesa: Only allow queries of window system FBO on desktop GL w/ARB_fboIan Romanick2011-10-111-0/+15
| | | | | | | | | Neither OES_framebuffer_object nor EXT_framebuffer_object allow querying the window system FBO. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Accept GL_DEPTH and GL_STENCIL for window system FBO onlyIan Romanick2011-10-111-12/+27
| | | | | | | | | | Previously GL_DEPTH_BUFFER and GL_STENCIL_BUFFER were (incorrectly) allowed for both. Those enums don't even really exist! Now GL_DEPTH and GL_STENCIL are only allowed for the window system FBO. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: update fbo format tablet for integer types.Dave Airlie2011-10-051-1/+61
| | | | | | This updates the fbo format table for the integer types. Signed-off-by: Dave Airlie <[email protected]>
* mesa/es: Allow other color attachments in OpenGL ES 2.0Ian Romanick2011-10-041-1/+5
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/es: Validate FBO target enum in Mesa code rather than the ES wrapperIan Romanick2011-10-041-2/+4
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/es: Validate FBO attachment enum in Mesa code rather than the ES wrapperIan Romanick2011-10-041-1/+6
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: s/INLINE/inline/Brian Paul2011-10-011-3/+3
| | | | | | | INLINE is still seen in some files (some generated files, etc) but this is a good start. Acked-by: Kenneth Graunke <[email protected]>
* mesa: Remove all mention of MESA_FORMAT_CI8Ian Romanick2011-08-291-1/+1
| | | | | | | | | | | Nothing in Mesa supports color-index textures, and most of the other infrastructure that could allow such support has already been removed. This puts the final nail in the coffin. Also clean out some GL_COLOR_INDEX comments in formats.c. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: handle array textures in GenerateMipmap(), FramebufferTexture1/2D()Brian Paul2011-08-191-3/+21
| | | | | | | | | This was an unfinished to-do item before. With this patch and the two preceeding patches, piglit's fbo-generatemipmap-array test runs and passes instead of generating a GL error and dying on an assertion. Reviewed-by: Ian Romanick <[email protected]>
* mesa: restructure error checking in _mesa_FramebufferTexture1D/2DEXT()Brian Paul2011-08-191-11/+45
| | | | | | In anticipation of adding more texture targets. Reviewed-by: Ian Romanick <[email protected]>
* mesa: fix incorrect error code in _mesa_FramebufferTexture1D/3DEXT()Brian Paul2011-08-181-2/+2
| | | | | The spec says GL_INVALID_OPERATION is generated when texture!=0 and textarget is not a legal value. We had this right for the 2D function.
* mesa: GLES2 should return different error enums for invalid fbo queriesMarek Olšák2011-07-211-7/+16
| | | | | | | | | | | | | | ES 2.0.25 page 127 says: If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then querying any other pname will generate INVALID_ENUM. See also: b9e9df78a03edb35472c2e231aef4747e09db792 NOTE: This is a candidate for the 7.10 and 7.11 branches. Reviewed-by: Ian Romanick <[email protected]>
* mesa: return early if mask is cleared to zero in BlitFramebufferMarek Olšák2011-07-101-0/+4
| | | | | | | From ARB_framebuffer_object: If a buffer is specified in <mask> and does not exist in both the read and draw framebuffers, the corresponding bit is silently ignored.
* mesa: initial ARB_depth_buffer_float supportMarek Olšák2011-07-101-0/+19
| | | | | | | Using GL_NONE as DataType of Z32_FLOAT_X24S8, not sure what I should put there. The spec says the type is n/a. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix render-to-texture regression.Eric Anholt2011-06-181-2/+2
| | | | | Accidentally introduced in fc8c4a3a7b92a1134cd3a9312063abba9e14b0fe. Fixes fbo-drawbuffers-maxtargets and friends.
* mesa: use helper functions to distinguish between user/winsys FBOsBrian Paul2011-06-161-18/+42
| | | | And replace IS_CUBE_FACE() macro w/ inline function.
* mesa: Ignore blits to/from missing buffersIan Romanick2011-06-071-8/+37
| | | | | | | | | | | | | | | | | | | | | The EXT_framebuffer_object spec (and later specs) say: "If a buffer is specified in <mask> and does not exist in both the read and draw framebuffers, the corresponding bit is silently ignored." Check for color, depth, and stencil that the source and destination FBOs have the specified buffers. If the buffer is missing, remove the bit from the blit request mask and continue. Fixes the crash in piglit test 'fbo-missing-attachment-blit from', and fixes 'fbo-missing-attachment-blit es2 from'. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37739 Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> NOTE: This is a candidate for the stable branches.
* mesa: queries of non-existent FBO attachments should return INVALID_OPERATIONMarek Olšák2011-06-011-1/+26
| | | | | | | | | | | OpenGL 4.0 Compatibility, page 449: If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, no framebuffer is bound to target. In this case querying pname FRAMEBUFFER_- ATTACHMENT_OBJECT_NAME will return zero, and all other queries will generate an INVALID_OPERATION error. Reviewed-by: Chad Versace <[email protected]>
* mesa: Allow NULL read/draw in complete FBOs in ARB_ES2_compatibility.Eric Anholt2011-05-261-1/+1
| | | | | | | | | | | | | | From the ARB_ES2_compatibility spec: "(8) How should we handle draw buffer completeness? RESOLVED: Remove draw/readbuffer completeness checks, and treat drawbuffers referring to missing attachments as if they were NONE." Fixes arb_es2_compatibility-drawbuffers when the short-circuit for ARB_ES2_compatibility in the previous commit is dropped. Reviewed-by: Brian Paul <[email protected]>
* mesa: make RGB9_E5 non-renderable on swrast againMarek Olšák2011-05-171-6/+4
| | | | _BaseFormat for RGB9_E5 is GL_RGBA due to the previous revert.
* mesa: implement EXT_packed_floatMarek Olšák2011-04-291-0/+2
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: implement EXT_texture_shared_exponentMarek Olšák2011-04-291-0/+11
| | | | | | | | | swrast support done. There is no renderbuffer support in swrast, because it's not required by the extension. Reviewed-by: Brian Paul <[email protected]>
* mesa: finish up ARB_texture_floatMarek Olšák2011-04-151-1/+31
| | | | | | | | | | | | | | | Squashed commit of the following: Author: Marek Olšák <[email protected]> mesa: handle floating-point formats in _mesa_base_fbo_format mesa: add ARB/ATI_texture_float, remove MESAX_texture_float commit 123bb110852739dffadcc81ad80b005b1c4f586d Author: Luca Barbieri <[email protected]> Date: Wed Aug 25 01:35:42 2010 +0200 mesa: compute floatMode for FBOs and return it on RGBA_FLOAT_MODE
* mesa: Guard against null pointer deref in fbo validationFabian Bieler2011-04-051-1/+1
| | | | | | | | This matches the behaviour below when numSamples is compared. At least with the gallium state tracker this can actually occur if st_render_texture fails. Signed-off-by: Brian Paul <[email protected]>
* mesa: added _mesa_get_attachment_teximage() helpersBrian Paul2011-04-051-6/+4
|
* mesa: initial EXT_texture_snorm supportMarek Olšák2011-03-291-1/+37
| | | | | The component ordering of some formats has been been reversed to match Gallium types.
* mesa: Add missing parentheses in glBlitFramebufferEXT error strings.Vinson Lee2011-03-281-5/+5
|
* mesa: return after invalidating renderbufferMarek Olšák2011-03-071-0/+1
|
* mesa: invalidate framebuffer if internal format of renderbuffer is changedMarek Olšák2011-03-071-6/+29
| | | | RenderTexture doesn't have to be called in invalidate_rb, I guess.
* mesa: consolidate framebuffer target lookup codeBrian Paul2011-02-281-89/+33
|
* mesa: s/mesaFormat/attFormat/Brian Paul2011-02-281-4/+4
|
* mesa: MESA_VERBOSE logging for glRead/Draw/CopyPixels, glBlitFramebufferBrian Paul2011-02-181-0/+7
|
* mesa/965: add support for GL_EXT_framebuffer_sRGB (v2)Dave Airlie2011-02-051-1/+1
| | | | | | | | | | | | This adds i965 support for GL_EXT_framebuffer_sRGB, it introduces a new constant to say that the driver can support sRGB enabled FBOs since enabling the extension doesn't mean the driver can actually support sRGB. Also adds the suggested state flush in the core code suggested by Brian. fix the ARB_fbo color encoding. Signed-off-by: Dave Airlie <[email protected]>