summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/copyimage.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Require mipmap completeness for glCopyImageSubData() at times.Kenneth Graunke2017-06-281-2/+57
| | | | | | | | | | | | | | | | | | | | | | | | This patch makes glCopyImageSubData require mipmap completeness when the texture object's built-in sampler object has a mipmapping MinFilter. This is apparently the de facto behavior and mandated by Android's CTS. One exception is that we ignore format based completeness rules (specifically integer formats with linear filtering), as this is also the de facto behavior that until recently was mandated by the OpenGL 4.5 CTS. This was discussed with both the OpenGL and OpenGL ES working groups, and while everyone agrees this behavior is unfortunate and complicated, it is what it is at this point. There was little appetite for relaxing restrictions given that all conformant Android drivers followed the mipmapping rule, and all conformant GL 4.5 implementations ignored the integer/linear rule. Fixes (on i965): dEQP-GLES31.functional.debug.negative_coverage.*.buffer.copy_image_sub_data Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16224 Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: add KHR_no_error support for glCopyImageSubData()Samuel Pitoiset2017-06-071-0/+23
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add copy_image_subdata() helperSamuel Pitoiset2017-06-071-31/+45
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add prepare_target() helperSamuel Pitoiset2017-06-071-0/+24
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: rename prepare_target() to prepare_target_err()Samuel Pitoiset2017-06-071-16/+18
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* Revert "mesa: Require mipmap completeness for glCopyImageSubData(), sometimes."Kenneth Graunke2017-05-071-23/+2
| | | | | | | | | | | | | | | | | | This reverts commit c5bf7cb52942cb7df9f5d73746ffbf3c102d12cc. This broke rendering in "Total War: WARHAMMER", which uses a single level RGBA_UINT32 texture and the default filter modes of GL_LINEAR and GL_NEAREST_MIPMAP_LINEAR. However, the texture max level is 0, so it is actually mipmap complete - it's the integer + linear rule that causes the error. I'm working with Khronos to find a real solution. However it turns out, this patch is not correct and breaks real programs, so let's revert it for now. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100690 Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16224 Cc: "17.1" <[email protected]>
* mesa: Require mipmap completeness for glCopyImageSubData(), sometimes.Kenneth Graunke2017-04-041-2/+23
| | | | | | | | | | This patch makes glCopyImageSubData require mipmap completeness when the texture object's built-in sampler object has a mipmapping MinFilter. Fixes (on i965): dEQP-GLES31.functional.debug.negative_coverage.*.buffer.copy_image_sub_data Reviewed-by: Roland Scheidegger <[email protected]>
* mesa/main: fix error checking logic on CopyImageSubDataAlejandro Piñeiro2016-07-021-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the case (both src or dst) where we had a texobject, but the texobject target was not the same that the method target, this spec paragraph was appplied: /* Section 18.3.2 (Copying Between Images) of the OpenGL 4.5 Core * Profile spec says: * * "An INVALID_VALUE error is generated if either name does not * correspond to a valid renderbuffer or texture object according * to the corresponding target parameter." */ But for that case, the correct spec paragraph should be: /* Section 18.3.2 (Copying Between Images) of the OpenGL 4.5 Core * Profile spec says: * * "An INVALID_ENUM error is generated if either target is * not RENDERBUFFER or a valid non-proxy texture target; * is TEXTURE_BUFFER or one of the cubemap face selectors * described in table 8.18; or if the target does not * match the type of the object." */ specifically the last sentence: "or if the target does not match the type of the object". This patch fixes the error returned (s/INVALID/ENUM) for that case, and moves up the INVALID_VALUE spec paragraph, as that case (invalid texture object) was handled before. Fixes: GL44-CTS.copy_image.target_miss_match Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/copyimage: report INVALID_VALUE for missing cube faceDave Airlie2016-06-031-1/+1
| | | | | | | | | | | | The specs says INVALID_VALUE for exceeding dimensions, which is really what is happening here. This fixes: GL45-CTS.copy_image.non_existent_mipmap Cc: "11.2 12.0" <[email protected]> Reviewed-by: Antia Puentes <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/copyimage: fix num samples check to handle renderbuffers.Dave Airlie2016-06-031-4/+7
| | | | | | | | | | | | This test was only happening for textures, but there is nothing in the spec to say this, so test it for all cases. This fixes: GL45-CTS.copy_image.invalid_target Cc: "11.2 12.0" <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/copyimage: make sure number of samples match.Dave Airlie2016-05-031-0/+14
| | | | | | | | | This fixes GL43-CTS.copy_image.samples_missmatch which otherwise asserts in the radeonsi driver. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: add GL_OES_copy_image supportIlia Mirkin2016-03-301-1/+26
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* mesa/copyimage: allow width/height to not be multiples of blockIlia Mirkin2015-11-111-3/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | For compressed textures, the image size is not necessarily a multiple of the block size (e.g. the last mip levels). Section 18.3.2 (Copying Between Images) of the OpenGL 4.5 Core Profile spec says: An INVALID_VALUE error is generated if the dimensions of either subregion exceeds the boundaries of the corresponding image object, or if the image format is compressed and the dimensions of the subregion fail to meet the alignment constraints of the format. and Section 8.7 (Compressed Texture Images) says: An INVALID_OPERATION error is generated if any of the following conditions occurs: * width is not a multiple of four, and width + xoffset is not equal to the value of TEXTURE_WIDTH. * height is not a multiple of four, and height + yoffset is not equal to the value of TEXTURE_HEIGHT. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92860 Signed-off-by: Ilia Mirkin <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Cc: [email protected]
* mesa: rework Driver.CopyImageSubData() and related codeBrian Paul2015-09-241-130/+171
| | | | | | | | | | | | | | | | | | | | | | | | Previously, core Mesa's _mesa_CopyImageSubData() created temporary textures to wrap renderbuffer sources/destinations. This caused a bit of a mess in the Mesa/gallium state tracker because we had to basically undo that wrapping. Instead, change ctx->Driver.CopyImageSubData() to take both gl_renderbuffer and gl_texture_image src/dst pointers (one being null, the other non-null) so the driver can handle renderbuffer vs. texture as needed. For the i965 driver, we basically moved the code that wrapped textures around renderbuffers from copyimage.c down into the met and driver code. The old code in copyimage.c also made some questionable calls to _mesa_BindTexture(), etc. which weren't undone at the end. v2 (Jason Ekstrand): Rework the intel bits v3 (Brian Paul): Update the temporary st_CopyImageSubData() function. Reviewed-by: Topi Pohjolainen <[email protected]> Tested-by: Kai Wasserbäch <[email protected]> Tested-by: Nick Sarnie <[email protected]>
* mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke2015-07-201-4/+4
| | | | | | | Generated by sed; no manual changes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add some comments in copyimage.cBrian Paul2015-05-261-0/+22
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* mesa: move decls, add const qualifiers in copyimage.cBrian Paul2015-05-261-8/+9
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* mesa: improve ARB_copy_image internal format compat checkSeán de Búrca2015-03-121-21/+130
| | | | | | | | | | | | | | | | | | | | | | The memory layout of compatible internal formats may differ in bytes per block, so TexFormat is not a reliable measure of compatibility. For example, GL_RGB8 and GL_RGB8UI are compatible formats, but GL_RGB8 may be laid out in memory as B8G8R8X8. If GL_RGB8UI has a 3 byte-per-block memory layout, the existing compatibility check will fail. Additionally, the current check allows any two compressed textures which share block size to be used, whereas the spec gives an explicit table of compatible formats. v2: Use a switch instead of array iteration for block class and show the correct GL error when internal formats are mismatched. v3: Include spec citations for new compatibility checks, rearrange check order to ensure that compressed, view-compatible formats return the correct result, and make style fixes. Original commit message amended for clarity. v4: Reformatted spec citations. Reviewed-by: Jason Ekstrand <[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: check if GL_ARB_copy_image is enabled in _mesa_CopyImageSubData()Brian Paul2014-08-151-1/+7
| | | | | | | | | | Generate a GL error and return rather than crashing on a null ctx->Driver.CopyImageSubData pointer (gallium). This allows apitraces with glCopyImageSubData() calls to continue rather than crash. Plus, fix a comment typo. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: add missing GLAPIENTRY in copyimage.cBrian Paul2014-08-111-1/+1
| | | | Fixes MinGW build. Trivial.
* mesa: Add GL API support for ARB_copy_imageJason Ekstrand2014-08-111-0/+356
This adds the API entrypoint, error checking logic, and a driver hook for the ARB_copy_image extension. v2: Fix a typo in ARB_copy_image.xml and add it to the makefile v3: Put ARB_copy_image.xml in the right place alphebetically in the makefile and properly prefix the commit message v4: Fixed some line wrapping and added a check for null v5: Check for incomplete renderbuffers Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Neil Roberts <[email protected]> v6: Update dispatch_sanity for the addition of CopyImageSubData