summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
Commit message (Collapse)AuthorAgeFilesLines
* PATCH 03/10] mesa: Complete ARB_framebuffer_no_attachments in Mesa coreKevin Rogovin2015-06-171-29/+182
| | | | | | | | | | Implement GL_ARB_framebuffer_no_attachments in Mesa core - changes to conditions for framebuffer completenss - implement set/get functions for framebuffers for new functions in GL_ARB_framebuffer_no_attachments Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Kevin Rogovin <[email protected]>
* mesa: Constants and functions for ARB_framebuffer_no_attachmentsKevin Rogovin2015-06-171-0/+28
| | | | | | | | Define the enumeration constants, function entry points and glGet for the GL_ARB_framebuffer_no_attachments. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Kevin Rogovin <[email protected]>
* mesa: Define infrastructure for ARB_framebuffer_no_attachmentsKevin Rogovin2015-06-171-0/+1
| | | | | | | | | Define the infrastructure for the extension GL_ARB_framebuffer_no_attachments: - extension table - additions to gl_framebuffer Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Kevin Rogovin <[email protected]>
* mesa: Use the profile instead of an extension bit to validate ↵Ian Romanick2015-05-281-3/+10
| | | | | | | | | | | GL_TEXTURE_CUBE_MAP The extension on which this depends will always be enabled in core profile, and the extension bit is about to be removed. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Fredrik Höglund <[email protected]> Cc: "10.6" <[email protected]>
* Revert "mesa: Add ARB_direct_state_access checks in FBO functions"Ian Romanick2015-05-281-67/+0
| | | | | | | This reverts commit 6ad0b7e07a0445e9e0f368e079c4f7b8a6757bb3. Acked-by: Fredrik Höglund <[email protected]> Cc: "10.6" <[email protected]>
* Revert "mesa: Add ARB_direct_state_access checks in renderbuffer functions"Ian Romanick2015-05-281-21/+0
| | | | | | | This reverts commit cb49940766b581c6656473d89c221653c69fa0f9. Acked-by: Fredrik Höglund <[email protected]> Cc: "10.6" <[email protected]>
* mesa: Check the lookup_framebuffer return value in NamedFramebufferRenderbufferFredrik Höglund2015-05-161-0/+2
| | | | | | | Found by Coverity. Reported-by: Ilia Mirkin <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Add ARB_direct_state_access checks in renderbuffer functionsFredrik Höglund2015-05-141-0/+21
| | | | | Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* mesa: Add ARB_direct_state_access checks in FBO functionsFredrik Höglund2015-05-141-0/+67
| | | | | Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* mesa: Make GL_TEXTURE_CUBE_MAP valid in FramebufferTextureLayerFredrik Höglund2015-05-141-5/+31
| | | | | Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* main: Add stubs for [Get]NamedFramebufferParameteri[v].Laura Ekstrand2015-05-141-0/+32
| | | | | | | | | | | | | | The ARB_direct_state_access specification says (as of 2015.02.05): "Interactions with OpenGL 4.3 or ARB_framebuffer_no_attachments If neither OpenGL 4.3 nor ARB_framebuffer_no_attachments are supported, ignore the support for NamedFramebufferParameteri and GetNamedFramebufferParameteriv." This commit adds stubs for these entry points. Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Add entry points for InvalidateNamedFramebuffer[Sub]Data.Laura Ekstrand2015-05-141-0/+69
| | | | | Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Refactor invalidate_framebuffer_storage.Laura Ekstrand2015-05-141-11/+27
| | | | | Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Complete error conditions for glInvalidate*Framebuffer.Laura Ekstrand2015-05-141-1/+19
| | | | | | | Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Cc: "10.4 10.5" <[email protected]>
* main: Add entry point GetNamedFramebufferAttachmentParameteriv.Laura Ekstrand2015-05-141-41/+83
| | | | | | | | | [Fredrik: - Update one of the error messages to reflect that the framebuffer might not be the bound framebuffer. - Whitespace fixes.] Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Add entry point for CheckNamedFramebufferStatus.Laura Ekstrand2015-05-141-15/+64
| | | | | | | | [Fredrik: - Retain the debugging code in CheckFramebufferStatus. - Whitespace fixes.] Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Fix indents in former get_texture_for_framebuffer functions.Laura Ekstrand2015-05-141-39/+39
| | | | | Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Major refactor of get_texture_for_framebuffer.Laura Ekstrand2015-05-141-225/+265
| | | | | | | | | | | | | | | | | | | | | This splits off the (still) rather large chunk that is get_texture_for_framebuffer into lots of smaller functions specialized to service the wide variety of unique needs of *FramebufferTexture* entry points. The result is much cleaner because, rather than having a pile of branches and confusing conditions (like the boolean layered), the uniqueness is baked into the entry points. The entry points know whether or not they are layered or use a textarget. [Fredrik: - Mention the value of <textarget> in the error message. - Rename check_zoffset to check_layer, and zoffset to layer. The zoffset parameter was renamed to layer in ARB_framebuffer_object. - Make layered a GLboolean since the value is visible to the API. - Remove EXT suffixes in refactored code. - Whitespace fixes.] Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Add entry points for glNamedFramebufferTexture[Layer].Laura Ekstrand2015-05-141-0/+64
| | | | | Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Fix indentation in get_texture_for_framebuffer.Laura Ekstrand2015-05-141-85/+85
| | | | | Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Refactor get_texture_for_framebuffer.Laura Ekstrand2015-05-141-22/+21
| | | | | | | | | | | | This moves a few blocks around so that the control flow is more obvious. If the texture is 0, just return true at the beginning of the function. Likewise, if the texObj is NULL, return true at the beginning of the function as well. [Fredrik: Fix the texObj NULL check] Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Split framebuffer_texture.Laura Ekstrand2015-05-141-75/+190
| | | | | | | | | | | | | | | | Split apart utility function framebuffer_texture to better prepare for implementing NamedFramebufferTexture and NamedFramebufferTextureLayer. This should also pave the way for some future cleanup work. [Fredrik: - Mention which limit was exceeded when <layer> is out of range. - Update a comment to reflect that <fb> might not be the bound framebuffer. - Make it clear that the error message in glFramebufferTexture*D refers to the <textarget> parameter. - Remove EXT suffixes.] Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Fix an error generated by FramebufferTextureLaura Ekstrand2015-05-141-4/+13
| | | | | | | | | | | | gl*FramebufferTexture should generate GL_INVALID_VALUE when the texture doesn't exist. [Fredrik: Split this change out from the next commit] Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Cc: "10.4 10.5" <[email protected]>
* mesa: Generate GL_INVALID_VALUE in framebuffer_texture when layer < 0Fredrik Höglund2015-05-141-0/+12
| | | | | | Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Cc: "10.4 10.5" <[email protected]>
* main: Require that the texture exists in framebuffer_textureFredrik Höglund2015-05-141-1/+1
| | | | | | | | Generate GL_INVALID_OPERATION if the texture hasn't been created. Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Cc: "10.4 10.5" <[email protected]>
* main: Fix the indentation in framebuffer_textureLaura Ekstrand2015-05-141-1/+2
| | | | | Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Add entry point for NamedFramebufferRenderbuffer.Laura Ekstrand2015-05-141-44/+85
| | | | | | | | | | | | [Fredrik: - Remove the DummyRenderbuffer checks now that they are done in _mesa_lookup_renderbuffer_err. - Fix the <renderbuffertarget> name in error messages. - Make the error message in _mesa_framebuffer_renderbuffer reflect that <fb> might not be the bound framebuffer. - Remove EXT suffixes from GL tokens.] Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Rename framebuffer renderbuffer software fallback.Laura Ekstrand2015-05-141-3/+4
| | | | | | | | | Rename _mesa_framebuffer_renderbuffer to _mesa_FramebufferRenderbuffer_sw in preparation for adding the ARB_direct_state_access backend function for FramebufferRenderbuffer and NamedFramebufferRenderbuffer to share. Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Add utility function _mesa_lookup_renderbuffer_err.Laura Ekstrand2015-05-141-0/+21
| | | | | | | [Fredrik: Generate an error for non-existent renderbuffers] Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Add glCreateFramebuffers.Laura Ekstrand2015-05-141-5/+37
| | | | | | | [Fredrik: Whitespace fixes] Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Add utility function _mesa_lookup_framebuffer_err.Laura Ekstrand2015-05-141-0/+21
| | | | | | | | [Fredrik: Generate an error for non-existent framebuffers] Reviewed-by: Fredrik Höglund <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* mesa: finish implementing ARB_texture_stencil8 (v5)Dave Airlie2015-04-231-3/+6
| | | | | | | | | | | | | | Parts of this were implemented previously, so finish it off. v2: fix getteximage falling into the integer check add fixes for the FBO paths, (fbo-stencil8 test). v3: fix getteximage path harder. v4: remove swapbytes from getteximage path (Ilia) v5: brown paper bag the swapbytes removal. (Ilia) Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/fbo: lock ctx->Shared->Mutex when allocating renderbuffersMartin Peres2015-04-011-0/+2
| | | | | | | | | | | | | | | | This mutex is used to make sure the shared context does not change while some shared code is looking into it. Calling BindRenderbufferEXT BindRenderbuffer with a gles context would not take the mutex before allocating an entry. Commit a34669b then moved out the allocation out of bind_renderbuffer into allocate_renderbuffer before using it for the CreateRenderBuffer entry point. This thus also made this entry point unsafe. The issue has been hinted by Ilia Mirkin. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* mesa/fbo: do not assign a value that is never read later onMartin Peres2015-04-011-6/+3
| | | | | | | | | | | | | The issue has been detected by coverty. v2: - move the declaration of obj to the else clause (Brian Paul) v3: Review by Brian Paul - get rid of the obj declaration in favor of a direct reference Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* main: Added entry points for NamedRenderbufferStorage/MultisampleMartin Peres2015-03-251-41/+116
| | | | | | | | | | | | | | | | | | | | | v2: Review from Laura Ekstrand - get rid of a change that should not have happened in this patch - improve the error messages - fix alignments - fix a capitalization in a function name in an error message v3: Review from Laura Ekstrand - move the test for the validity of the renderbuffer to less generic functions - get rid of some changes that accidentally landed in the wrong commit - revert some alignment fixes v3: Review from Laura Ekstrand - check that the lookup returns a valid renderbuffer - cosmetic changes to some error messages Reviewed-by: Laura Ekstrand <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* main: Added entry point for glGetNamedRenderbufferParameterivMartin Peres2015-03-251-18/+45
| | | | | | | | | | | | | | | | v2: - improve an error message v3: - move a test to less generic functions - fix an alignment v4: - take the caller as a parameter instead of bool dsa - check that the lookup returns a valid renderbuffer Reviewed-by: Laura Ekstrand <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* main: Added entry point for glCreateRenderbuffersMartin Peres2015-03-251-18/+54
| | | | | | | | v2: - refactor bindRenderBuffer and create_render_buffers to fix an assertion Reviewed-by: Laura Ekstrand <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* main: replace tabs by 8 spaces in fbobject.cMartin Peres2015-03-251-83/+83
| | | | | Reviewed-by: Laura Ekstrand <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-231-19/+19
| | | | Acked-by: Eric Anholt <[email protected]>
* mesa: fix OES_texture_float texture render target behaviorTapani Pälli2015-02-131-0/+12
| | | | | | | | | | | | | | | | | Current implementation allowed usage of unsized type texture GL_FLOAT and GL_HALF_FLOAT as a render target as this was 'expected behavior' by WEBGL_oes_texture_float and is also allowed by the oes-texture-float WebGL test. However this broke some ES3 conformance tests that do not accept such behavior. Patch sets such an fbo incomplete as expected by the ES3 conformance tests. Textures with sized types like RGBA32F will still continue to work as render targets. v2: code style cleanups (Ian Romanick, Matt Turner) Signed-off-by: Tapani Pälli <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88905 Reviewed-by: Ian Romanick <[email protected]> Cc: "10.5" <[email protected]>
* mesa: Make renderbuffer FBO attachments not layeredJames Legg2015-02-081-0/+1
| | | | | | | | | | | | For framebuffer completeness checks, consider renderbuffers as not layered. Previously, they would have counted as layered if a layered textured had previously been bound to the same attachment point. This could cause framebuffer completeness checks to incorrectly fail with GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS, even if no layered attachments were present. Reviewed-by: Chris Forbes <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89026
* mesa: fix error value in GetFramebufferAttachmentParameteriv for OpenGL ES 3.0Samuel Iglesias Gonsalvez2015-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Section 6.1.13 "Framebuffer Object Queries" of OpenGL ES 3.0 spec: "If the default framebuffer is bound to target, then attachment must be BACK, identifying the color buffer; DEPTH, identifying the depth buffer; or STENCIL, identifying the stencil buffer." OpenGL ES 3.0, section 2.5 (GL Errors): "If a command that requires an enumerated value is passed a symbolic constant that is not one of those specified as allowable for that command, an INVALID_ENUM error is generated." Then change the returned error to INVALID_ENUM. Fixes: dEQP-GLES3.functional.fbo.api.attachment_query_default_fbo Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix some signed-unsigned comparison warningsJan Vesely2015-01-211-5/+4
| | | | | | | | v2: s/unsigned int/unsigned/ in prog_optimize.c Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Enable GL_RGB/GL_RGBA in GLES3 glGetInternalformativMike Mason2015-01-131-6/+0
| | | | | | | | | | | Removes commit 7894278 changes and moves fix to _mesa_GetInternalformativ(). The original commit enabled the GL_RGB and GL_RGBA unsized internal formats as valid for render buffers in GLES3, but this is incorrect. They should have only been enabled for GetInternalformativ() Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88079 Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: Fix error reporting for some cases of incomplete FBO attachmentsIago Toral Quiroga2015-01-131-1/+1
| | | | | | | | | | | | | | | | According to the OpenGL and OpenGL ES specs (sections "FRAMEBUFFER COMPLETENESS" and "Whole Framebuffer Completeness"), the image for color, depth or stencil attachments must be renderable, otherwise the attachment is considered incomplete and we should report GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT. Currently, we detect this situation properly but report a different error. This fixes the following 3 piglit tests: dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.rgb_unsigned_int_2_10_10_10_rev dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.rgba_unsigned_int_2_10_10_10_rev dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.rgb16f Reviewed-by: Ian Romanick <[email protected]>
* mesa: Returns a GL_INVALID_VALUE error if num of fbos in ↵Eduardo Lima Mitev2015-01-131-0/+5
| | | | | | | | | | | | | glDeleteRenderbuffers is negative Per GLES3 manual for glDeleteRenderbuffers <https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteRenderbuffers.xhtml>, GL_INVALID_VALUE is generated if n is negative. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.buffer.delete_renderbuffers Reviewed-by: Ian Romanick <[email protected]>
* mesa: Returns a GL_INVALID_VALUE error if num of fbos in ↵Eduardo Lima Mitev2015-01-131-0/+5
| | | | | | | | | | | | | glDeleteFramebuffers is negative Per GLES3 manual for glDeleteFramebuffers <https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteFramebuffers.xhtml>, GL_INVALID_VALUE is generated if n is negative. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.buffer.delete_framebuffers Reviewed-by: Ian Romanick <[email protected]>
* main: fix return GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL valueSamuel Iglesias Gonsalvez2015-01-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Return the proper value for two-dimensional array texture and three-dimensional textures. From OpenGL ES 3.0 spec, chapter 6.1.13 "Framebuffer Object Queries", page 234: "If pname is FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER and the texture object named FRAMEBUFFER_ATTACHMENT_OBJECT_NAME is a layer of a three-dimensional texture or a two-dimensional array texture, then params will contain the number of the texture layer which contains the attached im- age. Otherwise params will contain the value zero." Furthermore, FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER is an alias of FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT. This patch fixes dEQP test: dEQP-GLES3.functional.state_query.fbo.framebuffer_attachment_texture_layer Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Depth and stencil attachments must be the same in OpenGL ES3Iago Toral Quiroga2015-01-131-0/+20
| | | | | | | | | | | | | "9.4. FRAMEBUFFER COMPLETENESS ... Depth and stencil attachments, if present, are the same image." Notice that this restriction is not included in the OpenGL ES2 spec. Fixes 18 dEQP tests in: dEQP-GLES3.functional.fbo.completeness.attachment_combinations.* Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove unused ctx parameter for _mesa_select_tex_image()Brian Paul2015-01-051-1/+1
| | | | Reviewed-by: Eric Anholt <[email protected]>