2 * Mesa 3-D graphics library
4 * Copyright (C) 2011 VMware, Inc. All Rights Reserved.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
28 * \brief Functions for the GL_ARB_sampler_objects extension.
33 #include "main/glheader.h"
34 #include "main/context.h"
35 #include "main/dispatch.h"
36 #include "main/enums.h"
37 #include "main/hash.h"
38 #include "main/macros.h"
39 #include "main/mtypes.h"
40 #include "main/samplerobj.h"
43 struct gl_sampler_object
*
44 _mesa_lookup_samplerobj(struct gl_context
*ctx
, GLuint name
)
49 return (struct gl_sampler_object
*)
50 _mesa_HashLookup(ctx
->Shared
->SamplerObjects
, name
);
55 begin_samplerobj_lookups(struct gl_context
*ctx
)
57 _mesa_HashLockMutex(ctx
->Shared
->SamplerObjects
);
62 end_samplerobj_lookups(struct gl_context
*ctx
)
64 _mesa_HashUnlockMutex(ctx
->Shared
->SamplerObjects
);
68 static inline struct gl_sampler_object
*
69 lookup_samplerobj_locked(struct gl_context
*ctx
, GLuint name
)
71 return (struct gl_sampler_object
*)
72 _mesa_HashLookupLocked(ctx
->Shared
->SamplerObjects
, name
);
77 * Handle reference counting.
80 _mesa_reference_sampler_object_(struct gl_context
*ctx
,
81 struct gl_sampler_object
**ptr
,
82 struct gl_sampler_object
*samp
)
84 assert(*ptr
!= samp
); /* The inline wrapper should prevent no-op calls */
87 /* Unreference the old sampler */
88 GLboolean deleteFlag
= GL_FALSE
;
89 struct gl_sampler_object
*oldSamp
= *ptr
;
91 /*mtx_lock(&oldSamp->Mutex);*/
92 ASSERT(oldSamp
->RefCount
> 0);
95 printf("SamplerObj %p %d DECR to %d\n",
96 (void *) oldSamp
, oldSamp
->Name
, oldSamp
->RefCount
);
98 deleteFlag
= (oldSamp
->RefCount
== 0);
99 /*mtx_unlock(&oldSamp->Mutex);*/
102 ASSERT(ctx
->Driver
.DeleteSamplerObject
);
103 ctx
->Driver
.DeleteSamplerObject(ctx
, oldSamp
);
111 /* reference new sampler */
112 /*mtx_lock(&samp->Mutex);*/
113 if (samp
->RefCount
== 0) {
114 /* this sampler's being deleted (look just above) */
115 /* Not sure this can every really happen. Warn if it does. */
116 _mesa_problem(NULL
, "referencing deleted sampler object");
122 printf("SamplerObj %p %d INCR to %d\n",
123 (void *) samp
, samp
->Name
, samp
->RefCount
);
127 /*mtx_unlock(&samp->Mutex);*/
133 * Initialize the fields of the given sampler object.
136 _mesa_init_sampler_object(struct gl_sampler_object
*sampObj
, GLuint name
)
138 sampObj
->Name
= name
;
139 sampObj
->RefCount
= 1;
140 sampObj
->WrapS
= GL_REPEAT
;
141 sampObj
->WrapT
= GL_REPEAT
;
142 sampObj
->WrapR
= GL_REPEAT
;
143 sampObj
->MinFilter
= GL_NEAREST_MIPMAP_LINEAR
;
144 sampObj
->MagFilter
= GL_LINEAR
;
145 sampObj
->BorderColor
.f
[0] = 0.0;
146 sampObj
->BorderColor
.f
[1] = 0.0;
147 sampObj
->BorderColor
.f
[2] = 0.0;
148 sampObj
->BorderColor
.f
[3] = 0.0;
149 sampObj
->MinLod
= -1000.0F
;
150 sampObj
->MaxLod
= 1000.0F
;
151 sampObj
->LodBias
= 0.0F
;
152 sampObj
->MaxAnisotropy
= 1.0F
;
153 sampObj
->CompareMode
= GL_NONE
;
154 sampObj
->CompareFunc
= GL_LEQUAL
;
155 sampObj
->sRGBDecode
= GL_DECODE_EXT
;
156 sampObj
->CubeMapSeamless
= GL_FALSE
;
160 * Fallback for ctx->Driver.NewSamplerObject();
162 struct gl_sampler_object
*
163 _mesa_new_sampler_object(struct gl_context
*ctx
, GLuint name
)
165 struct gl_sampler_object
*sampObj
= CALLOC_STRUCT(gl_sampler_object
);
167 _mesa_init_sampler_object(sampObj
, name
);
174 * Fallback for ctx->Driver.DeleteSamplerObject();
177 _mesa_delete_sampler_object(struct gl_context
*ctx
,
178 struct gl_sampler_object
*sampObj
)
180 free(sampObj
->Label
);
186 _mesa_GenSamplers(GLsizei count
, GLuint
*samplers
)
188 GET_CURRENT_CONTEXT(ctx
);
192 if (MESA_VERBOSE
& VERBOSE_API
)
193 _mesa_debug(ctx
, "glGenSamplers(%d)\n", count
);
196 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenSamplers");
203 first
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->SamplerObjects
, count
);
205 /* Insert the ID and pointer to new sampler object into hash table */
206 for (i
= 0; i
< count
; i
++) {
207 struct gl_sampler_object
*sampObj
=
208 ctx
->Driver
.NewSamplerObject(ctx
, first
+ i
);
209 _mesa_HashInsert(ctx
->Shared
->SamplerObjects
, first
+ i
, sampObj
);
210 samplers
[i
] = first
+ i
;
216 _mesa_DeleteSamplers(GLsizei count
, const GLuint
*samplers
)
218 GET_CURRENT_CONTEXT(ctx
);
221 FLUSH_VERTICES(ctx
, 0);
224 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteSamplers(count)");
228 mtx_lock(&ctx
->Shared
->Mutex
);
230 for (i
= 0; i
< count
; i
++) {
233 struct gl_sampler_object
*sampObj
=
234 _mesa_lookup_samplerobj(ctx
, samplers
[i
]);
237 /* If the sampler is currently bound, unbind it. */
238 for (j
= 0; j
< ctx
->Const
.MaxCombinedTextureImageUnits
; j
++) {
239 if (ctx
->Texture
.Unit
[j
].Sampler
== sampObj
) {
240 FLUSH_VERTICES(ctx
, _NEW_TEXTURE
);
241 _mesa_reference_sampler_object(ctx
, &ctx
->Texture
.Unit
[j
].Sampler
, NULL
);
245 /* The ID is immediately freed for re-use */
246 _mesa_HashRemove(ctx
->Shared
->SamplerObjects
, samplers
[i
]);
247 /* But the object exists until its reference count goes to zero */
248 _mesa_reference_sampler_object(ctx
, &sampObj
, NULL
);
253 mtx_unlock(&ctx
->Shared
->Mutex
);
258 _mesa_IsSampler(GLuint sampler
)
260 struct gl_sampler_object
*sampObj
;
261 GET_CURRENT_CONTEXT(ctx
);
263 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
268 sampObj
= _mesa_lookup_samplerobj(ctx
, sampler
);
270 return sampObj
!= NULL
;
275 _mesa_BindSampler(GLuint unit
, GLuint sampler
)
277 struct gl_sampler_object
*sampObj
;
278 GET_CURRENT_CONTEXT(ctx
);
280 if (unit
>= ctx
->Const
.MaxCombinedTextureImageUnits
) {
281 _mesa_error(ctx
, GL_INVALID_VALUE
, "glBindSampler(unit %u)", unit
);
286 /* Use the default sampler object, the one contained in the texture
292 /* user-defined sampler object */
293 sampObj
= _mesa_lookup_samplerobj(ctx
, sampler
);
295 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glBindSampler(sampler)");
300 if (ctx
->Texture
.Unit
[unit
].Sampler
!= sampObj
) {
301 FLUSH_VERTICES(ctx
, _NEW_TEXTURE
);
304 /* bind new sampler */
305 _mesa_reference_sampler_object(ctx
, &ctx
->Texture
.Unit
[unit
].Sampler
,
311 _mesa_BindSamplers(GLuint first
, GLsizei count
, const GLuint
*samplers
)
313 GET_CURRENT_CONTEXT(ctx
);
316 /* The ARB_multi_bind spec says:
318 * "An INVALID_OPERATION error is generated if <first> + <count> is
319 * greater than the number of texture image units supported by
320 * the implementation."
322 if (first
+ count
> ctx
->Const
.MaxCombinedTextureImageUnits
) {
323 _mesa_error(ctx
, GL_INVALID_OPERATION
,
324 "glBindSamplers(first=%u + count=%d > the value of "
325 "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS=%u)",
326 first
, count
, ctx
->Const
.MaxCombinedTextureImageUnits
);
330 FLUSH_VERTICES(ctx
, 0);
333 /* Note that the error semantics for multi-bind commands differ from
334 * those of other GL commands.
336 * The Issues section in the ARB_multi_bind spec says:
338 * "(11) Typically, OpenGL specifies that if an error is generated by
339 * a command, that command has no effect. This is somewhat
340 * unfortunate for multi-bind commands, because it would require
341 * a first pass to scan the entire list of bound objects for
342 * errors and then a second pass to actually perform the
343 * bindings. Should we have different error semantics?
345 * RESOLVED: Yes. In this specification, when the parameters for
346 * one of the <count> binding points are invalid, that binding
347 * point is not updated and an error will be generated. However,
348 * other binding points in the same command will be updated if
349 * their parameters are valid and no other error occurs."
352 begin_samplerobj_lookups(ctx
);
354 for (i
= 0; i
< count
; i
++) {
355 const GLuint unit
= first
+ i
;
356 struct gl_sampler_object
* const currentSampler
=
357 ctx
->Texture
.Unit
[unit
].Sampler
;
358 struct gl_sampler_object
*sampObj
;
360 if (samplers
[i
] != 0) {
361 if (currentSampler
&& currentSampler
->Name
== samplers
[i
])
362 sampObj
= currentSampler
;
364 sampObj
= lookup_samplerobj_locked(ctx
, samplers
[i
]);
366 /* The ARB_multi_bind spec says:
368 * "An INVALID_OPERATION error is generated if any value
369 * in <samplers> is not zero or the name of an existing
370 * sampler object (per binding)."
373 _mesa_error(ctx
, GL_INVALID_OPERATION
,
374 "glBindSamplers(samplers[%d]=%u is not zero or "
375 "the name of an existing sampler object)",
383 /* Bind the new sampler */
384 if (sampObj
!= currentSampler
) {
385 _mesa_reference_sampler_object(ctx
,
386 &ctx
->Texture
.Unit
[unit
].Sampler
,
388 ctx
->NewState
|= _NEW_TEXTURE
;
392 end_samplerobj_lookups(ctx
);
394 /* Unbind all samplers in the range <first> through <first>+<count>-1 */
395 for (i
= 0; i
< count
; i
++) {
396 const GLuint unit
= first
+ i
;
398 if (ctx
->Texture
.Unit
[unit
].Sampler
) {
399 _mesa_reference_sampler_object(ctx
,
400 &ctx
->Texture
.Unit
[unit
].Sampler
,
402 ctx
->NewState
|= _NEW_TEXTURE
;
410 * Check if a coordinate wrap mode is legal.
411 * \return GL_TRUE if legal, GL_FALSE otherwise
414 validate_texture_wrap_mode(struct gl_context
*ctx
, GLenum wrap
)
416 const struct gl_extensions
* const e
= &ctx
->Extensions
;
420 case GL_CLAMP_TO_EDGE
:
422 case GL_MIRRORED_REPEAT
:
424 case GL_CLAMP_TO_BORDER
:
425 return e
->ARB_texture_border_clamp
;
426 case GL_MIRROR_CLAMP_EXT
:
427 return e
->ATI_texture_mirror_once
|| e
->EXT_texture_mirror_clamp
;
428 case GL_MIRROR_CLAMP_TO_EDGE_EXT
:
429 return e
->ATI_texture_mirror_once
|| e
->EXT_texture_mirror_clamp
|| e
->ARB_texture_mirror_clamp_to_edge
;
430 case GL_MIRROR_CLAMP_TO_BORDER_EXT
:
431 return e
->EXT_texture_mirror_clamp
;
439 * This is called just prior to changing any sampler object state.
442 flush(struct gl_context
*ctx
)
444 FLUSH_VERTICES(ctx
, _NEW_TEXTURE
);
448 #define INVALID_PARAM 0x100
449 #define INVALID_PNAME 0x101
450 #define INVALID_VALUE 0x102
453 set_sampler_wrap_s(struct gl_context
*ctx
, struct gl_sampler_object
*samp
,
456 if (samp
->WrapS
== param
)
458 if (validate_texture_wrap_mode(ctx
, param
)) {
463 return INVALID_PARAM
;
468 set_sampler_wrap_t(struct gl_context
*ctx
, struct gl_sampler_object
*samp
,
471 if (samp
->WrapT
== param
)
473 if (validate_texture_wrap_mode(ctx
, param
)) {
478 return INVALID_PARAM
;
483 set_sampler_wrap_r(struct gl_context
*ctx
, struct gl_sampler_object
*samp
,
486 if (samp
->WrapR
== param
)
488 if (validate_texture_wrap_mode(ctx
, param
)) {
493 return INVALID_PARAM
;
498 set_sampler_min_filter(struct gl_context
*ctx
, struct gl_sampler_object
*samp
,
501 if (samp
->MinFilter
== param
)
507 case GL_NEAREST_MIPMAP_NEAREST
:
508 case GL_LINEAR_MIPMAP_NEAREST
:
509 case GL_NEAREST_MIPMAP_LINEAR
:
510 case GL_LINEAR_MIPMAP_LINEAR
:
512 samp
->MinFilter
= param
;
515 return INVALID_PARAM
;
521 set_sampler_mag_filter(struct gl_context
*ctx
, struct gl_sampler_object
*samp
,
524 if (samp
->MagFilter
== param
)
531 samp
->MagFilter
= param
;
534 return INVALID_PARAM
;
540 set_sampler_lod_bias(struct gl_context
*ctx
, struct gl_sampler_object
*samp
,
543 if (samp
->LodBias
== param
)
547 samp
->LodBias
= param
;
553 set_sampler_border_colorf(struct gl_context
*ctx
,
554 struct gl_sampler_object
*samp
,
555 const GLfloat params
[4])
558 samp
->BorderColor
.f
[RCOMP
] = params
[0];
559 samp
->BorderColor
.f
[GCOMP
] = params
[1];
560 samp
->BorderColor
.f
[BCOMP
] = params
[2];
561 samp
->BorderColor
.f
[ACOMP
] = params
[3];
567 set_sampler_border_colori(struct gl_context
*ctx
,
568 struct gl_sampler_object
*samp
,
569 const GLint params
[4])
572 samp
->BorderColor
.i
[RCOMP
] = params
[0];
573 samp
->BorderColor
.i
[GCOMP
] = params
[1];
574 samp
->BorderColor
.i
[BCOMP
] = params
[2];
575 samp
->BorderColor
.i
[ACOMP
] = params
[3];
581 set_sampler_border_colorui(struct gl_context
*ctx
,
582 struct gl_sampler_object
*samp
,
583 const GLuint params
[4])
586 samp
->BorderColor
.ui
[RCOMP
] = params
[0];
587 samp
->BorderColor
.ui
[GCOMP
] = params
[1];
588 samp
->BorderColor
.ui
[BCOMP
] = params
[2];
589 samp
->BorderColor
.ui
[ACOMP
] = params
[3];
595 set_sampler_min_lod(struct gl_context
*ctx
, struct gl_sampler_object
*samp
,
598 if (samp
->MinLod
== param
)
602 samp
->MinLod
= param
;
608 set_sampler_max_lod(struct gl_context
*ctx
, struct gl_sampler_object
*samp
,
611 if (samp
->MaxLod
== param
)
615 samp
->MaxLod
= param
;
621 set_sampler_compare_mode(struct gl_context
*ctx
,
622 struct gl_sampler_object
*samp
, GLint param
)
624 if (!ctx
->Extensions
.ARB_shadow
)
625 return INVALID_PNAME
;
627 if (samp
->CompareMode
== param
)
630 if (param
== GL_NONE
||
631 param
== GL_COMPARE_R_TO_TEXTURE_ARB
) {
633 samp
->CompareMode
= param
;
637 return INVALID_PARAM
;
642 set_sampler_compare_func(struct gl_context
*ctx
,
643 struct gl_sampler_object
*samp
, GLint param
)
645 if (!ctx
->Extensions
.ARB_shadow
)
646 return INVALID_PNAME
;
648 if (samp
->CompareFunc
== param
)
661 samp
->CompareFunc
= param
;
664 return INVALID_PARAM
;
670 set_sampler_max_anisotropy(struct gl_context
*ctx
,
671 struct gl_sampler_object
*samp
, GLfloat param
)
673 if (!ctx
->Extensions
.EXT_texture_filter_anisotropic
)
674 return INVALID_PNAME
;
676 if (samp
->MaxAnisotropy
== param
)
680 return INVALID_VALUE
;
683 /* clamp to max, that's what NVIDIA does */
684 samp
->MaxAnisotropy
= MIN2(param
, ctx
->Const
.MaxTextureMaxAnisotropy
);
690 set_sampler_cube_map_seamless(struct gl_context
*ctx
,
691 struct gl_sampler_object
*samp
, GLboolean param
)
693 if (!_mesa_is_desktop_gl(ctx
)
694 || !ctx
->Extensions
.AMD_seamless_cubemap_per_texture
)
695 return INVALID_PNAME
;
697 if (samp
->CubeMapSeamless
== param
)
700 if (param
!= GL_TRUE
&& param
!= GL_FALSE
)
701 return INVALID_VALUE
;
704 samp
->CubeMapSeamless
= param
;
709 set_sampler_srgb_decode(struct gl_context
*ctx
,
710 struct gl_sampler_object
*samp
, GLenum param
)
712 if (!ctx
->Extensions
.EXT_texture_sRGB_decode
)
713 return INVALID_PNAME
;
715 if (samp
->sRGBDecode
== param
)
718 if (param
!= GL_DECODE_EXT
&& param
!= GL_SKIP_DECODE_EXT
)
719 return INVALID_VALUE
;
722 samp
->sRGBDecode
= param
;
727 _mesa_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
729 struct gl_sampler_object
*sampObj
;
731 GET_CURRENT_CONTEXT(ctx
);
733 sampObj
= _mesa_lookup_samplerobj(ctx
, sampler
);
735 _mesa_error(ctx
, GL_INVALID_VALUE
, "glSamplerParameteri(sampler %u)",
741 case GL_TEXTURE_WRAP_S
:
742 res
= set_sampler_wrap_s(ctx
, sampObj
, param
);
744 case GL_TEXTURE_WRAP_T
:
745 res
= set_sampler_wrap_t(ctx
, sampObj
, param
);
747 case GL_TEXTURE_WRAP_R
:
748 res
= set_sampler_wrap_r(ctx
, sampObj
, param
);
750 case GL_TEXTURE_MIN_FILTER
:
751 res
= set_sampler_min_filter(ctx
, sampObj
, param
);
753 case GL_TEXTURE_MAG_FILTER
:
754 res
= set_sampler_mag_filter(ctx
, sampObj
, param
);
756 case GL_TEXTURE_MIN_LOD
:
757 res
= set_sampler_min_lod(ctx
, sampObj
, (GLfloat
) param
);
759 case GL_TEXTURE_MAX_LOD
:
760 res
= set_sampler_max_lod(ctx
, sampObj
, (GLfloat
) param
);
762 case GL_TEXTURE_LOD_BIAS
:
763 res
= set_sampler_lod_bias(ctx
, sampObj
, (GLfloat
) param
);
765 case GL_TEXTURE_COMPARE_MODE
:
766 res
= set_sampler_compare_mode(ctx
, sampObj
, param
);
768 case GL_TEXTURE_COMPARE_FUNC
:
769 res
= set_sampler_compare_func(ctx
, sampObj
, param
);
771 case GL_TEXTURE_MAX_ANISOTROPY_EXT
:
772 res
= set_sampler_max_anisotropy(ctx
, sampObj
, (GLfloat
) param
);
774 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
775 res
= set_sampler_cube_map_seamless(ctx
, sampObj
, param
);
777 case GL_TEXTURE_SRGB_DECODE_EXT
:
778 res
= set_sampler_srgb_decode(ctx
, sampObj
, param
);
780 case GL_TEXTURE_BORDER_COLOR
:
791 /* state change - we do nothing special at this time */
794 _mesa_error(ctx
, GL_INVALID_ENUM
, "glSamplerParameteri(pname=%s)\n",
795 _mesa_lookup_enum_by_nr(pname
));
798 _mesa_error(ctx
, GL_INVALID_ENUM
, "glSamplerParameteri(param=%d)\n",
802 _mesa_error(ctx
, GL_INVALID_VALUE
, "glSamplerParameteri(param=%d)\n",
812 _mesa_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
814 struct gl_sampler_object
*sampObj
;
816 GET_CURRENT_CONTEXT(ctx
);
818 sampObj
= _mesa_lookup_samplerobj(ctx
, sampler
);
820 _mesa_error(ctx
, GL_INVALID_VALUE
, "glSamplerParameterf(sampler %u)",
826 case GL_TEXTURE_WRAP_S
:
827 res
= set_sampler_wrap_s(ctx
, sampObj
, (GLint
) param
);
829 case GL_TEXTURE_WRAP_T
:
830 res
= set_sampler_wrap_t(ctx
, sampObj
, (GLint
) param
);
832 case GL_TEXTURE_WRAP_R
:
833 res
= set_sampler_wrap_r(ctx
, sampObj
, (GLint
) param
);
835 case GL_TEXTURE_MIN_FILTER
:
836 res
= set_sampler_min_filter(ctx
, sampObj
, (GLint
) param
);
838 case GL_TEXTURE_MAG_FILTER
:
839 res
= set_sampler_mag_filter(ctx
, sampObj
, (GLint
) param
);
841 case GL_TEXTURE_MIN_LOD
:
842 res
= set_sampler_min_lod(ctx
, sampObj
, param
);
844 case GL_TEXTURE_MAX_LOD
:
845 res
= set_sampler_max_lod(ctx
, sampObj
, param
);
847 case GL_TEXTURE_LOD_BIAS
:
848 res
= set_sampler_lod_bias(ctx
, sampObj
, param
);
850 case GL_TEXTURE_COMPARE_MODE
:
851 res
= set_sampler_compare_mode(ctx
, sampObj
, (GLint
) param
);
853 case GL_TEXTURE_COMPARE_FUNC
:
854 res
= set_sampler_compare_func(ctx
, sampObj
, (GLint
) param
);
856 case GL_TEXTURE_MAX_ANISOTROPY_EXT
:
857 res
= set_sampler_max_anisotropy(ctx
, sampObj
, param
);
859 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
860 res
= set_sampler_cube_map_seamless(ctx
, sampObj
, (GLboolean
) param
);
862 case GL_TEXTURE_SRGB_DECODE_EXT
:
863 res
= set_sampler_srgb_decode(ctx
, sampObj
, (GLenum
) param
);
865 case GL_TEXTURE_BORDER_COLOR
:
876 /* state change - we do nothing special at this time */
879 _mesa_error(ctx
, GL_INVALID_ENUM
, "glSamplerParameterf(pname=%s)\n",
880 _mesa_lookup_enum_by_nr(pname
));
883 _mesa_error(ctx
, GL_INVALID_ENUM
, "glSamplerParameterf(param=%f)\n",
887 _mesa_error(ctx
, GL_INVALID_VALUE
, "glSamplerParameterf(param=%f)\n",
896 _mesa_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
898 struct gl_sampler_object
*sampObj
;
900 GET_CURRENT_CONTEXT(ctx
);
902 sampObj
= _mesa_lookup_samplerobj(ctx
, sampler
);
904 _mesa_error(ctx
, GL_INVALID_VALUE
, "glSamplerParameteriv(sampler %u)",
910 case GL_TEXTURE_WRAP_S
:
911 res
= set_sampler_wrap_s(ctx
, sampObj
, params
[0]);
913 case GL_TEXTURE_WRAP_T
:
914 res
= set_sampler_wrap_t(ctx
, sampObj
, params
[0]);
916 case GL_TEXTURE_WRAP_R
:
917 res
= set_sampler_wrap_r(ctx
, sampObj
, params
[0]);
919 case GL_TEXTURE_MIN_FILTER
:
920 res
= set_sampler_min_filter(ctx
, sampObj
, params
[0]);
922 case GL_TEXTURE_MAG_FILTER
:
923 res
= set_sampler_mag_filter(ctx
, sampObj
, params
[0]);
925 case GL_TEXTURE_MIN_LOD
:
926 res
= set_sampler_min_lod(ctx
, sampObj
, (GLfloat
) params
[0]);
928 case GL_TEXTURE_MAX_LOD
:
929 res
= set_sampler_max_lod(ctx
, sampObj
, (GLfloat
) params
[0]);
931 case GL_TEXTURE_LOD_BIAS
:
932 res
= set_sampler_lod_bias(ctx
, sampObj
, (GLfloat
) params
[0]);
934 case GL_TEXTURE_COMPARE_MODE
:
935 res
= set_sampler_compare_mode(ctx
, sampObj
, params
[0]);
937 case GL_TEXTURE_COMPARE_FUNC
:
938 res
= set_sampler_compare_func(ctx
, sampObj
, params
[0]);
940 case GL_TEXTURE_MAX_ANISOTROPY_EXT
:
941 res
= set_sampler_max_anisotropy(ctx
, sampObj
, (GLfloat
) params
[0]);
943 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
944 res
= set_sampler_cube_map_seamless(ctx
, sampObj
, params
[0]);
946 case GL_TEXTURE_SRGB_DECODE_EXT
:
947 res
= set_sampler_srgb_decode(ctx
, sampObj
, params
[0]);
949 case GL_TEXTURE_BORDER_COLOR
:
952 c
[0] = INT_TO_FLOAT(params
[0]);
953 c
[1] = INT_TO_FLOAT(params
[1]);
954 c
[2] = INT_TO_FLOAT(params
[2]);
955 c
[3] = INT_TO_FLOAT(params
[3]);
956 res
= set_sampler_border_colorf(ctx
, sampObj
, c
);
968 /* state change - we do nothing special at this time */
971 _mesa_error(ctx
, GL_INVALID_ENUM
, "glSamplerParameteriv(pname=%s)\n",
972 _mesa_lookup_enum_by_nr(pname
));
975 _mesa_error(ctx
, GL_INVALID_ENUM
, "glSamplerParameteriv(param=%d)\n",
979 _mesa_error(ctx
, GL_INVALID_VALUE
, "glSamplerParameteriv(param=%d)\n",
988 _mesa_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
990 struct gl_sampler_object
*sampObj
;
992 GET_CURRENT_CONTEXT(ctx
);
994 sampObj
= _mesa_lookup_samplerobj(ctx
, sampler
);
996 _mesa_error(ctx
, GL_INVALID_VALUE
, "glSamplerParameterfv(sampler %u)",
1002 case GL_TEXTURE_WRAP_S
:
1003 res
= set_sampler_wrap_s(ctx
, sampObj
, (GLint
) params
[0]);
1005 case GL_TEXTURE_WRAP_T
:
1006 res
= set_sampler_wrap_t(ctx
, sampObj
, (GLint
) params
[0]);
1008 case GL_TEXTURE_WRAP_R
:
1009 res
= set_sampler_wrap_r(ctx
, sampObj
, (GLint
) params
[0]);
1011 case GL_TEXTURE_MIN_FILTER
:
1012 res
= set_sampler_min_filter(ctx
, sampObj
, (GLint
) params
[0]);
1014 case GL_TEXTURE_MAG_FILTER
:
1015 res
= set_sampler_mag_filter(ctx
, sampObj
, (GLint
) params
[0]);
1017 case GL_TEXTURE_MIN_LOD
:
1018 res
= set_sampler_min_lod(ctx
, sampObj
, params
[0]);
1020 case GL_TEXTURE_MAX_LOD
:
1021 res
= set_sampler_max_lod(ctx
, sampObj
, params
[0]);
1023 case GL_TEXTURE_LOD_BIAS
:
1024 res
= set_sampler_lod_bias(ctx
, sampObj
, params
[0]);
1026 case GL_TEXTURE_COMPARE_MODE
:
1027 res
= set_sampler_compare_mode(ctx
, sampObj
, (GLint
) params
[0]);
1029 case GL_TEXTURE_COMPARE_FUNC
:
1030 res
= set_sampler_compare_func(ctx
, sampObj
, (GLint
) params
[0]);
1032 case GL_TEXTURE_MAX_ANISOTROPY_EXT
:
1033 res
= set_sampler_max_anisotropy(ctx
, sampObj
, params
[0]);
1035 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
1036 res
= set_sampler_cube_map_seamless(ctx
, sampObj
, (GLboolean
) params
[0]);
1038 case GL_TEXTURE_SRGB_DECODE_EXT
:
1039 res
= set_sampler_srgb_decode(ctx
, sampObj
, (GLenum
) params
[0]);
1041 case GL_TEXTURE_BORDER_COLOR
:
1042 res
= set_sampler_border_colorf(ctx
, sampObj
, params
);
1045 res
= INVALID_PNAME
;
1053 /* state change - we do nothing special at this time */
1056 _mesa_error(ctx
, GL_INVALID_ENUM
, "glSamplerParameterfv(pname=%s)\n",
1057 _mesa_lookup_enum_by_nr(pname
));
1060 _mesa_error(ctx
, GL_INVALID_ENUM
, "glSamplerParameterfv(param=%f)\n",
1064 _mesa_error(ctx
, GL_INVALID_VALUE
, "glSamplerParameterfv(param=%f)\n",
1073 _mesa_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
1075 struct gl_sampler_object
*sampObj
;
1077 GET_CURRENT_CONTEXT(ctx
);
1079 sampObj
= _mesa_lookup_samplerobj(ctx
, sampler
);
1081 _mesa_error(ctx
, GL_INVALID_VALUE
, "glSamplerParameterIiv(sampler %u)",
1087 case GL_TEXTURE_WRAP_S
:
1088 res
= set_sampler_wrap_s(ctx
, sampObj
, params
[0]);
1090 case GL_TEXTURE_WRAP_T
:
1091 res
= set_sampler_wrap_t(ctx
, sampObj
, params
[0]);
1093 case GL_TEXTURE_WRAP_R
:
1094 res
= set_sampler_wrap_r(ctx
, sampObj
, params
[0]);
1096 case GL_TEXTURE_MIN_FILTER
:
1097 res
= set_sampler_min_filter(ctx
, sampObj
, params
[0]);
1099 case GL_TEXTURE_MAG_FILTER
:
1100 res
= set_sampler_mag_filter(ctx
, sampObj
, params
[0]);
1102 case GL_TEXTURE_MIN_LOD
:
1103 res
= set_sampler_min_lod(ctx
, sampObj
, (GLfloat
) params
[0]);
1105 case GL_TEXTURE_MAX_LOD
:
1106 res
= set_sampler_max_lod(ctx
, sampObj
, (GLfloat
) params
[0]);
1108 case GL_TEXTURE_LOD_BIAS
:
1109 res
= set_sampler_lod_bias(ctx
, sampObj
, (GLfloat
) params
[0]);
1111 case GL_TEXTURE_COMPARE_MODE
:
1112 res
= set_sampler_compare_mode(ctx
, sampObj
, params
[0]);
1114 case GL_TEXTURE_COMPARE_FUNC
:
1115 res
= set_sampler_compare_func(ctx
, sampObj
, params
[0]);
1117 case GL_TEXTURE_MAX_ANISOTROPY_EXT
:
1118 res
= set_sampler_max_anisotropy(ctx
, sampObj
, (GLfloat
) params
[0]);
1120 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
1121 res
= set_sampler_cube_map_seamless(ctx
, sampObj
, params
[0]);
1123 case GL_TEXTURE_SRGB_DECODE_EXT
:
1124 res
= set_sampler_srgb_decode(ctx
, sampObj
, (GLenum
) params
[0]);
1126 case GL_TEXTURE_BORDER_COLOR
:
1127 res
= set_sampler_border_colori(ctx
, sampObj
, params
);
1130 res
= INVALID_PNAME
;
1138 /* state change - we do nothing special at this time */
1141 _mesa_error(ctx
, GL_INVALID_ENUM
, "glSamplerParameterIiv(pname=%s)\n",
1142 _mesa_lookup_enum_by_nr(pname
));
1145 _mesa_error(ctx
, GL_INVALID_ENUM
, "glSamplerParameterIiv(param=%d)\n",
1149 _mesa_error(ctx
, GL_INVALID_VALUE
, "glSamplerParameterIiv(param=%d)\n",
1159 _mesa_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
1161 struct gl_sampler_object
*sampObj
;
1163 GET_CURRENT_CONTEXT(ctx
);
1165 sampObj
= _mesa_lookup_samplerobj(ctx
, sampler
);
1167 _mesa_error(ctx
, GL_INVALID_VALUE
, "glSamplerParameterIuiv(sampler %u)",
1173 case GL_TEXTURE_WRAP_S
:
1174 res
= set_sampler_wrap_s(ctx
, sampObj
, params
[0]);
1176 case GL_TEXTURE_WRAP_T
:
1177 res
= set_sampler_wrap_t(ctx
, sampObj
, params
[0]);
1179 case GL_TEXTURE_WRAP_R
:
1180 res
= set_sampler_wrap_r(ctx
, sampObj
, params
[0]);
1182 case GL_TEXTURE_MIN_FILTER
:
1183 res
= set_sampler_min_filter(ctx
, sampObj
, params
[0]);
1185 case GL_TEXTURE_MAG_FILTER
:
1186 res
= set_sampler_mag_filter(ctx
, sampObj
, params
[0]);
1188 case GL_TEXTURE_MIN_LOD
:
1189 res
= set_sampler_min_lod(ctx
, sampObj
, (GLfloat
) params
[0]);
1191 case GL_TEXTURE_MAX_LOD
:
1192 res
= set_sampler_max_lod(ctx
, sampObj
, (GLfloat
) params
[0]);
1194 case GL_TEXTURE_LOD_BIAS
:
1195 res
= set_sampler_lod_bias(ctx
, sampObj
, (GLfloat
) params
[0]);
1197 case GL_TEXTURE_COMPARE_MODE
:
1198 res
= set_sampler_compare_mode(ctx
, sampObj
, params
[0]);
1200 case GL_TEXTURE_COMPARE_FUNC
:
1201 res
= set_sampler_compare_func(ctx
, sampObj
, params
[0]);
1203 case GL_TEXTURE_MAX_ANISOTROPY_EXT
:
1204 res
= set_sampler_max_anisotropy(ctx
, sampObj
, (GLfloat
) params
[0]);
1206 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
1207 res
= set_sampler_cube_map_seamless(ctx
, sampObj
, params
[0]);
1209 case GL_TEXTURE_SRGB_DECODE_EXT
:
1210 res
= set_sampler_srgb_decode(ctx
, sampObj
, (GLenum
) params
[0]);
1212 case GL_TEXTURE_BORDER_COLOR
:
1213 res
= set_sampler_border_colorui(ctx
, sampObj
, params
);
1216 res
= INVALID_PNAME
;
1224 /* state change - we do nothing special at this time */
1227 _mesa_error(ctx
, GL_INVALID_ENUM
, "glSamplerParameterIuiv(pname=%s)\n",
1228 _mesa_lookup_enum_by_nr(pname
));
1231 _mesa_error(ctx
, GL_INVALID_ENUM
, "glSamplerParameterIuiv(param=%u)\n",
1235 _mesa_error(ctx
, GL_INVALID_VALUE
, "glSamplerParameterIuiv(param=%u)\n",
1245 _mesa_GetSamplerParameteriv(GLuint sampler
, GLenum pname
, GLint
*params
)
1247 struct gl_sampler_object
*sampObj
;
1248 GET_CURRENT_CONTEXT(ctx
);
1250 sampObj
= _mesa_lookup_samplerobj(ctx
, sampler
);
1252 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGetSamplerParameteriv(sampler %u)",
1258 case GL_TEXTURE_WRAP_S
:
1259 *params
= sampObj
->WrapS
;
1261 case GL_TEXTURE_WRAP_T
:
1262 *params
= sampObj
->WrapT
;
1264 case GL_TEXTURE_WRAP_R
:
1265 *params
= sampObj
->WrapR
;
1267 case GL_TEXTURE_MIN_FILTER
:
1268 *params
= sampObj
->MinFilter
;
1270 case GL_TEXTURE_MAG_FILTER
:
1271 *params
= sampObj
->MagFilter
;
1273 case GL_TEXTURE_MIN_LOD
:
1274 *params
= (GLint
) sampObj
->MinLod
;
1276 case GL_TEXTURE_MAX_LOD
:
1277 *params
= (GLint
) sampObj
->MaxLod
;
1279 case GL_TEXTURE_LOD_BIAS
:
1280 *params
= (GLint
) sampObj
->LodBias
;
1282 case GL_TEXTURE_COMPARE_MODE
:
1283 if (!ctx
->Extensions
.ARB_shadow
)
1285 *params
= sampObj
->CompareMode
;
1287 case GL_TEXTURE_COMPARE_FUNC
:
1288 if (!ctx
->Extensions
.ARB_shadow
)
1290 *params
= sampObj
->CompareFunc
;
1292 case GL_TEXTURE_MAX_ANISOTROPY_EXT
:
1293 *params
= (GLint
) sampObj
->MaxAnisotropy
;
1295 case GL_TEXTURE_BORDER_COLOR
:
1296 params
[0] = FLOAT_TO_INT(sampObj
->BorderColor
.f
[0]);
1297 params
[1] = FLOAT_TO_INT(sampObj
->BorderColor
.f
[1]);
1298 params
[2] = FLOAT_TO_INT(sampObj
->BorderColor
.f
[2]);
1299 params
[3] = FLOAT_TO_INT(sampObj
->BorderColor
.f
[3]);
1301 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
1302 if (!ctx
->Extensions
.AMD_seamless_cubemap_per_texture
)
1304 *params
= sampObj
->CubeMapSeamless
;
1306 case GL_TEXTURE_SRGB_DECODE_EXT
:
1307 if (!ctx
->Extensions
.EXT_texture_sRGB_decode
)
1309 *params
= (GLenum
) sampObj
->sRGBDecode
;
1317 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetSamplerParameteriv(pname=%s)",
1318 _mesa_lookup_enum_by_nr(pname
));
1323 _mesa_GetSamplerParameterfv(GLuint sampler
, GLenum pname
, GLfloat
*params
)
1325 struct gl_sampler_object
*sampObj
;
1326 GET_CURRENT_CONTEXT(ctx
);
1328 sampObj
= _mesa_lookup_samplerobj(ctx
, sampler
);
1330 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGetSamplerParameterfv(sampler %u)",
1336 case GL_TEXTURE_WRAP_S
:
1337 *params
= (GLfloat
) sampObj
->WrapS
;
1339 case GL_TEXTURE_WRAP_T
:
1340 *params
= (GLfloat
) sampObj
->WrapT
;
1342 case GL_TEXTURE_WRAP_R
:
1343 *params
= (GLfloat
) sampObj
->WrapR
;
1345 case GL_TEXTURE_MIN_FILTER
:
1346 *params
= (GLfloat
) sampObj
->MinFilter
;
1348 case GL_TEXTURE_MAG_FILTER
:
1349 *params
= (GLfloat
) sampObj
->MagFilter
;
1351 case GL_TEXTURE_MIN_LOD
:
1352 *params
= sampObj
->MinLod
;
1354 case GL_TEXTURE_MAX_LOD
:
1355 *params
= sampObj
->MaxLod
;
1357 case GL_TEXTURE_LOD_BIAS
:
1358 *params
= sampObj
->LodBias
;
1360 case GL_TEXTURE_COMPARE_MODE
:
1361 if (!ctx
->Extensions
.ARB_shadow
)
1363 *params
= (GLfloat
) sampObj
->CompareMode
;
1365 case GL_TEXTURE_COMPARE_FUNC
:
1366 if (!ctx
->Extensions
.ARB_shadow
)
1368 *params
= (GLfloat
) sampObj
->CompareFunc
;
1370 case GL_TEXTURE_MAX_ANISOTROPY_EXT
:
1371 *params
= sampObj
->MaxAnisotropy
;
1373 case GL_TEXTURE_BORDER_COLOR
:
1374 params
[0] = sampObj
->BorderColor
.f
[0];
1375 params
[1] = sampObj
->BorderColor
.f
[1];
1376 params
[2] = sampObj
->BorderColor
.f
[2];
1377 params
[3] = sampObj
->BorderColor
.f
[3];
1379 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
1380 if (!ctx
->Extensions
.AMD_seamless_cubemap_per_texture
)
1382 *params
= (GLfloat
) sampObj
->CubeMapSeamless
;
1384 case GL_TEXTURE_SRGB_DECODE_EXT
:
1385 if (!ctx
->Extensions
.EXT_texture_sRGB_decode
)
1387 *params
= (GLfloat
) sampObj
->sRGBDecode
;
1395 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetSamplerParameterfv(pname=%s)",
1396 _mesa_lookup_enum_by_nr(pname
));
1401 _mesa_GetSamplerParameterIiv(GLuint sampler
, GLenum pname
, GLint
*params
)
1403 struct gl_sampler_object
*sampObj
;
1404 GET_CURRENT_CONTEXT(ctx
);
1406 sampObj
= _mesa_lookup_samplerobj(ctx
, sampler
);
1408 _mesa_error(ctx
, GL_INVALID_VALUE
,
1409 "glGetSamplerParameterIiv(sampler %u)",
1415 case GL_TEXTURE_WRAP_S
:
1416 *params
= sampObj
->WrapS
;
1418 case GL_TEXTURE_WRAP_T
:
1419 *params
= sampObj
->WrapT
;
1421 case GL_TEXTURE_WRAP_R
:
1422 *params
= sampObj
->WrapR
;
1424 case GL_TEXTURE_MIN_FILTER
:
1425 *params
= sampObj
->MinFilter
;
1427 case GL_TEXTURE_MAG_FILTER
:
1428 *params
= sampObj
->MagFilter
;
1430 case GL_TEXTURE_MIN_LOD
:
1431 *params
= (GLint
) sampObj
->MinLod
;
1433 case GL_TEXTURE_MAX_LOD
:
1434 *params
= (GLint
) sampObj
->MaxLod
;
1436 case GL_TEXTURE_LOD_BIAS
:
1437 *params
= (GLint
) sampObj
->LodBias
;
1439 case GL_TEXTURE_COMPARE_MODE
:
1440 if (!ctx
->Extensions
.ARB_shadow
)
1442 *params
= sampObj
->CompareMode
;
1444 case GL_TEXTURE_COMPARE_FUNC
:
1445 if (!ctx
->Extensions
.ARB_shadow
)
1447 *params
= sampObj
->CompareFunc
;
1449 case GL_TEXTURE_MAX_ANISOTROPY_EXT
:
1450 *params
= (GLint
) sampObj
->MaxAnisotropy
;
1452 case GL_TEXTURE_BORDER_COLOR
:
1453 params
[0] = sampObj
->BorderColor
.i
[0];
1454 params
[1] = sampObj
->BorderColor
.i
[1];
1455 params
[2] = sampObj
->BorderColor
.i
[2];
1456 params
[3] = sampObj
->BorderColor
.i
[3];
1458 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
1459 if (!ctx
->Extensions
.AMD_seamless_cubemap_per_texture
)
1461 *params
= sampObj
->CubeMapSeamless
;
1463 case GL_TEXTURE_SRGB_DECODE_EXT
:
1464 if (!ctx
->Extensions
.EXT_texture_sRGB_decode
)
1466 *params
= (GLenum
) sampObj
->sRGBDecode
;
1474 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetSamplerParameterIiv(pname=%s)",
1475 _mesa_lookup_enum_by_nr(pname
));
1480 _mesa_GetSamplerParameterIuiv(GLuint sampler
, GLenum pname
, GLuint
*params
)
1482 struct gl_sampler_object
*sampObj
;
1483 GET_CURRENT_CONTEXT(ctx
);
1485 sampObj
= _mesa_lookup_samplerobj(ctx
, sampler
);
1487 _mesa_error(ctx
, GL_INVALID_VALUE
,
1488 "glGetSamplerParameterIuiv(sampler %u)",
1494 case GL_TEXTURE_WRAP_S
:
1495 *params
= sampObj
->WrapS
;
1497 case GL_TEXTURE_WRAP_T
:
1498 *params
= sampObj
->WrapT
;
1500 case GL_TEXTURE_WRAP_R
:
1501 *params
= sampObj
->WrapR
;
1503 case GL_TEXTURE_MIN_FILTER
:
1504 *params
= sampObj
->MinFilter
;
1506 case GL_TEXTURE_MAG_FILTER
:
1507 *params
= sampObj
->MagFilter
;
1509 case GL_TEXTURE_MIN_LOD
:
1510 *params
= (GLuint
) sampObj
->MinLod
;
1512 case GL_TEXTURE_MAX_LOD
:
1513 *params
= (GLuint
) sampObj
->MaxLod
;
1515 case GL_TEXTURE_LOD_BIAS
:
1516 *params
= (GLuint
) sampObj
->LodBias
;
1518 case GL_TEXTURE_COMPARE_MODE
:
1519 if (!ctx
->Extensions
.ARB_shadow
)
1521 *params
= sampObj
->CompareMode
;
1523 case GL_TEXTURE_COMPARE_FUNC
:
1524 if (!ctx
->Extensions
.ARB_shadow
)
1526 *params
= sampObj
->CompareFunc
;
1528 case GL_TEXTURE_MAX_ANISOTROPY_EXT
:
1529 *params
= (GLuint
) sampObj
->MaxAnisotropy
;
1531 case GL_TEXTURE_BORDER_COLOR
:
1532 params
[0] = sampObj
->BorderColor
.ui
[0];
1533 params
[1] = sampObj
->BorderColor
.ui
[1];
1534 params
[2] = sampObj
->BorderColor
.ui
[2];
1535 params
[3] = sampObj
->BorderColor
.ui
[3];
1537 case GL_TEXTURE_CUBE_MAP_SEAMLESS
:
1538 if (!ctx
->Extensions
.AMD_seamless_cubemap_per_texture
)
1540 *params
= sampObj
->CubeMapSeamless
;
1542 case GL_TEXTURE_SRGB_DECODE_EXT
:
1543 if (!ctx
->Extensions
.EXT_texture_sRGB_decode
)
1545 *params
= (GLenum
) sampObj
->sRGBDecode
;
1553 _mesa_error(ctx
, GL_INVALID_ENUM
, "glGetSamplerParameterIuiv(pname=%s)",
1554 _mesa_lookup_enum_by_nr(pname
));
1559 _mesa_init_sampler_object_functions(struct dd_function_table
*driver
)
1561 driver
->NewSamplerObject
= _mesa_new_sampler_object
;
1562 driver
->DeleteSamplerObject
= _mesa_delete_sampler_object
;