summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/samplerobj.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: include dispatch.h lessMarek Olšák2018-04-121-1/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: use simple mtx in core mesaTimothy Arceri2017-11-091-6/+6
| | | | | | | | | 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: add KHR_no_error support to glDeleteSamplers()Samuel Pitoiset2017-07-311-0/+8
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add delete_samplers() helperSamuel Pitoiset2017-07-311-11/+17
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glBindSampler()Samuel Pitoiset2017-07-311-0/+7
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add bind_sampler() helperSamuel Pitoiset2017-07-311-11/+17
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glBindSamplers()Samuel Pitoiset2017-07-311-0/+8
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add bind_samplers() helperSamuel Pitoiset2017-07-311-19/+28
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: return GL_OUT_OF_MEMORY if NewSamplerObject failsSamuel Pitoiset2017-07-241-4/+12
| | | | | | | This is similar to other functions that create objects. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: pass the 'caller' function to create_samplers()Samuel Pitoiset2017-07-241-4/+5
| | | | | | | To return GL_OUT_OF_MEMORY if NewSamplerObject fails. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: Return GL_INVALID_ENUM for bogus TEXTURE_SRGB_DECODE_EXT params.Kenneth Graunke2017-07-131-1/+12
| | | | | | | Fixes dEQP-GLES31.functional.debug.negative_coverage.get_error.shader.srgb_decode_samplerparameter{f,fv,i,Iiv,Iuiv,iv}. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: add KHR_no_error support for gl*Samplers()Samuel Pitoiset2017-06-281-0/+14
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: prepare create_samplers() helper for KHR_no_error supportSamuel Pitoiset2017-06-281-12/+19
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: refuse to update sampler parameters when a handle is allocatedSamuel Pitoiset2017-06-141-11/+22
| | | | | | | | | | | The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by SamplerParameter* if <sampler> identifies a sampler object referenced by one or more texture handles." Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: implement ARB_bindless_textureSamuel Pitoiset2017-06-141-0/+6
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: remove fallback RefCount == 0 patternTimothy Arceri2017-04-221-10/+4
| | | | | | | | We should never get here if this is 0 unless there is a bug. Replace the check with an assert. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[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]>
* mesa/main: make use of lookup_samplerobj_locked()Samuel Pitoiset2017-03-091-11/+1
| | | | | | | | There is no need to check sampler == 0 twice. This removes now unused _mesa_lookup_samplerobj_locked(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa/main: inline {begin,end}_samplerobj_lookups()Samuel Pitoiset2017-03-091-16/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa/main: remove useless check in _mesa_IsSampler()Samuel Pitoiset2017-03-061-7/+1
| | | | | | | | | _mesa_lookup_samplerobj() returns NULL if sampler is 0. v2: use _mesa_lookup...(...) != NULL Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/main: refactor sampler parameter error codepathSamuel Pitoiset2017-02-271-87/+52
| | | | | | | | | This is similar to what we do in the texture error codepath. While we are at it, update the specification comment with latest GL 4.5 spec. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/sampler: fix error codes for sampler parameters.Dave Airlie2016-06-011-27/+10
| | | | | | | | | | | | | The initial ARB_sampler_objects spec had GL_INVALID_VALUE in it, however version 8 of it fixed this, and the GL specs also have the fixed value in them. Fixes: GL45-CTS.texture_border_clamp.samplerparameteri_non_gen_sampler_error Reviewed-by: Ilia Mirkin <[email protected]> Cc: "12.0 11.2" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: Replace uses of Shared->Mutex with hash-table mutexesMatt Turner2016-05-201-5/+18
| | | | | | | | | | | | | | | We were locking the Shared->Mutex and then using calling functions like _mesa_HashInsert that do additional per-hash-table locking internally. Instead just lock each hash-table's mutex and use functions like _mesa_HashInsertLocked and the new _mesa_HashRemoveLocked. In order to do this, we need to remove the locking from _mesa_HashFindFreeKeyBlock since it will always be called with the per-hash-table lock taken. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Change an error code in glSamplerParameterI[iu]v().Kenneth Graunke2016-04-121-4/+6
| | | | | | | | | | | | This is supposed to be INVALID_OPERATION in ES. We already did this for the fv/iv variants, but not Iiv/Iuv, which are new in ES 3.2 (or extensions). Fixes: ES31-CTS.texture_border_clamp.samplerparameteri_non_gen_sampler_error Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: add GL_OES_texture_border_clamp supportIlia Mirkin2016-02-221-2/+4
| | | | | | | 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: Refator _mesa_BindSampler to make _mesa_bind_samplerIan Romanick2016-01-111-6/+12
| | | | | | | | | Pulls the parts of _mesa_BindSampler that aren't just parameter validation out into a function that can be called from other parts of Mesa (e.g., meta). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add _mesa_set_sampler_srgb_decode methodIan Romanick2016-01-111-0/+10
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add _mesa_set_sampler_filters methodIan Romanick2016-01-111-0/+21
| | | | | | | v2: Add filter enum assertions. Suggested by Jason. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Add _mesa_set_sampler_wrap methodIan Romanick2016-01-111-0/+16
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Remove GL_ARB_sampler_object depth compare error checking.Stefan Dösinger2015-10-071-18/+10
| | | | | | | | | | | | | | | | | Version 3: Simplify the code comment, word wrap commit description. Version 2: Return GL_FALSE if ARB_shadow is unsupported instead of pretending to store the value as suggested by Brian Paul. This fixes a GL error warning on r200 in Wine. The GL_ARB_sampler_objects extension does not specify a dependency on GL_ARB_shadow or GL_ARB_depth_texture for setting the depth texture compare mode and function. Silently ignore attempts to change these settings. They won't matter without a depth texture being assigned anyway. Reviewed-by: Brian Paul <[email protected]>
* mesa: remove Driver.DeleteSamplerObjectMarek Olšák2015-10-031-18/+10
| | | | | | | Nothing overrides it. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add locking to sampler objects.Matt Turner2015-09-251-4/+6
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove debugging code from _mesa_reference_*.Matt Turner2015-09-251-8/+0
| | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[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-10/+10
| | | | | | | 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 sampler object functions"Ian Romanick2015-05-281-7/+0
| | | | | | | This reverts commit 9e7149c8986348bf9567f049444783ef52775f4e. Acked-by: Fredrik Höglund <[email protected]> Cc: "10.6" <[email protected]>
* mesa: Add ARB_direct_state_access checks in sampler object functionsFredrik Höglund2015-05-141-0/+7
| | | | | Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* main: Added entry point for glCreateSamplersMartin Peres2015-03-251-6/+19
| | | | | | | | Because of the current way the code is architectured, there is no functional difference between the DSA and the non-DSA path. Reviewed-by: Laura Ekstrand <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-231-3/+3
| | | | Acked-by: Eric Anholt <[email protected]>
* mesa: Returns correct error values from gl(Get)SamplerParameter*() on GL-ES 3.0+Eduardo Lima Mitev2015-02-191-12/+60
| | | | | | | | | | | | | | | | | | | '3.8.2 Sampler Objects' section of the GL-ES 3.0 specification states: "An INVALID_OPERATION error is generated if sampler is not the name of a sampler object previously returned from a call to GenSamplers." In desktop GL, an GL_INVALID_VALUE is returned instead. Fixes 6 dEQP failing tests: * dEQP-GLES3.functional.negative_api.shader.get_sampler_parameteriv * dEQP-GLES3.functional.negative_api.shader.get_sampler_parameterfv * dEQP-GLES3.functional.negative_api.shader.sampler_parameteri * dEQP-GLES3.functional.negative_api.shader.sampler_parameteriv * dEQP-GLES3.functional.negative_api.shader.sampler_parameterf * dEQP-GLES3.functional.negative_api.shader.sampler_parameterfv Reviewed-by: Matt Turner <[email protected]>
* main: round floating-point value to nearest integer in glGetSamplerParameteriv()Samuel Iglesias Gonsalvez2015-01-131-4/+16
| | | | | | | | | | | | | | | | 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 2 dEQP tests: dEQP-GLES3.functional.state_query.sampler.sampler_texture_min_lod_getsamplerparameteri dEQP-GLES3.functional.state_query.sampler.sampler_texture_max_lod_getsamplerparameteri Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Implement glBindSamplersFredrik Höglund2014-05-021-0/+115
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: Add infrastructure for ARB_multi_bindFredrik Höglund2014-05-021-0/+6
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: switch to c11 mutex functionsBrian Paul2014-03-031-6/+6
| | | | Reviewed-by: José Fonseca <[email protected]>
* mesa: Add infrastructure for GL_ARB_texture_mirror_clamp_to_edge.Rico Schüller2013-10-201-1/+1
| | | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Rico Schüller <[email protected]>
* mesa: Don't allow glSamplerParameteriv(GL_TEXTURE_CUBE_MAP_SEAMLESS) in ESIan Romanick2013-09-081-1/+2
| | | | | | | | | | There is no GL_TEXTURE_CUBE_MAP_SEAMLESS in any version of OpenGL ES or in any extension that applies to OpenGL ES. The same error check already occurs for glTexParameteri. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Cc: Maxence Le Dore <[email protected]>
* mesa: free object labels when deletingTimothy Arceri2013-09-041-0/+1
| | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: GL_EXT_shadow_funcs is not optional with GL_ARB_shadowIan Romanick2013-06-281-9/+3
| | | | | | | | | Every driver left in Mesa that enables one also enables the other. There's no reason to let it be optional. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Restore 78-column wrapping of license text in C-style comments.Kenneth Graunke2013-04-231-3/+4
| | | | | | | | | | | | | | The previous commit introduced extra words, breaking the formatting. This text transformation was done automatically via the following shell command: $ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript where 'vimscript' is a file containing: /THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/\*\// !fmt -w 78 -p ' * ' :wq Reviewed-by: Brian Paul <[email protected]>
* mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | This brings the license text in line with the MIT License as published on the Open Source Initiative website: http://opensource.org/licenses/mit-license.php Generated automatically be the following shell command: $ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {} This introduces some wrapping issues, to be fixed in the next commit. Reviewed-by: Brian Paul <[email protected]>