summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Ignore SRGB when determining compatible resolve formats.Kenneth Graunke2012-09-201-1/+2
| | | | | | | | | | | | | | | MSAA resolves and other blit-like operations ignore SRGB state anyway, so we should be able to safely allow resolves between compatible SRGB/linear formats like SRGBA8 and RGBA8888. This matches the behavior of the nVidia and AMD binary drivers. Fixes completely black rendering when using multisampling in L4D2. NOTE: This is a candidate for the 9.0 branch. Reviewed-by: Paul Berry <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* mesa: remove FEATURE_EXT_framebuffer_blit define.Oliver McFadden2012-09-151-9/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_OES_EGL_image define.Oliver McFadden2012-09-151-2/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_ARB_shader_objects and related defines.Oliver McFadden2012-09-151-2/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/msaa: Allow X and Y flips in multisampled blits.Paul Berry2012-09-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the GL 4.3 spec, section 18.3.1 "Blitting Pixel Rectangles": If SAMPLE_BUFFERS for either the read framebuffer or draw framebuffer is greater than zero, no copy is performed and an INVALID_OPERATION error is generated if the dimensions of the source and destination rectangles provided to BlitFramebuffer are not identical, or if the formats of the read and draw framebuffers are not identical. It is not clear from the spec whether "dimensions" should mean both sign and magnitude, or just magnitude. Previously, Mesa interpreted "dimensions" as meaning both sign and magnitude, so any multisampled blit that attempted to flip the image in the X and/or Y direction would fail. However, Y flips are likely to be commonplace in OpenGL applications that have been ported from DirectX applications, as a result of the fact that DirectX and OpenGL differ in their orientation of the Y axis. Furthermore, at least one commercial driver (nVidia) permits Y filps, and L4D2 relies on them being permitted. So it seems prudent for Mesa to permit them. This patch changes Mesa to allow both X and Y flips, since there is no language in the spec to indicate that X and Y flips should be treated differently. NOTE: This is a candidate for stable release branches. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa/es: Validate glRenderbufferStorage internalFormat in Mesa code rather ↵Ian Romanick2012-08-291-68/+132
| | | | | | | | | | | | | | than the ES wrapper v2: Add proper core-profile and GLES3 filtering. v3: Allow GL_RGB10_A2UI in GLES3 based on review feedback from Eric Anholt. v4: Arg. Reject unsized RED and RG enums on GLES. More feedback from Eric. Signed-off-by: Ian Romanick <[email protected]>
* mesa/es: Validate glGetRenderbufferParameter pname in Mesa code rather than ↵Ian Romanick2012-08-291-1/+2
| | | | | | | | | the ES wrapper v2: Add proper core-profile and GLES3 filtering. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/es: Validate glGetFramebufferAttachmentParameter pname in Mesa code ↵Ian Romanick2012-08-291-27/+29
| | | | | | | | | | | | rather than the ES wrapper v2: Add proper core-profile, GLES1, and GLES3 filtering. v3: Fix the GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query when the attachment type is GL_NONE on GLES3. Other cleanups. Based on review feedback from Eric Anholt. Signed-off-by: Ian Romanick <[email protected]>
* mesa/es: Validate glGenerateMipmap target in Mesa code rather than the ES ↵Ian Romanick2012-08-291-2/+9
| | | | | | | | | | | | | | | wrapper v2: Add proper core-profile and GLES3 filtering. v3: Fix a typo in GL_TEXTURE_2D_ARRAY checking. v4: Change !_mesa_is_desktop_gl tests to _mesa_is_gles test. The test around GL_TEXTURE_2D_ARRAY got some other changes because that enum is also available with GLES3 (which uses API_OPENGLES2). Based on review feedback from Eric Anholt. Signed-off-by: Ian Romanick <[email protected]>
* mesa/es: Validate glFramebufferTexture2D textarget in Mesa code rather than ↵Ian Romanick2012-08-291-2/+4
| | | | | | | | | | | | | the ES wrapper v2: Add proper core-profile and GLES3 filtering. v3: Change !_mesa_is_desktop_gl tests to _mesa_is_gles test. The test around GL_TEXTURE_2D_ARRAY got some other changes because that enum is also available with GLES3 (which uses API_OPENGLES2). Based on review feedback from Eric Anholt. Signed-off-by: Ian Romanick <[email protected]>
* mesa: raise GL_INVALID_OPERATION in glGenerateMipmap for missing base imageBrian Paul2012-08-161-0/+2
| | | | | | | | | | | | This seems to be expected by the WebGL texture-mips test. The error makes sense, but I haven't found (yet) any OpenGL documentation specifying this error condition. See http://bugs.freedesktop.org/show_bug.cgi?id=44912 Note: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <[email protected]>
* mesa: flush vertices in test_framebuffer_completenessMarek Olšák2012-08-151-0/+3
|
* mesa: Add skeleton implementations of glInvalidate{Sub,}FramebufferIan Romanick2012-08-141-0/+141
| | | | | | | | | | | These are part of GL_ARB_invalidate_subdata and OpenGL ES 3.0. v2: Reject aux buffers in core context, and use _mesa_is_desktop_gl and _mesa_is_gles3. Both suggested by Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Replace VersionMajor/VersionMinor with a Version field.Eric Anholt2012-08-071-4/+4
| | | | | | | | | | | As we get into supporting GL 3.x core, we come across more and more features of the API that depend on the version number as opposed to just the extension list. This will let us more sanely do version checks than "(VersionMajor == 3 && VersionMinor >= 2) || VersionMajor >= 4". v2: Fix a bad <= 30 check. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add support for using API_OPENGL_COREJordan Justen2012-07-301-7/+7
| | | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: move more format helper functions to glformats.cBrian Paul2012-07-241-1/+1
|
* mesa: fix format checking when doing a multisample resolveMarek Olšák2012-07-231-1/+111
| | | | | | v2: make it more bullet-proof Reviewed-by: Brian Paul <[email protected]>
* mesa,st/mesa: implement GL_RGB565 from ARB_ES2_compatibilityMarek Olšák2012-07-131-0/+3
| | | | | | | | | | This was not implemented, because the spec was changed just recently. Everything has been in place already. Gallium has PIPE_FORMAT_B5G6R5_UNORM, while Mesa has MESA_FORMAT_RGB565. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: if AllocStorage doesn't choose a format, report FRAMEBUFFER_UNSUPPORTEDMarek Olšák2012-06-161-1/+10
| | | | | | | | | | | This allows drivers not to do any allocation in AllocStorage if the storage cannot be allocated because of an unsupported internalformat + samples combo. The little ugliness is that AllocStorage is expected to return TRUE in this case. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add DEBUG_INCOMPLETE_TEXTURE, DEBUG_INCOMPLETE_FBO flagsBrian Paul2012-05-111-14/+6
| | | | | | | Instead of having to hack the code to enable these debugging options, set them through the MESA_DEBUG env var. Reviewed-by: Eric Anholt <[email protected]>
* fbo: Only reuse depth/stencil attachments if the parameters match.Paul Berry2012-05-071-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the user attaches a texture to one of the depth/stencil attachment points (GL_STENCIL_ATTACHMENT or GL_DEPTH_ATTACHMENT), we check to see if the same texture is also attached to the other attachment point, and if so, we re-use the existing texture attachment. This is necessary to ensure that if the user later queries what is attached to GL_DEPTH_STENCIL_ATTACHMENT, they will not receive an error. If, however, the user attaches buffers to the two different attachment points using different parameters (e.g. a different miplevel), then we can't re-use the existing texture attachment, because it is pointing to the wrong part of the texture. This might occur as a transitory condition if, for example, if the user attached miplevel zero of a texture to GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT, rendered to it, and then later attempted to attach miplevel one of the same texture to GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT. This patch causes Mesa to check that GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT use the same attachment parameters before attempting to share the texture attachment. On i965 Gen6, fixes piglit tests "texturing/depthstencil-render-miplevels 1024 depth_stencil_shared" and "texturing/depthstencil-render-miplevels 1024 stencil_depth_shared". Reviewed-by: Chad Versace <[email protected]>
* mesa: Fix the cause of piglit test fbo-array failureAnuj Phogat2012-03-121-1/+3
| | | | | | | | | | | | | Handle the special case of glFramebufferTextureLayer() for which we pass teximage = 0 internally in framebuffer_texture(). This patch makes failing piglit test fbo-array, fbo-depth-array to pass. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47126 V4: Removed the duplicated code. Note: This is a candidate for the stable branches. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add more comments about textarget in framebuffer_texture()Brian Paul2012-03-121-2/+10
|
* mesa: Fix valid texture target test in _mesa_GetTexLevelParameteriv()Anuj Phogat2012-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | _mesa_max_texture_levels() is also used to test valid texture target in _mesa_GetTexLevelParameteriv(). GL_TEXTURE_CUBE_MAP is not allowed as texture target in glGetTexLevelParameter(). So, this should throw GL_INVALID_ENUM error. Few other functions which use _mesa_max_texture_levels() like getcompressedteximage_error_check() and getteximage_error_check() also don't accept GL_TEXTURE_CUBE_MAP. Above fix makes piglit fbo-cubemap test to fail. This is because of incorrect texture target passed to _mesa_max_texture_levels() in framebuffer_texture(). Fixing that as well Note: This is a candidate for the stable branches Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Only end render-to-texture at bind time for drawbuffers.Eric Anholt2012-02-171-5/+2
| | | | | If we're only starting for new draw buffers, why would we end for old read buffers along with draw buffers?
* mesa: fix comment typos in fbobject.cBrian Paul2012-02-151-2/+2
|
* mesa: remove ctx->Const.sRGBCapableMarek Olšák2012-01-251-1/+1
| | | | | | | It always had the same value as ctx->Extensions.EXT_framebuffer_sRGB. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* mesa: allow exposing GL3 without EXT_texture_integerMarek Olšák2012-01-251-6/+10
| | | | | | | | | | | Strictly speaking, it's not legal to expose EXT_texture_integer without EXT_gpu_shader4. It might be even dangerous (apps can assume EXT_gpu_shader4 is available without checking for it). The check in compute_version is removed as well, because that's already covered by GLSLVersion >= 130. Reviewed-by: Brian Paul <[email protected]>
* mesa: add missing integer alpha formats to _mesa_base_fbo_formatMarek Olšák2012-01-251-0/+9
| | | | Reviewed-by: Brian Paul <[email protected]>
* 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]>