summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/samplerobj.c
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | | Generated automatically be the following shell command: $ git grep 'BRIAN PAUL BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/BRIAN PAUL/THE AUTHORS/' {} The intention here is to protect all authors, not just Brian Paul. I believe that was already the sensible interpretation, but spelling it out is probably better. More practically, it also prevents people from accidentally copy & pasting the license into a new file which says Brian is not liable when he isn't even one of the authors. Reviewed-by: Brian Paul <[email protected]>
* mesa: remove #include "mfeatures.h" from numerous source filesBrian Paul2013-04-171-1/+0
| | | | | | None of the remaining FEATURE_x symbols in mfeatures.h are used anymore. Reviewed-by: Jordan Justen <[email protected]>
* mesa: fix glGetInteger*(GL_SAMPLER_BINDING).Alan Hourihane2013-03-071-1/+1
| | | | | | | | | | | If the sampler object has been deleted on another context, an alternative context may reference the old sampler. So ensure the sampler object still exists. Note: this is a candidate for the stable branch. Signed-off-by: Alan Hourihane <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* Unreference sampler object when it's currently bound to texture unit.Alan Hourihane2013-03-061-0/+10
| | | | | | | | | | | This change specifically unbinds a sampler object from the texture unit if it's bound to a unit. The spec calls for default object when deleting sampler objects which are currently bound. Note: this is a candidate for the stable branches Signed-off-by: Alan Hourihane <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Initially populate the display list with the exec list.Eric Anholt2013-01-211-24/+0
| | | | | | | | This cuts out a ton of code to make functions not set to a save_ variant match. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Drop manual checks for outside begin/end.Eric Anholt2013-01-211-23/+0
| | | | | | | | | | | We now have a separate dispatch table for begin/end that prevent these functions from being entered during that time. The ASSERT_OUTSIDE_BEGIN_END_WITH_RETVALs are left because I don't want to change any return values or introduce new error-only stubs at this point. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add missing ASSERT_OUTSIDE_BEGIN_END to GetSamplerParameter*Matt Turner2013-01-021-0/+8
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add missing ASSERT_OUTSIDE_BEGIN_END to SamplerParameter*Matt Turner2013-01-021-0/+8
| | | | | | | Commit f22d49de added the SamplerParamter* functions but only used ASSERT_OUTSIDE_BEGIN_END inside the -f and -fv versions. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Mark _mesa_{init,delete}_sampler_object as staticMatt Turner2013-01-021-2/+2
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* dispatch: Make all API functions non-static.Paul Berry2012-11-061-10/+10
| | | | | | | | | | | | | | | | | Some of the functions that we store in the dispatch table are declared as non-static in their .c files and are inserted into the dispatch table directly by _mesa_create_exec_table(). Other functions are declared as static, and are inserted into the dispatch table by a dedicated function that lives in the same .c file (e.g. _mesa_loopback_init_api_table() in api_loopback.c). This patch makes all of these functions non-static, and creates appropriate prototypes for them, so that in future patches we can populate the entire dispatch table using a single code-generated function. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* _mesa_create_exec_table: GLES3 fixes.Paul Berry2012-10-231-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch sets up the dispatch table for the following GLES3 functions when a GLES3 context is in use: - BeginQuery - BeginTransformFeedback - BindSampler - BindTransformFeedback - BlitFramebuffer - ClearBufferfi - ClearBufferfv - ClearBufferiv - ClearBufferuiv - ClientWaitSync - CopyBufferSubData - DeleteQueries - DeleteSamplers - DeleteSync - DeleteTransformFeedbacks - EndQuery - EndTransformFeedback - FenceSync - FramebufferTextureLayer - GenQueries - GenSamplers - GenTransformFeedbacks - GetInteger64v - GetQueryObjectuiv - GetQueryiv - GetSamplerParameterfv - GetSamplerParameteriv - GetStringi - GetSynciv - GetTransformFeedbackVarying - GetVertexAttribIiv - GetVertexAttribIuiv - IsQuery - IsSampler - IsSync - IsTransformFeedback - PauseTransformFeedback - RenderbufferStorageMultisample - ResumeTransformFeedback - SamplerParameterf - SamplerParameterfv - SamplerParameteri - SamplerParameteriv - TransformFeedbackVaryings - VertexAttribDivisor - VertexAttribIPointer - WaitSync And it avoids setting up the dispatch table for these non-GLES3 functions: - ColorMaski - GetBooleani_v - Enablei - Disablei - IsEnabledi - ClearColorIiEXT - ClearColorIuiEXT - TextureStorage2DEXT - TextureStorage3DEXT - GetActiveUniformName - GetnUniformdv - GetnUniformfv - GetnUniformiv - GetnUniformuiv Reviewed-by: Brian Paul <[email protected]> v2: Make the ctx argument to _mesa_init_transform_feedback_dispatch() a const pointer. Add a comment to remind us to add GetBufferParameteri64v once tests exist for it. Also add VertexAttribDivisor for GLES3, and remove GetActiveUniformName and GetnUniform{dv,fv,iv,uiv} for GLES3. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: s/FREE/free/Brian Paul2012-09-011-1/+1
| | | | | | | v2: replace instances in dri/common/ dirs Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Kill GL_ARB_shadow_ambient with fireIan Romanick2012-08-141-1/+0
| | | | | | | | | | No driver supports this extension, and it seems unlikely than any driver ever will. I think r300c may have supported it at one time, but that driver has already been removed. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Allow meta module to call sampler functionsPauli Nieminen2012-08-011-4/+4
| | | | | | | | | To allow meta module to use sample objects mesa GL functions need to be visible and linkable for meta module. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/samplerobj: Support EXT_texture_sRGB_decodePauli Nieminen2012-08-011-0/+55
| | | | | | | | | | | | | | | | | | | | sRGBDecode state is part of sampler object state but mesa was missing handlers to access the state. This patch adds the support for required state changes and queries. GL_EXT_texture_sRGB_decode issue 4: "4) Should we add forward-looking support for ARB_sampler_objects? RESOLVED: YES If ARB_sampler_objects exists in the implementation, the sampler objects should also include this parameter per sampler." Fixes piglit GL_ARB_sampler_objects/GL_EXT_texture_sRGB_decode. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>