st/mesa: simplify some code in get_texture_format_swizzle()
[mesa.git] / src / mesa / state_tracker / st_atom_texture.c
1 /**************************************************************************
2 *
3 * Copyright 2007 VMware, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 /*
29 * Authors:
30 * Keith Whitwell <keithw@vmware.com>
31 * Brian Paul
32 */
33
34
35 #include "main/context.h"
36 #include "main/macros.h"
37 #include "main/mtypes.h"
38 #include "main/samplerobj.h"
39 #include "main/teximage.h"
40 #include "main/texobj.h"
41 #include "program/prog_instruction.h"
42
43 #include "st_context.h"
44 #include "st_atom.h"
45 #include "st_texture.h"
46 #include "st_format.h"
47 #include "st_cb_texture.h"
48 #include "pipe/p_context.h"
49 #include "util/u_format.h"
50 #include "util/u_inlines.h"
51 #include "cso_cache/cso_context.h"
52
53
54 /**
55 * Return swizzle1(swizzle2)
56 */
57 static unsigned
58 swizzle_swizzle(unsigned swizzle1, unsigned swizzle2)
59 {
60 unsigned i, swz[4];
61
62 if (swizzle1 == SWIZZLE_XYZW) {
63 /* identity swizzle, no change to swizzle2 */
64 return swizzle2;
65 }
66
67 for (i = 0; i < 4; i++) {
68 unsigned s = GET_SWZ(swizzle1, i);
69 switch (s) {
70 case SWIZZLE_X:
71 case SWIZZLE_Y:
72 case SWIZZLE_Z:
73 case SWIZZLE_W:
74 swz[i] = GET_SWZ(swizzle2, s);
75 break;
76 case SWIZZLE_ZERO:
77 swz[i] = SWIZZLE_ZERO;
78 break;
79 case SWIZZLE_ONE:
80 swz[i] = SWIZZLE_ONE;
81 break;
82 default:
83 assert(!"Bad swizzle term");
84 swz[i] = SWIZZLE_X;
85 }
86 }
87
88 return MAKE_SWIZZLE4(swz[0], swz[1], swz[2], swz[3]);
89 }
90
91
92 /**
93 * Given a user-specified texture base format, the actual gallium texture
94 * format and the current GL_DEPTH_MODE, return a texture swizzle.
95 *
96 * Consider the case where the user requests a GL_RGB internal texture
97 * format the driver actually uses an RGBA format. The A component should
98 * be ignored and sampling from the texture should always return (r,g,b,1).
99 * But if we rendered to the texture we might have written A values != 1.
100 * By sampling the texture with a ".xyz1" swizzle we'll get the expected A=1.
101 * This function computes the texture swizzle needed to get the expected
102 * values.
103 *
104 * In the case of depth textures, the GL_DEPTH_MODE state determines the
105 * texture swizzle.
106 *
107 * This result must be composed with the user-specified swizzle to get
108 * the final swizzle.
109 */
110 static unsigned
111 compute_texture_format_swizzle(GLenum baseFormat, GLenum depthMode,
112 enum pipe_format actualFormat,
113 unsigned glsl_version)
114 {
115 switch (baseFormat) {
116 case GL_RGBA:
117 return SWIZZLE_XYZW;
118 case GL_RGB:
119 if (util_format_has_alpha(actualFormat))
120 return MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ONE);
121 else
122 return SWIZZLE_XYZW;
123 case GL_RG:
124 if (util_format_get_nr_components(actualFormat) > 2)
125 return MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_ZERO, SWIZZLE_ONE);
126 else
127 return SWIZZLE_XYZW;
128 case GL_RED:
129 if (util_format_get_nr_components(actualFormat) > 1)
130 return MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_ZERO,
131 SWIZZLE_ZERO, SWIZZLE_ONE);
132 else
133 return SWIZZLE_XYZW;
134 case GL_ALPHA:
135 if (util_format_get_nr_components(actualFormat) > 1)
136 return MAKE_SWIZZLE4(SWIZZLE_ZERO, SWIZZLE_ZERO,
137 SWIZZLE_ZERO, SWIZZLE_W);
138 else
139 return SWIZZLE_XYZW;
140 case GL_LUMINANCE:
141 if (util_format_get_nr_components(actualFormat) > 1)
142 return MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_ONE);
143 else
144 return SWIZZLE_XYZW;
145 case GL_LUMINANCE_ALPHA:
146 if (util_format_get_nr_components(actualFormat) > 2)
147 return MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_W);
148 else
149 return SWIZZLE_XYZW;
150 case GL_INTENSITY:
151 if (util_format_get_nr_components(actualFormat) > 1)
152 return SWIZZLE_XXXX;
153 else
154 return SWIZZLE_XYZW;
155 case GL_STENCIL_INDEX:
156 case GL_DEPTH_STENCIL:
157 case GL_DEPTH_COMPONENT:
158 /* Now examine the depth mode */
159 switch (depthMode) {
160 case GL_LUMINANCE:
161 return MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_ONE);
162 case GL_INTENSITY:
163 return MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X);
164 case GL_ALPHA:
165 /* The texture(sampler*Shadow) functions from GLSL 1.30 ignore
166 * the depth mode and return float, while older shadow* functions
167 * and ARB_fp instructions return vec4 according to the depth mode.
168 *
169 * The problem with the GLSL 1.30 functions is that GL_ALPHA forces
170 * them to return 0, breaking them completely.
171 *
172 * A proper fix would increase code complexity and that's not worth
173 * it for a rarely used feature such as the GL_ALPHA depth mode
174 * in GL3. Therefore, change GL_ALPHA to GL_INTENSITY for all
175 * shaders that use GLSL 1.30 or later.
176 *
177 * BTW, it's required that sampler views are updated when
178 * shaders change (check_sampler_swizzle takes care of that).
179 */
180 if (glsl_version && glsl_version >= 130)
181 return SWIZZLE_XXXX;
182 else
183 return MAKE_SWIZZLE4(SWIZZLE_ZERO, SWIZZLE_ZERO,
184 SWIZZLE_ZERO, SWIZZLE_X);
185 case GL_RED:
186 return MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_ZERO,
187 SWIZZLE_ZERO, SWIZZLE_ONE);
188 default:
189 assert(!"Unexpected depthMode");
190 return SWIZZLE_XYZW;
191 }
192 default:
193 assert(!"Unexpected baseFormat");
194 return SWIZZLE_XYZW;
195 }
196 }
197
198
199 static unsigned
200 get_texture_format_swizzle(const struct st_context *st,
201 const struct st_texture_object *stObj,
202 unsigned glsl_version)
203 {
204 GLenum baseFormat = _mesa_texture_base_format(&stObj->base);
205 unsigned tex_swizzle;
206
207 if (baseFormat != GL_NONE) {
208 GLenum depth_mode = stObj->base.DepthMode;
209 /* In ES 3.0, DEPTH_TEXTURE_MODE is expected to be GL_RED for textures
210 * with depth component data specified with a sized internal format.
211 */
212 if (_mesa_is_gles3(st->ctx) &&
213 util_format_is_depth_or_stencil(stObj->pt->format)) {
214 const struct gl_texture_image *firstImage =
215 _mesa_base_tex_image(&stObj->base);
216 if (firstImage->InternalFormat != GL_DEPTH_COMPONENT &&
217 firstImage->InternalFormat != GL_DEPTH_STENCIL &&
218 firstImage->InternalFormat != GL_STENCIL_INDEX)
219 depth_mode = GL_RED;
220 }
221 tex_swizzle = compute_texture_format_swizzle(baseFormat,
222 depth_mode,
223 stObj->pt->format,
224 glsl_version);
225 }
226 else {
227 tex_swizzle = SWIZZLE_XYZW;
228 }
229
230 /* Combine the texture format swizzle with user's swizzle */
231 return swizzle_swizzle(stObj->base._Swizzle, tex_swizzle);
232 }
233
234
235 /**
236 * Return TRUE if the texture's sampler view swizzle is not equal to
237 * the texture's swizzle.
238 *
239 * \param stObj the st texture object,
240 */
241 static boolean
242 check_sampler_swizzle(const struct st_context *st,
243 const struct st_texture_object *stObj,
244 struct pipe_sampler_view *sv, unsigned glsl_version)
245 {
246 unsigned swizzle = get_texture_format_swizzle(st, stObj, glsl_version);
247
248 return ((sv->swizzle_r != GET_SWZ(swizzle, 0)) ||
249 (sv->swizzle_g != GET_SWZ(swizzle, 1)) ||
250 (sv->swizzle_b != GET_SWZ(swizzle, 2)) ||
251 (sv->swizzle_a != GET_SWZ(swizzle, 3)));
252 }
253
254
255 static unsigned last_level(struct st_texture_object *stObj)
256 {
257 unsigned ret = MIN2(stObj->base.MinLevel + stObj->base._MaxLevel,
258 stObj->pt->last_level);
259 if (stObj->base.Immutable)
260 ret = MIN2(ret, stObj->base.MinLevel + stObj->base.NumLevels - 1);
261 return ret;
262 }
263
264 static unsigned last_layer(struct st_texture_object *stObj)
265 {
266 if (stObj->base.Immutable && stObj->pt->array_size > 1)
267 return MIN2(stObj->base.MinLayer + stObj->base.NumLayers - 1,
268 stObj->pt->array_size - 1);
269 return stObj->pt->array_size - 1;
270 }
271
272 static struct pipe_sampler_view *
273 st_create_texture_sampler_view_from_stobj(struct st_context *st,
274 struct st_texture_object *stObj,
275 enum pipe_format format,
276 unsigned glsl_version)
277 {
278 struct pipe_sampler_view templ;
279 unsigned swizzle = get_texture_format_swizzle(st, stObj, glsl_version);
280
281 u_sampler_view_default_template(&templ,
282 stObj->pt,
283 format);
284
285 if (stObj->pt->target == PIPE_BUFFER) {
286 unsigned base, size;
287
288 base = stObj->base.BufferOffset;
289 if (base >= stObj->pt->width0)
290 return NULL;
291 size = MIN2(stObj->pt->width0 - base, (unsigned)stObj->base.BufferSize);
292 if (!size)
293 return NULL;
294
295 templ.u.buf.offset = base;
296 templ.u.buf.size = size;
297 } else {
298 templ.u.tex.first_level = stObj->base.MinLevel + stObj->base.BaseLevel;
299 templ.u.tex.last_level = last_level(stObj);
300 assert(templ.u.tex.first_level <= templ.u.tex.last_level);
301 templ.u.tex.first_layer = stObj->base.MinLayer;
302 templ.u.tex.last_layer = last_layer(stObj);
303 assert(templ.u.tex.first_layer <= templ.u.tex.last_layer);
304 templ.target = gl_target_to_pipe(stObj->base.Target);
305 }
306
307 templ.swizzle_r = GET_SWZ(swizzle, 0);
308 templ.swizzle_g = GET_SWZ(swizzle, 1);
309 templ.swizzle_b = GET_SWZ(swizzle, 2);
310 templ.swizzle_a = GET_SWZ(swizzle, 3);
311
312 return st->pipe->create_sampler_view(st->pipe, stObj->pt, &templ);
313 }
314
315
316 static struct pipe_sampler_view *
317 st_get_texture_sampler_view_from_stobj(struct st_context *st,
318 struct st_texture_object *stObj,
319 enum pipe_format format,
320 unsigned glsl_version)
321 {
322 struct pipe_sampler_view **sv;
323 const struct st_texture_image *firstImage;
324 if (!stObj || !stObj->pt) {
325 return NULL;
326 }
327
328 sv = st_texture_get_sampler_view(st, stObj);
329
330 if (util_format_is_depth_and_stencil(format)) {
331 if (stObj->base.StencilSampling)
332 format = util_format_stencil_only(format);
333 else {
334 firstImage = st_texture_image_const(_mesa_base_tex_image(&stObj->base));
335 if (firstImage->base._BaseFormat == GL_STENCIL_INDEX)
336 format = util_format_stencil_only(format);
337 }
338 }
339
340 /* if sampler view has changed dereference it */
341 if (*sv) {
342 if (check_sampler_swizzle(st, stObj, *sv, glsl_version) ||
343 (format != (*sv)->format) ||
344 gl_target_to_pipe(stObj->base.Target) != (*sv)->target ||
345 stObj->base.MinLevel + stObj->base.BaseLevel != (*sv)->u.tex.first_level ||
346 last_level(stObj) != (*sv)->u.tex.last_level ||
347 stObj->base.MinLayer != (*sv)->u.tex.first_layer ||
348 last_layer(stObj) != (*sv)->u.tex.last_layer) {
349 pipe_sampler_view_reference(sv, NULL);
350 }
351 }
352
353 if (!*sv) {
354 *sv = st_create_texture_sampler_view_from_stobj(st, stObj,
355 format, glsl_version);
356
357 } else if ((*sv)->context != st->pipe) {
358 /* Recreate view in correct context, use existing view as template */
359 struct pipe_sampler_view *new_sv =
360 st->pipe->create_sampler_view(st->pipe, stObj->pt, *sv);
361 pipe_sampler_view_reference(sv, NULL);
362 *sv = new_sv;
363 }
364
365 return *sv;
366 }
367
368 static GLboolean
369 update_single_texture(struct st_context *st,
370 struct pipe_sampler_view **sampler_view,
371 GLuint texUnit, unsigned glsl_version)
372 {
373 struct gl_context *ctx = st->ctx;
374 const struct gl_sampler_object *samp;
375 struct gl_texture_object *texObj;
376 struct st_texture_object *stObj;
377 enum pipe_format view_format;
378 GLboolean retval;
379
380 samp = _mesa_get_samplerobj(ctx, texUnit);
381
382 texObj = ctx->Texture.Unit[texUnit]._Current;
383
384 if (!texObj) {
385 texObj = _mesa_get_fallback_texture(ctx, TEXTURE_2D_INDEX);
386 samp = &texObj->Sampler;
387 }
388 stObj = st_texture_object(texObj);
389
390 retval = st_finalize_texture(ctx, st->pipe, texObj);
391 if (!retval) {
392 /* out of mem */
393 return GL_FALSE;
394 }
395
396 /* Determine the format of the texture sampler view */
397 if (texObj->Target == GL_TEXTURE_BUFFER) {
398 view_format =
399 st_mesa_format_to_pipe_format(st, stObj->base._BufferObjectFormat);
400 }
401 else {
402 view_format =
403 stObj->surface_based ? stObj->surface_format : stObj->pt->format;
404
405 /* If sRGB decoding is off, use the linear format */
406 if (samp->sRGBDecode == GL_SKIP_DECODE_EXT) {
407 view_format = util_format_linear(view_format);
408 }
409 }
410
411 switch (view_format) {
412 case PIPE_FORMAT_NV12:
413 case PIPE_FORMAT_IYUV:
414 view_format = PIPE_FORMAT_R8_UNORM;
415 break;
416 default:
417 break;
418 }
419
420 *sampler_view =
421 st_get_texture_sampler_view_from_stobj(st, stObj, view_format,
422 glsl_version);
423 return GL_TRUE;
424 }
425
426
427
428 static void
429 update_textures(struct st_context *st,
430 gl_shader_stage mesa_shader,
431 const struct gl_program *prog,
432 unsigned max_units,
433 struct pipe_sampler_view **sampler_views,
434 unsigned *num_textures)
435 {
436 const GLuint old_max = *num_textures;
437 GLbitfield samplers_used = prog->SamplersUsed;
438 GLbitfield free_slots = ~prog->SamplersUsed;
439 GLbitfield external_samplers_used = prog->ExternalSamplersUsed;
440 GLuint unit;
441 struct gl_shader_program *shader =
442 st->ctx->_Shader->CurrentProgram[mesa_shader];
443 unsigned glsl_version = shader ? shader->Version : 0;
444 enum pipe_shader_type shader_stage = st_shader_stage_to_ptarget(mesa_shader);
445
446 if (samplers_used == 0x0 && old_max == 0)
447 return;
448
449 *num_textures = 0;
450
451 /* loop over sampler units (aka tex image units) */
452 for (unit = 0; unit < max_units; unit++, samplers_used >>= 1) {
453 struct pipe_sampler_view *sampler_view = NULL;
454
455 if (samplers_used & 1) {
456 const GLuint texUnit = prog->SamplerUnits[unit];
457 GLboolean retval;
458
459 retval = update_single_texture(st, &sampler_view, texUnit,
460 glsl_version);
461 if (retval == GL_FALSE)
462 continue;
463
464 *num_textures = unit + 1;
465 }
466 else if (samplers_used == 0 && unit >= old_max) {
467 /* if we've reset all the old views and we have no more new ones */
468 break;
469 }
470
471 pipe_sampler_view_reference(&(sampler_views[unit]), sampler_view);
472 }
473
474 /* For any external samplers with multiplaner YUV, stuff the additional
475 * sampler views we need at the end.
476 *
477 * Trying to cache the sampler view in the stObj looks painful, so just
478 * re-create the sampler view for the extra planes each time. Main use
479 * case is video playback (ie. fps games wouldn't be using this) so I
480 * guess no point to try to optimize this feature.
481 */
482 while (unlikely(external_samplers_used)) {
483 GLuint unit = u_bit_scan(&external_samplers_used);
484 GLuint extra = 0;
485 struct st_texture_object *stObj =
486 st_get_texture_object(st->ctx, prog, unit);
487 struct pipe_sampler_view tmpl;
488
489 if (!stObj)
490 continue;
491
492 /* use original view as template: */
493 tmpl = *sampler_views[unit];
494
495 switch (st_get_view_format(stObj)) {
496 case PIPE_FORMAT_NV12:
497 /* we need one additional R8G8 view: */
498 tmpl.format = PIPE_FORMAT_RG88_UNORM;
499 tmpl.swizzle_g = PIPE_SWIZZLE_Y; /* tmpl from Y plane is R8 */
500 extra = u_bit_scan(&free_slots);
501 sampler_views[extra] =
502 st->pipe->create_sampler_view(st->pipe, stObj->pt->next, &tmpl);
503 break;
504 case PIPE_FORMAT_IYUV:
505 /* we need two additional R8 views: */
506 tmpl.format = PIPE_FORMAT_R8_UNORM;
507 extra = u_bit_scan(&free_slots);
508 sampler_views[extra] =
509 st->pipe->create_sampler_view(st->pipe, stObj->pt->next, &tmpl);
510 extra = u_bit_scan(&free_slots);
511 sampler_views[extra] =
512 st->pipe->create_sampler_view(st->pipe, stObj->pt->next->next, &tmpl);
513 break;
514 default:
515 break;
516 }
517
518 *num_textures = MAX2(*num_textures, extra + 1);
519 }
520
521 cso_set_sampler_views(st->cso_context,
522 shader_stage,
523 *num_textures,
524 sampler_views);
525 }
526
527
528
529 static void
530 update_vertex_textures(struct st_context *st)
531 {
532 const struct gl_context *ctx = st->ctx;
533
534 if (ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits > 0) {
535 update_textures(st,
536 MESA_SHADER_VERTEX,
537 &ctx->VertexProgram._Current->Base,
538 ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits,
539 st->state.sampler_views[PIPE_SHADER_VERTEX],
540 &st->state.num_sampler_views[PIPE_SHADER_VERTEX]);
541 }
542 }
543
544
545 static void
546 update_fragment_textures(struct st_context *st)
547 {
548 const struct gl_context *ctx = st->ctx;
549
550 update_textures(st,
551 MESA_SHADER_FRAGMENT,
552 &ctx->FragmentProgram._Current->Base,
553 ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
554 st->state.sampler_views[PIPE_SHADER_FRAGMENT],
555 &st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]);
556 }
557
558
559 static void
560 update_geometry_textures(struct st_context *st)
561 {
562 const struct gl_context *ctx = st->ctx;
563
564 if (ctx->GeometryProgram._Current) {
565 update_textures(st,
566 MESA_SHADER_GEOMETRY,
567 &ctx->GeometryProgram._Current->Base,
568 ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits,
569 st->state.sampler_views[PIPE_SHADER_GEOMETRY],
570 &st->state.num_sampler_views[PIPE_SHADER_GEOMETRY]);
571 }
572 }
573
574
575 static void
576 update_tessctrl_textures(struct st_context *st)
577 {
578 const struct gl_context *ctx = st->ctx;
579
580 if (ctx->TessCtrlProgram._Current) {
581 update_textures(st,
582 MESA_SHADER_TESS_CTRL,
583 &ctx->TessCtrlProgram._Current->Base,
584 ctx->Const.Program[MESA_SHADER_TESS_CTRL].MaxTextureImageUnits,
585 st->state.sampler_views[PIPE_SHADER_TESS_CTRL],
586 &st->state.num_sampler_views[PIPE_SHADER_TESS_CTRL]);
587 }
588 }
589
590
591 static void
592 update_tesseval_textures(struct st_context *st)
593 {
594 const struct gl_context *ctx = st->ctx;
595
596 if (ctx->TessEvalProgram._Current) {
597 update_textures(st,
598 MESA_SHADER_TESS_EVAL,
599 &ctx->TessEvalProgram._Current->Base,
600 ctx->Const.Program[MESA_SHADER_TESS_EVAL].MaxTextureImageUnits,
601 st->state.sampler_views[PIPE_SHADER_TESS_EVAL],
602 &st->state.num_sampler_views[PIPE_SHADER_TESS_EVAL]);
603 }
604 }
605
606
607 static void
608 update_compute_textures(struct st_context *st)
609 {
610 const struct gl_context *ctx = st->ctx;
611
612 if (ctx->ComputeProgram._Current) {
613 update_textures(st,
614 MESA_SHADER_COMPUTE,
615 &ctx->ComputeProgram._Current->Base,
616 ctx->Const.Program[MESA_SHADER_COMPUTE].MaxTextureImageUnits,
617 st->state.sampler_views[PIPE_SHADER_COMPUTE],
618 &st->state.num_sampler_views[PIPE_SHADER_COMPUTE]);
619 }
620 }
621
622
623 const struct st_tracked_state st_update_fragment_texture = {
624 update_fragment_textures /* update */
625 };
626
627
628 const struct st_tracked_state st_update_vertex_texture = {
629 update_vertex_textures /* update */
630 };
631
632
633 const struct st_tracked_state st_update_geometry_texture = {
634 update_geometry_textures /* update */
635 };
636
637
638 const struct st_tracked_state st_update_tessctrl_texture = {
639 update_tessctrl_textures /* update */
640 };
641
642
643 const struct st_tracked_state st_update_tesseval_texture = {
644 update_tesseval_textures /* update */
645 };
646
647
648 const struct st_tracked_state st_update_compute_texture = {
649 update_compute_textures /* update */
650 };