summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texparam.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa/texture: Also check for LA texture when querying intensity component sizeGert Wollny2018-09-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Gallium may pick L16A16_FLOAT to represent GL_INTENSITY16F if no intensity format is provided by the driver. However, when calling glGetTexLevelParameteriv(..., GL_TEXTURE_INTENSITY_SIZE, ...) mesa will return a zero size because the actually used format has no intensity channel and as a fallback only the sizes of the red/green channels are checked. Also checking for LA sizes in the allocated texture resolves this problem. v2: Only check alpha channel size and return it (Marek) L and A size are always the same in this case. Fixes (on virgl): ext_framebuffer_multisample-fast-clear GL_ARB_texture_float * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107832 Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: changes to expose OES_texture_view extensionTapani Pälli2018-05-241-6/+5
| | | | | | | | | | | Functionality already covered by ARB_texture_view, patch also adds missing 'gles guard' for enums (added in f1563e6392). Tested via arb_texture_view.*_gles3 tests and individual app utilizing texture view with ETC2. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Don't write to user buffer in glGetTexParameterIuiv on errorIan Romanick2018-03-121-26/+2
| | | | | | | | | | | | | | | | | | | | | | | With some sets of optimization flags, GCC will generate warnings like this: src/mesa/main/texparam.c:2327:27: warning: ‘*((void *)&ip+12)’ may be used uninitialized in this function [-Wmaybe-uninitialized] params[3] = ip[3]; ~~^~~ src/mesa/main/texparam.c:2320:16: note: ‘*((void *)&ip+12)’ was declared here GLint ip[4]; ^~ ip is not initialized in cases where a GL error is generated. In these cases, we should *not* write to the user's buffer, so this is actually a bug. I wrote a new piglit test gl-3.0-texparameteri to show this bug. I suspect that Coverity also detected this, but the scan site is currently down. Fixes: c2c507786 "main: Added entry points for glGetTextureParameteriv, Iiv, and Iuiv." Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: reduce the size of gl_texture_objectMarek Olšák2018-02-131-1/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: enable ARB_texture_buffer_* extensions in the Compatibility profileMarek Olšák2017-11-091-2/+2
| | | | | | | | | | | | | | We already have piglit tests testing alpha, luminance, and intensity formats. They were skipped by piglit until now. Additionally, I'm enabling one ARB_texture_buffer_range piglit test to run with the compat profile. i965 behavior is unchanged except that it doesn't expose TBOs in the Compat profile. Not sure how that affects the GL version override. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* Update TextureParameter* error for incompatible texture targetsIago Toral Quiroga2017-08-091-1/+1
| | | | | | | | | | | The OpenGL 4.6 specs have been updated so that GetTextureParameter* with a texture object with an incompatible TEXTURE_TARGET should now report INVALID_OPERATION instead of INVALID_ENUM. Fixes: KHR-GL45.direct_state_access.textures_parameter_errors Reviewed-by: Jordan Justen <[email protected]>
* mesa: hook up queries for NUM_TILING_TYPES and TILING_TYPESAndres Rodriguez2017-08-061-0/+27
| | | | | | | | These are just basic implementations. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: Refactor error checking for GL_TEXTURE_BASE_LEVEL vs texture targetsIan Romanick2017-06-281-7/+19
| | | | | | | | | | Add a big spec quotation justifying the error generated, which has changed over the GL versions. v2: Compact the spec quote based on a Khronos bug and discussion with Jason. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: remove redundant error checkTimothy Arceri2017-06-291-4/+0
| | | | | | | We do the same check in the shared code in the set_tex_parameterf() call. Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: GL_TEXTURE_BORDER_COLOR exists in OpenGL 1.0, so don't depend on ↵Ian Romanick2017-06-281-1/+9
| | | | | | | | | | | | | | | | | | | | | GL_ARB_texture_border_clamp On NV20 (and probably also on earlier NV GPUs that lack GL_ARB_texture_border_clamp) fixes the following piglit tests: gl-1.0-beginend-coverage gltexparameter[if]{v,} push-pop-texture-state texwrap 1d texwrap 1d proj texwrap 2d proj texwrap formats All told, 49 more tests pass on NV20 (10de:0201). No changes on Intel CI run or RV250 (1002:4c66). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: fix using texture id 0 with gl*TextureParameter*()Samuel Pitoiset2017-06-221-4/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: refuse to update tex parameters when a handle is allocatedSamuel Pitoiset2017-06-141-0/+38
| | | | | | | | | | | | | The ARB_bindless_texture spec says: "The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by TexImage*, CopyTexImage*, CompressedTexImage*, TexBuffer*, TexParameter*, as well as other functions defined in terms of these, if the texture object to be modified is referenced by one or more texture or image handles." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: throw an INVALID_OPERATION error in get_texobj_by_name()Samuel Pitoiset2017-05-311-50/+11
| | | | | | | | Because get_texobj_by_name() can already throw a INVALID_ENUM error, it makes more sense to add a check directly there. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add new 'name' parameter to get_texobj_by_name()Samuel Pitoiset2017-05-311-13/+12
| | | | | | | | To display better function names when INVALID_OPERATION is returned. Requested by Timothy. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: fix broken indentationTimothy Arceri2017-05-071-7/+6
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: split _NEW_TEXTURE into _NEW_TEXTURE_OBJECT & _NEW_TEXTURE_STATEMarek Olšák2017-03-291-5/+5
| | | | | | | | | | | | No performance testing has been done, because it makes sense to make this change regardless of that. Also, _NEW_TEXTURE is still used in many places, but the obvious occurences are replaced here. It's now possible to split _NEW_TEXTURE_OBJECT further. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* main: return error if asking for GL_TEXTURE_BORDER_COLOR in ↵Samuel Iglesias Gonsálvez2016-11-151-0/+12
| | | | | | | | | | | | | | | | | | | | | TEXTURE_2D_MULTISAMPLE{_ARRAY} through TexParameter{i,Ii,Iui}v() OpenGL ES 3.2 says in section 8.10. "TEXTURE PARAMETERS", at the end of the section: "An INVALID_ENUM error is generated if target is TEXTURE_2D_- MULTISAMPLE or TEXTURE_2D_MULTISAMPLE_ARRAY , and pname is any sampler state from table 21.12." GL_TEXTURE_BORDER_COLOR is present in that table. v2: - Add check to _mesa_texture_parameteriv() (Kenneth) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98250 Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove 'params' parameter from ctx->Driver.TexParameter()Brian Paul2016-10-131-13/+4
| | | | | | | | | | | None of the drivers which implement this hook do anything with the texture parameter value. Drivers just look at the pname and set a dirty flag if needed. We were doing some ugly casting and type conversion to setup the argument so that all goes away. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add comment/assertion on get_tex_level_parameter_buffer()Brian Paul2016-10-061-0/+5
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Add support for OES_texture_cube_map_arrayIan Romanick2016-08-261-2/+3
| | | | | | | | | | | This has a separate enable flag because this extension also requires OES_geometry_shader. It is possible that some drivers may support OpenGL ES 3.1 and ARB_texture_cube_map but not support OES_geometry_shader. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add OES_texture_buffer and EXT_texture_buffer supportIlia Mirkin2016-03-281-19/+20
| | | | | | | | Allow ES 3.1 contexts to access the texture buffer functionality. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: properly return GetTexLevelParameter queries for buffer texturesIlia Mirkin2016-03-281-2/+52
| | | | | | | | | | | | | This fixes all failures with dEQP tests in this area. While ARB_texture_buffer_object explicitly says that GetTexLevelParameter & co should not be supported, GL 3.1 reverses this decision and allows all of these queries there. Conversely, there is no text that forbids the buffer-specific queries from being used with non-buffer images. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/texparam: make public target_allows_setting_sampler_parametersAlejandro Piñeiro2016-03-031-16/+16
| | | | | | In order to allow to be used on ARB_internalformat_query2 implementation. Reviewed-by: Dave Airlie <[email protected]>
* mesa/main: Make legal_get_tex_level_parameter_target publicAntia Puentes2016-03-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | It will be used by the ARB_internalformat_query2 implementation to check if the target is valid for those <pnames> that are said in the spec that should return the same values than the 'glGetTexLevelParameter{if}v' function: - INTERNALFORMAT_RED_SIZE - INTERNALFORMAT_GREEN_SIZE - INTERNALFORMAT_BLUE_SIZE - INTERNALFORMAT_ALPHA_SIZE - INTERNALFORMAT_DEPTH_SIZE - INTERNALFORMAT_STENCIL_SIZE - INTERNALFORMAT_SHARED_SIZE - INTERNALFORMAT_RED_TYPE - INTERNALFORMAT_GREEN_TYPE - INTERNALFORMAT_BLUE_TYPE - INTERNALFORMAT_ALPHA_TYPE - INTERNALFORMAT_DEPTH_TYPE - INTERNALFORMAT_STENCIL_TYPE - IMAGE_FORMAT_COMPATIBILITY_TYPE Reviewed-by: Dave Airlie <[email protected]>
* mesa: expose GL_EXT_texture_sRGB_decode on GLES 3.0+Ilia Mirkin2016-02-261-2/+1
| | | | | | | | Could be exposed on earlier GLES versions if we supported EXT_sRGB, but we don't, for now. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* mesa: add GL_OES_texture_border_clamp supportIlia Mirkin2016-02-221-4/+7
| | | | | | | Only minor differences to the existing ARB_texture_border_clamp support. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* mesa: default FixedSampleLocations to true when using a dummy imageIlia Mirkin2016-02-131-0/+1
| | | | | | | | | | | | GL_ARB_texture_multisample and GLES 3.1 expect the initial value to be GL_TRUE. This fixes dEQP-GLES31.functional.state_query.texture_level.texture_2d_multisample_array.fixed_sample_locations_integer and a few related tests. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* mesa: allow DEPTH_STENCIL_TEXTURE_MODE queries in GLES 3.1 contextsIlia Mirkin2016-02-121-5/+3
| | | | | | | | | | | This fixes dEQP-GLES31.functional.state_query.texture.texture_2d_multisample.depth_stencil_mode_integer and a few related tests. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nanley Chery <[email protected]>
* mesa: remove _ARB suffix from cube map enumsBrian Paul2016-02-121-7/+7
| | | | | | | Just minor clean-up so we're consistent everywhere. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add missing queries for ARB_direct_state_accessDaniel Scharrer2015-08-281-0/+12
| | | | | | | | | | | This adds index queries (glGet*i_v) for GL_TEXTURE_BINDING_* and GL_SAMPLER_BINDING, as well as textue queries (glGetTex{,ture}Parameter*) for GL_TEXTURE_TARGET. CC: "10.6 11.0" <[email protected]> Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* mesa: enable enums for OES_texture_storage_multisample_2d_arrayTapani Pälli2015-08-271-1/+1
| | | | | | | | | v2: use _mesa_is_gles31(ctx) for verifying we are on ES 3.1, remove _es31 usage from get_hash_params.py Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marta Lofstedt <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: GetTexLevelParameter{if}v changes for OpenGL ES 3.1Tapani Pälli2015-08-261-6/+18
| | | | | | | | | | | | | Patch refactors existing parameters check to first check common enums between desktop GL and GLES 3.1 and modifies get_tex_level_parameter_image to be compatible with enums specified in 3.1. v2: remove extra is_gles31() checks (suggested by Ilia) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> (v1) Reviewed-by: Marta Lofstedt <[email protected]> (v1) Reviewed-by: Ilia Mirkin <[email protected]>
* mesa/main: Add GL_IMAGE_FORMAT_COMPATIBILITY_TYPE to glGetTexParameterfvMarta Lofstedt2015-08-191-0/+6
| | | | | | | | | According to Open GL ES 3.1 specification, section 8.10.2 GL_IMAGE_FORMAT_COMPATIBILITY_TYPE should be supported by glGetTexParameterfv. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: fix target error checking in glGetTexLevelParameterTapani Pälli2015-08-171-7/+25
| | | | | | | | | | | | | | | With non-dsa functions we need to do target error checking before _mesa_get_current_tex_object which would just call _mesa_problem without raising GL_INVALID_ENUM error. In other places of Mesa, target gets checked before this call. Fixes failures in: ES31-CTS.texture_storage_multisample.APIGLGetTexLevelParameterifv.* v2: do the target check also for dsa functions (Timothy) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa/es3.1: Allow GL_DEPTH_STENCIL_TEXTURE_MODEMarta Lofstedt2015-08-031-1/+3
| | | | | | | GLES 3.1 must support the parameter GL_DEPTH_STENCIL_TEXTURE_MODE. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Avoid double promotion.Matt Turner2015-07-291-1/+1
| | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke2015-07-201-12/+12
| | | | | | | Generated by sed; no manual changes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* Revert "mesa: Add ARB_direct_state_access checks in texture functions"Ian Romanick2015-05-281-84/+0
| | | | | | | This reverts commit 8940957238e8584ce27295791cee4cc3d6f7cf1e. Acked-by: Fredrik Höglund <[email protected]> Cc: "10.6" <[email protected]>
* mesa: Add ARB_direct_state_access checks in texture functionsFredrik Höglund2015-05-141-0/+84
| | | | | Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* main: Refactor _mesa_[update|get]_clamp_fragment_color.Laura Ekstrand2015-05-141-1/+1
| | | | | Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* mesa: remove unneeded #include of colormac.hBrian Paul2015-04-011-1/+0
| | | | | Acked-by: Matt Turner <[email protected]> Reviewed-by: Mark Janes <[email protected]>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-231-3/+3
| | | | Acked-by: Eric Anholt <[email protected]>
* main: round floating-point value to nearest integer in glGetTexParameteriv()Samuel Iglesias Gonsalvez2015-01-131-5/+12
| | | | | | | | | | | | | | | | | | | | | | Previously, a cast was done to convert from float to int but there were rounding errors. The spec specificies in Data Conversion chapter that Floating-point values are rounded to the nearest integer. This patch fixes the following 8 dEQP tests: dEQP-GLES3.functional.state_query.texture.texture_2d_texture_min_lod_gettexparameteri dEQP-GLES3.functional.state_query.texture.texture_2d_texture_max_lod_gettexparameteri dEQP-GLES3.functional.state_query.texture.texture_3d_texture_min_lod_gettexparameteri dEQP-GLES3.functional.state_query.texture.texture_3d_texture_max_lod_gettexparameteri dEQP-GLES3.functional.state_query.texture.texture_2d_array_texture_min_lod_gettexparameteri dEQP-GLES3.functional.state_query.texture.texture_2d_array_texture_max_lod_gettexparameteri dEQP-GLES3.functional.state_query.texture.texture_cube_map_texture_min_lod_gettexparameteri dEQP-GLES3.functional.state_query.texture.texture_cube_map_texture_max_lod_gettexparameteri Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* main: Fixed some comments in texparam.cLaura Ekstrand2015-01-081-2/+2
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glGetTextureParameteriv, Iiv, and Iuiv.Laura Ekstrand2015-01-081-34/+110
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glGetTextureParameterfv.Laura Ekstrand2015-01-081-10/+42
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glGetTextureLevelParameteriv, fv.Laura Ekstrand2015-01-081-32/+106
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: legal_get_tex_level_parameter_target now handles GL_TEXTURE_CUBE_MAP.Laura Ekstrand2015-01-081-2/+13
| | | | | | | ARB_DIRECT_STATE_ACCESS functions allow an effective target of GL_TEXTURE_CUBE_MAP. Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry points for glTextureParameteriv, Iiv, Iuiv.Laura Ekstrand2015-01-081-34/+111
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* main: Added entry point for glTextureParameteri.Laura Ekstrand2015-01-081-11/+43
| | | | Reviewed-by: Anuj Phogat <[email protected]>