aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fbobject.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: allow out-of-order drawing to optimize immediate mode if it's safeMarek Olšák2020-03-261-0/+1
| | | | | | | | | This increases performance by 11-13% in Viewperf11/Catia - first scene. Set allow_draw_out_of_order=true to enable this. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4152>
* mesa: Fix detection of invalidating both depth and stencil.Eric Anholt2020-01-131-2/+3
| | | | | | | | | | | Fixes an extra 1024x1024x4 MSAA Z/S store on WebGL fishtank on cheza. Reported-by: Dave Airlie <[email protected]> Fixes: db2ae5112106 ("mesa: Skip partial InvalidateFramebuffer of packed depth/stencil.") Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Rob Clark <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3370> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3370>
* mesa: add ARB_framebuffer_no_attachments named functionsPierre-Eric Pelloux-Prayer2019-11-191-0/+76
| | | | | | | | | | | The wording in ARB_framebuffer_no_attachments and EXT_direct_state_access is different. In the former framebuffer names must have been generated using glGenFramebuffers before using the named functions. In the latter framebuffer names have no such constraints, so we can't use the _mesa_lookup_framebuffer_dsa function. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa NamedRenderbufferStorageMultisampleEXT functionPierre-Eric Pelloux-Prayer2019-10-181-0/+19
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glNamedRenderbufferStorageEXT and ↵Pierre-Eric Pelloux-Prayer2019-10-181-0/+34
| | | | | | glGetNamedRenderbufferParameterivEXT Reviewed-by: Marek Olšák <[email protected]>
* mesa: Handle pbuffers in desktop GL framebuffer attachment queriesKenneth Graunke2019-10-151-5/+7
| | | | | | | | | | Once again, we were handling back-to-front in the GLES3 case, but not the desktop GL case. Fixes GTF-GL46.gtf30.GL3Tests.framebuffer_srgb.framebuffer_srgb_default_encoding when run with --deqp-surface-type=pbuffer --deqp-gl-context-type=egl. Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Allow MESA_framebuffer_flip_y for GLES 3Fritz Koenig2019-10-081-12/+47
| | | | | | | | Implement glFramebufferParameteriMESA on GLES 3 so that the extension is not dependant on GLES 3.1 Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* mesa: add EXT_dsa (Named)Framebuffer functionsPierre-Eric Pelloux-Prayer2019-07-301-11/+200
| | | | | | | | | | These functions dont support display list as specified: Should the selector-free versions of various OpenGL 3.0 and EXT_framebuffer_object framebuffer object commands not be allowed in display lists [...]? RESOLVED: Yes
* mesa: Give _mesa_format_get_color_encoding a clearer name.Eric Anholt2019-07-161-2/+2
| | | | | | | It only returned one of two values. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* mesa: rename logging functions to reflect that they format stringsMark Janes2019-03-141-5/+5
| | | | | | | In preparation for the definition of a function to log a formatted string. Reviewed-by: Erik Faye-Lund <[email protected]>
* mesa: Fix RGBBuffers for renderbuffers with sized internal formatsKenneth Graunke2019-02-251-1/+4
| | | | | | | | | | | | | | | For texture attachments, 'f' is texImg->_BaseFormat, but for renderbuffer attachments, 'f' is att->Renderbuffer->InternalFormat. InternalFormat may be something like GL_RGB8, which causes our (f == GL_RGB) check to fail. Switch to using a proper _BaseFormat, which drops the size. Fixes dEQP-GLES31.functional.draw_buffers_indexed.random. max_required_draw_buffers.15 on iris when combined with a driver fix. Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Timur Kristóf <[email protected]>
* mesa: add explicit enable for EXT_float_blend, and error conditionIlia Mirkin2019-02-181-0/+4
| | | | | | | | | If EXT_float_blend is not supported, error out on blending of FP32 attachments in an ES2 context. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: return NULL if we exceed MaxColorAttachments in get_fb_attachmentTapani Pälli2019-02-181-2/+6
| | | | | | | | | | | | | | | This fixes invalid access to Attachment array which would occur if caller would exceed MaxColorAttachments. In practice this should not ever happen because DiscardFramebufferEXT specifies only GL_COLOR_ATTACHMENT0 to be valid and InvalidateFramebuffer will error out before but this should make coverity happy. v2: const, remove _EXT (Ian) CID: 1442559 Fixes: 0c42b5f3cb9 "mesa: wire up InvalidateFramebuffer" Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Skip partial InvalidateFramebuffer of packed depth/stencil.Eric Anholt2019-01-311-0/+23
| | | | | | | | | One of the CTS cases tries to invalidate just stencil of packed depth/stencil, and we incorrectly lost the depth contents. Fixes dEQP-GLES3.functional.fbo.invalidate.whole.unbind_read_stencil Fixes: 0c42b5f3cb90 ("mesa: wire up InvalidateFramebuffer") Reviewed-by: Marek Olšák <[email protected]>
* mesa: wire up InvalidateFramebufferRob Clark2019-01-291-4/+64
| | | | | | | | | | And before someone actually starts implementing DiscardFramebuffer() lets rework the interface to something that is actually usable. Signed-off-by: Rob Clark <[email protected]> Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/main: Use flag for EXT_sRGB instead of EXT_framebuffer_sRGB where possibleGert Wollny2019-01-281-1/+1
| | | | | | | | | | | | | | | | All drivers that support EXT_framebuffer_sRGB also support EXT_sRGB, but in order to keep this commit minial, and not to break any drivers both flags are checked. v2: - Use only EXT_sRGB (Ilia Mirkin) - Move adding the flag EXT_sRGB to gl_extensions to a separate patch v3: use _mesa_has_EXT_framebuffer_sRGB instead of extension flag The _mesa_has function also checks for the correct versions and should be preferred over using the flags directly (Erik) Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: Optionally override RGB/RGBX dst alpha blend factorsKenneth Graunke2019-01-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Intel's blending hardware does not properly return 1.0 for destination alpha for RGBX formats; it requires the factors to be overridden to either zero or one. Broadcom vc4 and v3d also could use this override. While overriding these factors is safe in general, Nouveau and Radeon would prefer not to. Their blending hardware already returns correct values for RGB/RGBX formats, and would like to avoid the resulting per-buffer blending and independent blend factors (rgb != a) since it can cause additional overhead. I considered simply handling this in the driver, but it's not as nice. pipe_blend_state doesn't have any format information, so we'd need the hardware blend state to depend on both pipe_blend_state and pipe_framebuffer_state. Furthermore, Intel GPUs don't have a native RGBX_SNORM format, so I avoid exposing one, which makes Gallium fall back to RGBA_SNORM. The pipe_surfaces we get in the driver have an RGBA format, making it impossible to tell that there shouldn't be an alpha channel. One could argue that st not handling it in that case is a bug. To work around this, we'd have to expose RGBX pipe formats, mapped to RGBA hardware formats, and add format swizzling special cases. All doable, but it ends up being more code than I'd like. st_atom_blend already has access to the right information and it's trivial to accomplish there, so we just add a cap bit and do that. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add core support for EXT_multisampled_render_to_texture{,2}Kristian H. Kristensen2018-12-061-14/+43
| | | | | | | | | This also turns on EXT_multisampled_render_to_texture which is a subset of EXT_multisampled_render_to_texture2, allowing only COLOR_ATTACHMENT0. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kristian H. Kristensen <[email protected]>
* mesa: mark GL_SR8_EXT non-renderable on GLESMarek Olšák2018-11-121-0/+1
| | | | | | Fixes: dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.sr8_ext Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: enable EXT_framebuffer_object in core profileTimothy Arceri2018-09-181-22/+12
| | | | | | | | | | | | Since user defined names are not allowed in core profile we remove the allow_user_names bool and just check if we have a core profile like all other buffer/texture object handling code does. This extension is required by "Wolfenstein: The Old Blood" and is exposed in core in the Nvidia binary driver. Reviewed-by: Marek Olšák <[email protected]>
* mesa: FramebufferParameteri parameter checkingFritz Koenig2018-09-171-0/+1
| | | | | | | | | Missing break; causes parameter checking to never pass GL_FRAMEBUFFER_FLIP_Y_MESA parameters. Fixes: 318c265160 ("mesa: GL_MESA_framebuffer_flip_y extension [v4]") Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add missing return statement for GL_RG_SNORM caseDanylo Piliaiev2018-09-061-1/+1
| | | | | | | Fixes: 0d356cf4781bece0dc9a7 "mesa: enable EXT_render_snorm extension" Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: enable ARB_direct_state_access in compat for GL3.1+Timothy Arceri2018-08-301-6/+7
| | | | | | | | We could enable it for lower versions of GL but this allows us to just use the existing version/extension checks that are already used by the core profile. Reviewed-by: Marek Olšák <[email protected]>
* mesa: enable EXT_render_snorm extensionTapani Pälli2018-08-131-8/+29
| | | | | | | | | | | | | | | | Patch sets additional formats renderable and enables the extension when OpenGL ES 3.1 is supported. v2: instead of dummy_true, have a separate toggle for extension (Eric Anholt) v3: add missing checks, simplify some existing checks and fix glCopyTexImage2D check (Nanley Chery) add SHORT and BYTE support in read_pixels_es3_error_check Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Nanley Chery <[email protected]>
* mesa: add functional FBO changes for AMD_framebuffer_multisample_advancedMarek Olšák2018-08-041-17/+79
| | | | | | | - relax FBO completeness rules - validate sample counts Reviewed-by: Brian Paul <[email protected]>
* mesa: add gl_renderbuffer::NumStorageSamplesMarek Olšák2018-08-041-8/+17
| | | | Reviewed-by: Brian Paul <[email protected]>
* glapi: define AMD_framebuffer_multisample_advanced and add its functionsMarek Olšák2018-08-041-0/+22
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: add storageSamples parameter to renderbuffer functionsMarek Olšák2018-08-041-16/+25
| | | | | | | It's just passed to other functions but otherwise unused. It will be used in following commits. Reviewed-by: Brian Paul <[email protected]>
* mesa: add glRenderbufferStorage support for EXT_texture_norm16 formatsTapani Pälli2018-07-311-3/+7
| | | | | | | | | These bits were missing, found when extending the Piglit test. Fixes: 7f467d4f73 "mesa: GL_EXT_texture_norm16 extension plumbing" Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Nanley Chery <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: GL_MESA_framebuffer_flip_y extension [v4]Fritz Koenig2018-07-271-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Adds an extension to glFramebufferParameteri that will specify if the framebuffer is vertically flipped. Historically system framebuffers are vertically flipped and user framebuffers are not. Checking to see the state was done by looking at the name field. This adds an explicit field. v2: * updated spec language [for chadv] * correctly specifying ES 3.1 [for chadv] * refactor access to rb->Name [for jason] * handle GetFramebufferParameteriv [for chadv] v3: * correct _mesa_GetMultisamplefv [for kusmabite] v4: * update spec language [for chadv] * s/GLboolean/bool/g [for chadv] * s/InvertedY/FlipY/g [for chadv] * s/inverted_y/flip_y/g [for chadv] * assert changes [for chadv] Reviewed-by: Chad Versace <[email protected]>
* mesa: add missing return in error pathEric Engestrom2018-06-181-1/+3
| | | | | | | | Fixes: 67f40dadaa6666dacd90 "mesa: add support for ARB_sample_locations" Cc: Rhys Perry <[email protected]> Cc: Brian Paul <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: add support for ARB_sample_locationsRhys Perry2018-06-141-28/+228
| | | | | | Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Brian Paul <[email protected]> (v2) Reviewed-by: Marek Olšák <[email protected]> (v2)
* mesa: fix error handling in get_framebuffer_parameterivRhys Perry2018-05-091-31/+41
| | | | | | | CC: <[email protected]> Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add missing RGB9_E5 format in _mesa_base_fbo_formatJuan A. Suarez Romero2018-02-231-0/+3
| | | | | | | | | | | | | | | | | | RGB9_E5 should be accepted by RenderbufferStorage if the EXT_texture_shared_exponent is exposed. It is left to the implementations to return GL_FRAMEBUFFER_UNSUPPORTED_EXT when checking the framebuffer completeness if they do not support rendering in this format. Discussed in: https://github.com/KhronosGroup/OpenGL-API/issues/32 This fixes KHR-GL45.internalformat.renderbuffer.rgb9_e5 v2: Added more info to the commit message (Antia) Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Antia Puentes <[email protected]>
* Revert "mesa: add missing RGB9_E5 format in _mesa_base_fbo_format"Antia Puentes2018-01-311-3/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit 513c2263cbff45edb105c7b46e58f316e06746ab. _mesa_base_fbo_format_ is used to validate the internalformat passed to RenderbufferStorage, which in the OpenGL 4.6 is said: "An INVALID_ENUM error is generated if internalformat is not one of the color-renderable, depth-renderable, or stencil-renderable formats defined in section 9.4." RGB9_E5 format is not renderable, as stated in the same specification (Bug 9338). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104794 Cc: Juan A. Suarez Romero <[email protected]> Cc: Kenneth Graunke <[email protected]> Reviewed-by: Juan A. Suarez <[email protected]>
* mesa: add missing RGB9_E5 format in _mesa_base_fbo_formatJuan A. Suarez Romero2018-01-251-0/+3
| | | | | | This fixes KHR-GL45.internalformat.renderbuffer.rgb9_e5. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add const qualifier on _mesa_base_fbo_format()Brian Paul2017-12-051-1/+1
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* mesa: s/%u/%d/ in _mesa_error() call in check_layer()Brian Paul2017-12-051-2/+1
| | | | | | | | The layer parameter is signed. Fixes the error message seen when running the arb_texture_multisample-errors test which checks a negative layer value. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add const qualifier in test_attachment_completeness()Brian Paul2017-12-051-1/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: use simple mtx in core mesaTimothy Arceri2017-11-091-7/+7
| | | | | | | | | Results from x11perf -copywinwin10 on Eric's SKL: 4.33338% ± 0.905054% (n=40) Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Yogesh Marathe <[email protected]>
* mesa: Accept GL_BACK in get_fb0_attachment with ARB_ES3_1_compatibility.Kenneth Graunke2017-10-271-0/+9
| | | | | | | | | | | According to the ARB_ES3_1_compatibility specification, glGetFramebufferAttachmentParameteriv is supposed to accept BACK, and it behaves exactly like BACK_LEFT. Fixes a GL error in GFXBench 5 Aztec Ruins. Cc: "17.3 17.2" <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: minor simplification in test_attachment_completeness()Brian Paul2017-10-141-2/+1
| | | | | | We already have a pointer to the texture object. Use it here. Reviewed-by: Timothy Arceri <[email protected]>
* mesa: Expose GL_OES_required_internalformat on GLES contexts.Eric Anholt2017-10-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This extension is effectively a backport of GLES3's internalformat handling to GLES 1/2. It guarantees that sized internalformats specified for textures and renderbuffers have at least the specified size stored. That's a pretty minimal requirement, so I think it can be dummy_true and exposed as a standard in Mesa. As a side effect, it also allows GL_RGB565 to be specified as a texture format, not just as a renderbuffer. Mesa had previously been allowing 565 textures, which angered DEQP in the absence of this extension being exposed. v2: Allow 2101010rev with sized internalformats even on GLES3, citing the extension spec. Extend extension checks for GLES2 contexts exposing with texture_float, texture_half_float, and texture_rg. v3: Fix ALPHA/LUMINANCE/LUMINANCE_ALPHA error checking (GLES3 CTS failures) v4: Mark GL_RGB10 non-color-renderable on ES, fix A/L/LA errors on GLES2 with float formats. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: make glFramebuffer* check immutable texture level boundsKenneth Graunke2017-10-071-6/+14
| | | | | | | | | | | | | | When a texture is immutable, we can't tack on extra levels after-the-fact like we could with glTexImage. So check against that level limit and return an error if it's surpassed. This fixes: KHR-GL45.geometry_shader.layered_fbo.fb_texture_invalid_level_number (Based on a patch by Ilia Mirkin.) Reviewed-by: Antia Puentes <[email protected]> [imirkin v2] Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/main: R10G10B10_(A2) formats are not color renderable in ESNicolai Hähnle2017-10-021-2/+5
| | | | | | | | | | | | | The EXT_texture_type_2_10_10_10_REV (ES only) states the following issue: "1. Should textures specified with this type be renderable? UNRESOLVED: No. A separate extension could provide this functionality." This partially fixes dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.{rgb,rgba}_unsigned_int_2_10_10_10_rev Reviewed-by: Marek Olšák <[email protected]>
* mesa: add KHR_no_error support to glNamedFramebufferRenderbuffer()Samuel Pitoiset2017-07-311-0/+13
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glFramebufferRenderbuffer()Samuel Pitoiset2017-07-311-0/+22
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add framebuffer_renderbuffer_error() helperSamuel Pitoiset2017-07-311-46/+63
| | | | | | | And make framebuffer_renderbuffer() always inline. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glInvalidate*()Samuel Pitoiset2017-07-311-0/+17
| | | | | | | | These are just no-op because we don't actually do anything useful in the errors path. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove duplicated code around framebuffer_renderbuffer()Samuel Pitoiset2017-07-201-47/+23
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>