summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* mesa: Enables GL_RGB and GL_RGBA unsized internal formats for OpenGL ES 3.0Eduardo Lima Mitev2014-12-091-0/+6
| | | | | | | | | | | | GL_RGB and GL_RGBA are valid internal formats on a GLES3 profile. See "Table 1. Unsized Internal Formats" at https://www.khronos.org/opengles/sdk/docs/man3/html/glTexImage2D.xhtml. Fixes 2 dEQP tests: - dEQP-GLES3.functional.state_query.internal_format.rgb_samples - dEQP-GLES3.functional.state_query.internal_format.rgba_samples Reviewed-by: Brian Paul <[email protected]>
* mesa: Considers GL_DEPTH_STENCIL_ATTACHMENT a valid argument for FBO ↵Eduardo Lima Mitev2014-12-091-0/+8
| | | | | | | | | | | | invalidation under GLES3 In OpenGL and OpenGL-ES 3+, GL_DEPTH_STENCIL_ATTACHMENT is a valid attachment point for the family of functions that invalidate a framebuffer object (e.g, glInvalidateFramebuffer, glInvalidateSubFramebuffer, etc). Currently, a GL_INVALID_ENUM error is emitted for this attachment point. Fixes 21 dEQP test failures under 'dEQP-GLES3.functional.fbo.invalidate.*'. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add a source parameter to _mesa_gl_debug.Matt Turner2014-12-051-0/+1
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove EXT suffix from FBO error messagesBrian Paul2014-09-241-30/+30
| | | | | | And use pass caller="" for _mesa_FramebufferTexture(). Reviewed-by: Matt Turner <[email protected]>
* mesa: Fix unbinding GL_DEPTH_STENCIL_ATTACHMENTJames Legg2014-05-231-0/+6
| | | | | | | | | glFramebufferRender(..., GL_DEPTH_STENCIL_ATTACHMENT, ..., 0) only detached the depth buffer and not the stencil buffer. Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=79115 Reviewed-by: Brian Paul <[email protected]> Cc: "10.1 10.2" <[email protected]>
* mesa: Fix MaxNumLayers for 1D array textures.Kenneth Graunke2014-05-071-0/+2
| | | | | | | | | | 1D array targets store the number of slices in the Height field. Cc: "10.2 10.1 10.0" <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: move declaration before codeBrian Paul2014-04-211-1/+1
| | | | To fix MSVC build.
* mesa: Add an error condition in glGetFramebufferAttachmentParameteriv()Anuj Phogat2014-04-211-0/+13
| | | | | | | | | | | | | | | | | | | | | | From the OpenGL 4.4 spec page 275: "If pname is FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, param will contain the format of components of the specified attachment, one of FLOAT, INT, UNSIGNED_INT, SIGNED_NORMALIZED, or UNSIGNED_NORMALIZED for floating-point, signed integer, unsigned integer, signed normalized fixedpoint, or unsigned normalized fixed-point components respectively. If no data storage or texture image has been specified for the attachment, param will contain NONE. This query cannot be performed for a combined depth+stencil attachment, since it does not have a single format." Fixes Khronos CTS test: packed_depth_stencil_parameters.test Khronos Bug# 9170 Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: fix check for dummy renderbuffer in _mesa_FramebufferRenderbufferEXT()Samuel Iglesias Gonsalvez2014-04-161-2/+1
| | | | | | | | | | | | | | | | | | | | According to the spec: <renderbuffertarget> must be RENDERBUFFER and <renderbuffer> should be set to the name of the renderbuffer object to be attached to the framebuffer. <renderbuffer> must be either zero or the name of an existing renderbuffer object of type <renderbuffertarget>, otherwise an INVALID_OPERATION error is generated. This patch changes the previous returned GL_INVALID_VALUE to GL_INVALID_OPERATION. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76894 Cc: [email protected] Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]>
* mesa: fix indentation, formatting, etc in fbobject.cBrian Paul2014-03-261-38/+56
|
* mesa: Stop skipping the FinishRenderTexture calls for winsys FBOs.Eric Anholt2014-03-241-2/+3
| | | | | | | | | | Now that BindRenderbufferTexImage() is a thing that drivers can do, winsys FBOs *can* have NeedsFinishRenderTexture set. v2: Keep the short-circuit for non-BindRenderbufferTexImage() drivers (review by Ken). Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Generate FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT earlierChris Forbes2014-03-251-6/+6
| | | | | | | | | | | | | | The ARB_framebuffer_object spec lists this case before the FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER and FRAMEBUFFER_INCOMPLETE_READ_BUFFER cases. Fixes two broken cases in piglit's fbo-incomplete test, if ARB_ES2_compatibility is not advertised. (If it is, this is masked because the FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER / FRAMEBUFFER_INCOMPLETE_READ_BUFFER cases are removed by that extension) Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: mark GL_RGB9_E5 as not color-renderableMarek Olšák2014-03-151-4/+0
| | | | | | | | | | | | The GL 4.4 spec says it's not color-renderable and not accepted by RenderBufferStorage. The EXT_texture_shared_exponent spec says it's not color-renderable but it's accepted by RenderBufferStorageEXT. This seems to be a bug in the extension spec. Let's do what GL 4.4 says. Cc: [email protected] Reviewed-by: Ian Romanick <[email protected]>
* mesa: switch to c11 mutex functionsBrian Paul2014-03-031-11/+11
| | | | Reviewed-by: José Fonseca <[email protected]>
* mesa: make several FBO functions staticBrian Paul2014-02-021-35/+35
| | | | | | The four functions in question weren't called from any other file. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: move glGenerateMipmap() code into new genmipmap.c fileBrian Paul2014-02-021-92/+0
| | | | | | | Mipmap generation has nothing to do with FBOs. v2: update gl_genexec.py too (not api_exec.c) Acked-by: Kenneth Graunke <[email protected]>
* mesa: move glBlitFramebuffer code into new blit.c fileBrian Paul2014-02-021-473/+0
| | | | | | | Just for better organization. v2: update gl_genexec.py too (not api_exec.c) Acked-by: Kenneth Graunke <[email protected]>
* mesa: add some comments about mipmap generationBrian Paul2014-02-021-0/+5
| | | | Trivial.
* mesa: Change many Type P MESA_FORMATs to meet naming specMark Mueller2014-01-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conversion of Type P formats as follows (w/related comment fixes): s/MESA_FORMAT_RGB565\b/MESA_FORMAT_B5G6R5_UNORM/g s/MESA_FORMAT_RGB565_REV\b/MESA_FORMAT_R5G6B5_UNORM/g s/MESA_FORMAT_ARGB4444\b/MESA_FORMAT_B4G4R4A4_UNORM/g s/MESA_FORMAT_ARGB4444_REV\b/MESA_FORMAT_A4R4G4B4_UNORM/g s/MESA_FORMAT_RGBA5551\b/MESA_FORMAT_A1B5G5R5_UNORM/g s/MESA_FORMAT_XBGR8888_SNORM\b/MESA_FORMAT_R8G8B8X8_SNORM/g s/MESA_FORMAT_XBGR8888_SRGB\b/MESA_FORMAT_R8G8B8X8_SRGB/g s/MESA_FORMAT_ARGB1555\b/MESA_FORMAT_B5G5R5A1_UNORM/g s/MESA_FORMAT_ARGB1555_REV\b/MESA_FORMAT_A1R5G5B5_UNORM/g s/MESA_FORMAT_AL44\b/MESA_FORMAT_L4A4_UNORM/g s/MESA_FORMAT_RGB332\b/MESA_FORMAT_B2G3R3_UNORM/g s/MESA_FORMAT_ARGB2101010\b/MESA_FORMAT_B10G10R10A2_UNORM/g s/MESA_FORMAT_Z24_S8\b/MESA_FORMAT_S8_UINT_Z24_UNORM/g s/MESA_FORMAT_S8_Z24\b/MESA_FORMAT_Z24_UNORM_S8_UINT/g s/MESA_FORMAT_X8_Z24\b/MESA_FORMAT_Z24_UNORM_X8_UINT/g s/MESA_FORMAT_Z24_X8\b/MESA_FORMAT_X8Z24_UNORM/g s/MESA_FORMAT_RGB9_E5_FLOAT\b/MESA_FORMAT_R9G9B9E5_FLOAT/g s/MESA_FORMAT_R11_G11_B10_FLOAT\b/MESA_FORMAT_R11G11B10_FLOAT/g s/MESA_FORMAT_Z32_FLOAT_X24S8\b/MESA_FORMAT_Z32_FLOAT_S8X24_UINT/g s/MESA_FORMAT_ABGR2101010_UINT\b/MESA_FORMAT_R10G10B10A2_UINT/g s/MESA_FORMAT_XRGB4444_UNORM\b/MESA_FORMAT_B4G4R4X4_UNORM/g s/MESA_FORMAT_XRGB1555_UNORM\b/MESA_FORMAT_B5G5R5X1_UNORM/g s/MESA_FORMAT_XRGB2101010_UNORM\b/MESA_FORMAT_B10G10R10X2_UNORM/g s/MESA_FORMAT_AL88\b/MESA_FORMAT_L8A8_UNORM/g s/MESA_FORMAT_AL88_REV\b/MESA_FORMAT_A8L8_UNORM/g s/MESA_FORMAT_AL1616\b/MESA_FORMAT_L16A16_UNORM/g s/MESA_FORMAT_AL1616_REV\b/MESA_FORMAT_A16L16_UNORM/g s/MESA_FORMAT_RG88\b/MESA_FORMAT_G8R8_UNORM/g s/MESA_FORMAT_GR88\b/MESA_FORMAT_R8G8_UNORM/g s/MESA_FORMAT_GR1616\b/MESA_FORMAT_R16G16_UNORM/g s/MESA_FORMAT_RG1616\b/MESA_FORMAT_G16R16_UNORM/g s/MESA_FORMAT_SRGBA8\b/MESA_FORMAT_A8B8G8R8_SRGB/g s/MESA_FORMAT_SARGB8\b/MESA_FORMAT_B8G8R8A8_SRGB/g s/MESA_FORMAT_SLA8\b/MESA_FORMAT_L8A8_SRGB/g Conflicts: src/mesa/drivers/dri/i965/brw_surface_formats.c src/mesa/main/format_pack.c src/mesa/main/format_unpack.c src/mesa/main/formats.c src/mesa/main/texformat.c src/mesa/main/texstore.c
* mesa: Change many Type A MESA_FORMATs to meet naming standardMark Mueller2014-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update comments. Conversion of the following Type A formats: s/MESA_FORMAT_RGB888\b/MESA_FORMAT_BGR_UNORM8/g s/MESA_FORMAT_BGR888\b/MESA_FORMAT_RGB_UNORM8/g s/MESA_FORMAT_A8\b/MESA_FORMAT_A_UNORM8/g s/MESA_FORMAT_A16\b/MESA_FORMAT_A_UNORM16/g s/MESA_FORMAT_L8\b/MESA_FORMAT_L_UNORM8/g s/MESA_FORMAT_L16\b/MESA_FORMAT_L_UNORM16/g s/MESA_FORMAT_I8\b/MESA_FORMAT_I_UNORM8/g s/MESA_FORMAT_I16\b/MESA_FORMAT_I_UNORM16/g s/MESA_FORMAT_R8\b/MESA_FORMAT_R_UNORM8/g s/MESA_FORMAT_R16\b/MESA_FORMAT_R_UNORM16/g s/MESA_FORMAT_Z16\b/MESA_FORMAT_Z_UNORM16/g s/MESA_FORMAT_Z32\b/MESA_FORMAT_Z_UNORM32/g s/MESA_FORMAT_S8\b/MESA_FORMAT_S_UINT8/g s/MESA_FORMAT_SRGB8\b/MESA_FORMAT_BGR_SRGB8/g s/MESA_FORMAT_RGBA_16\b/MESA_FORMAT_RGBA_UNORM16/g s/MESA_FORMAT_SL8\b/MESA_FORMAT_L_SRGB8/g s/MESA_FORMAT_Z32_FLOAT\b/MESA_FORMAT_Z_FLOAT32/g s/MESA_FORMAT_XBGR16161616_UNORM\b/MESA_FORMAT_RGBX_UNORM16/g s/MESA_FORMAT_XBGR16161616_SNORM\b/MESA_FORMAT_RGBX_SNORM16/g s/MESA_FORMAT_XBGR16161616_FLOAT\b/MESA_FORMAT_RGBX_FLOAT16/g s/MESA_FORMAT_XBGR16161616_UINT\b/MESA_FORMAT_RGBX_UINT16/g s/MESA_FORMAT_XBGR16161616_SINT\b/MESA_FORMAT_RGBX_SINT16/g s/MESA_FORMAT_XBGR32323232_FLOAT\b/MESA_FORMAT_RGBX_FLOAT32/g s/MESA_FORMAT_XBGR32323232_UINT\b/MESA_FORMAT_RGBX_UINT32/g s/MESA_FORMAT_XBGR32323232_SINT\b/MESA_FORMAT_RGBX_SINT32/g s/MESA_FORMAT_XBGR8888_UINT\b/MESA_FORMAT_RGBX_UINT8/g s/MESA_FORMAT_XBGR8888_SINT\b/MESA_FORMAT_RGBX_SINT8/g
* mesa: change gl_format to mesa_formatMark Mueller2014-01-271-5/+5
| | | | s/\bgl_format\b/mesa_format/g. Use better name for Mesa Formats enum
* mesa: Clean up bad code formatting left from previous commitIan Romanick2014-01-271-13/+10
| | | | | | | Also s/_EXT// on enums that are now part of core. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: GL_EXT_framebuffer_blit is not optionalIan Romanick2014-01-271-31/+3
| | | | | | | | | Every driver supports it. All current and future Gallium drivers always support it, and all existing classic drivers support it. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: initialize "is_layered" variable to silence warningBrian Paul2014-01-231-1/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* i965: Fix clears of layered framebuffers with mismatched layer counts.Paul Berry2014-01-101-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, Mesa enforced the following rule (from ARB_geometry_shader4's list of criteria for framebuffer completeness): * If any framebuffer attachment is layered, all attachments must have the same layer count. For three-dimensional textures, the layer count is the depth of the attached volume. For cube map textures, the layer count is always six. For one- and two-dimensional array textures, the layer count is simply the number of layers in the array texture. { FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB } However, when ARB_geometry_shader4 was adopted into GL 3.2, this rule was dropped; GL 3.2 permits different attachments to have different layer counts. This patch brings Mesa in line with GL 3.2. In order to ensure that layered clears properly clear all layers, we now have to keep track of the maximum number of layers in a layered framebuffer. Fixes the following piglit tests in spec/!OpenGL 3.2/layered-rendering: - clear-color-all-types 1d_array mipmapped - clear-color-all-types 1d_array single_level - clear-color-mismatched-layer-count - framebuffer-layer-count-mismatch Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* main: check texture target when validating layered framebuffers.Paul Berry2014-01-101-3/+9
| | | | | | | | | | | | | | From section 4.4.4 (Framebuffer Completeness) of the GL 3.2 spec: If any framebuffer attachment is layered, all populated attachments must be layered. Additionally, all populated color attachments must be from textures of the same target. We weren't checking that the attachments were from textures of the same target. Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* mesa: add missing SNORM formats in _mesa_base_fbo_format()Brian Paul2014-01-091-0/+16
| | | | | | | | | | | | We weren't handling the LUMINANCE_SNORM, LUMINANCE_ALPHA_SNORM and INTENSITY_SNORM cases. Note that adding these cases here does not require a driver to support rendering to these surface types. If the driver can't do it we'll report an incomplete framebuffer. NVIDIA doesn't support GL_EXT_texture_snorm but their driver accepts these formats in glRenderBufferStorage(). Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Clean up bad code formatting left from previous commitIan Romanick2013-12-201-11/+9
| | | | | | | Also s/_EXT// on enums that are now part of core. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: GL_EXT_packed_depth_stencil is not optionalIan Romanick2013-12-201-13/+6
| | | | | | | | Every driver supports it. All current and future Gallium drivers always support it, and all existing classic drivers support it. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: initialize gl_renderbuffer::Depth in coreMarek Olšák2013-11-231-0/+1
| | | | | Reviewed-by: Ian Romanick <[email protected]> Tested-by: Ian Romanick <[email protected]>
* mesa: Implement GL_FRAMEBUFFER_ATTACHMENT_LAYERED query.Paul Berry2013-11-211-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | From section 6.1.18 (Renderbuffer Object Queries) of the GL 3.2 spec, under the heading "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is TEXTURE, then": If pname is FRAMEBUFFER_ATTACHMENT_LAYERED, then params will contain TRUE if an entire level of a three-dimesional texture, cube map texture, or one-or two-dimensional array texture is attached. Otherwise, params will contain FALSE. Fixes piglit tests: - spec/!OpenGL 3.2/layered-rendering/framebuffer-layered-attachments - spec/!OpenGL 3.2/layered-rendering/framebuffertexture-defaults Cc: "10.0" <[email protected]> Reviewed-by: Chris Forbes <[email protected]> v2: Don't include "EXT" in the error message, since this query only makes sensen in context versions that have adopted glGetFramebufferAttachmentParameteriv(). Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix texture target validation for glFramebufferTexture()Paul Berry2013-11-211-12/+47
| | | | | | | | | | | | | | | | | | | Previously we were using the code path for validating glFramebufferTextureLayer(). But glFramebufferTexture() allows additional texture types. Fixes piglit tests: - spec/!OpenGL 3.2/layered-rendering/gl-layer-cube-map - spec/!OpenGL 3.2/layered-rendering/framebuffertexture Cc: "10.0" <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Chris Forbes <[email protected]> v2: Clarify comment above framebuffer_texture(). Reviewed-by: Ian Romanick <[email protected]>
* mesa: Track number of layers in layered framebuffers.Paul Berry2013-11-211-2/+11
| | | | | | | | | | | | | | | | | | | | In order to properly clear layered framebuffers, we need to know how many layers they have. The easiest way to do this is to record it in the gl_framebuffer struct when we check framebuffer completeness. This patch replaces the gl_framebuffer::Layered boolean with a gl_framebuffer::NumLayers integer, which is 0 if the framebuffer is not layered, and equal to the number of layers otherwise. v2: Remove gl_framebuffer::Layered and make gl_framebuffer::NumLayers always have a defined value. Fix factor of 6 error in the number of layers in a cube map array. Cc: "10.0" <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add missing switch break in invalidate_framebuffer_storage()Constantin Baranov2013-10-141-0/+1
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70411 Cc: "9.2" <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Use _mesa_detach_renderbuffer when deleting a textureIan Romanick2013-08-131-5/+21
| | | | | | | | | | | | | | | | | | | | The functional change is that now invalidate_framebuffer is called if the texture is actually detached from one of the currently bound FBOs. Previously this was only done for renderbuffers. The remaining changes make the texture delete path look more similar to the renderbuffer delete path. This includes adding relevant spec quotations to justify the behavior. Fixes piglit fbo-incomplete "delete texture of bound FBO" test. v2: Move 'fb->Attachment[i].Texture == att' check from previous patch to this patch... where it was intended to be in the first place. Noticed by Chad. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: "9.2" <[email protected]>
* mesa: Make detach_renderbuffer available outside fbobject.cIan Romanick2013-08-131-9/+32
| | | | | | | | | | | | | | Also add a return value indicating whether any work was done. This will be used by the next patch. v2: Move 'fb->Attachment[i].Texture == att' check to the next patch... where it was intended to be in the first place. Noticed by Chad. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: "9.2" <[email protected]>
* mesa: Generate a renderbuffer wrapper even if the texture has no imageIan Romanick2013-08-061-2/+3
| | | | | | | | | | This prevents a segfault in check_begin_texture_render when an FBO is rebound while in this state. This fixes the piglit test fbo-incomplete-invalid-texture. Signed-off-by: Ian Romanick <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Cc: "9.1 9.2" [email protected]
* mesa: Validate the layer selection of an array texture tooIan Romanick2013-08-061-4/+30
| | | | | | | | | | | | | | Previously only the slice of a 3D texture was validated in the FBO completeness check. This fixes the failure in the 'invalid layer of an array texture' subtest of piglit's fbo-incomplete test. v2: 1D_ARRAY textures have Depth == 1. Instead, compare against Height. v3: Handle CUBE_MAP_ARRAY textures too. Noticed by Marek. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "9.1 9.2" [email protected]
* mesa: Don't call driver RenderTexture for invalid zoffsetIan Romanick2013-08-061-0/+6
| | | | | | | | | | | | | | | This fixes the segfault in the 'invalid slice of 3D texture' and 'invalid layer of an array texture' subtests of piglit's fbo-incomplete test. The 'invalid layer of an array texture' subtest still fails. v2: Fix off-by-one comparison error noticed by Chris Forbes. Also, 1D_ARRAY textures have Depth == 1. Instead, compare against Height. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> [v1] Cc: "9.1 9.2" [email protected]
* mesa: Don't call driver RenderTexture for really broken texturesIan Romanick2013-08-061-2/+20
| | | | | | | | | This fixes the segfault in the '0x0 texture' subtest of piglit's fbo-incomplete test. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "9.1 9.2" [email protected]
* mesa: Remove stray debug printfs in attachment completeness codeIan Romanick2013-08-061-2/+0
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "9.1 9.2" [email protected]
* mesa: Treat glBindFramebuffer and glBindFramebufferEXT more correctlyIan Romanick2013-08-061-8/+19
| | | | | | | | | | | | | | | | | Allow user-generated names for glBindFramebufferEXT on desktop GL. Disallow its use altogether for core profiles. Names bound with glBindFramebuffer in desktop OpenGL are still (incorrectly) shared across the share group instead of being per-context. This gets us a bit closer to being strictly conformant. v2: Disallow glBindFramebufferEXT in 3.1 by not installing it in the dispatch table. Suggested by Jordan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> [v1] Reviewed-by: Jordan Justen <[email protected]> [v1] Cc: [email protected]