2 Copyright (C) Intel Corp. 2006. All Rights Reserved.
3 Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
4 develop this 3D driver.
6 Permission is hereby granted, free of charge, to any person obtaining
7 a 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, sublicense, 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:
14 The above copyright notice and this permission notice (including the
15 next paragraph) shall be included in all copies or substantial
16 portions of the Software.
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **********************************************************************/
29 * Keith Whitwell <keith@tungstengraphics.com>
32 #include "brw_context.h"
34 #include "brw_state.h"
35 #include "main/formats.h"
36 #include "main/fbobject.h"
37 #include "main/samplerobj.h"
38 #include "program/prog_parameter.h"
40 #include "glsl/ralloc.h"
42 /** Return number of src args for given instruction */
43 GLuint
brw_wm_nr_args( GLuint opcode
)
60 assert(opcode
< MAX_OPCODE
);
61 return _mesa_num_inst_src_regs(opcode
);
66 GLuint
brw_wm_is_scalar_result( GLuint opcode
)
90 * Do GPU code generation for non-GLSL shader. non-GLSL shaders have
91 * no flow control instructions so we can more readily do SSA-style
95 brw_wm_non_glsl_emit(struct brw_context
*brw
, struct brw_wm_compile
*c
)
97 /* Augment fragment program. Add instructions for pre- and
98 * post-fragment-program tasks such as interpolation and fogging.
102 /* Translate to intermediate representation. Build register usage
107 /* Dead code removal.
111 /* Register allocation.
112 * Divide by two because we operate on 16 pixels at a time and require
113 * two GRF entries for each logical shader register.
115 c
->grf_limit
= BRW_WM_MAX_GRF
/ 2;
119 /* how many general-purpose registers are used */
120 c
->prog_data
.reg_blocks
= brw_register_blocks(c
->max_wm_grf
);
129 * Return a bitfield where bit n is set if barycentric interpolation mode n
130 * (see enum brw_wm_barycentric_interp_mode) is needed by the fragment shader.
133 brw_compute_barycentric_interp_modes(struct brw_context
*brw
,
134 bool shade_model_flat
,
135 const struct gl_fragment_program
*fprog
)
137 unsigned barycentric_interp_modes
= 0;
140 /* Loop through all fragment shader inputs to figure out what interpolation
141 * modes are in use, and set the appropriate bits in
142 * barycentric_interp_modes.
144 for (attr
= 0; attr
< FRAG_ATTRIB_MAX
; ++attr
) {
145 enum glsl_interp_qualifier interp_qualifier
=
146 fprog
->InterpQualifier
[attr
];
147 bool is_centroid
= fprog
->IsCentroid
& BITFIELD64_BIT(attr
);
148 bool is_gl_Color
= attr
== FRAG_ATTRIB_COL0
|| attr
== FRAG_ATTRIB_COL1
;
150 /* Ignore unused inputs. */
151 if (!(fprog
->Base
.InputsRead
& BITFIELD64_BIT(attr
)))
154 /* Ignore WPOS and FACE, because they don't require interpolation. */
155 if (attr
== FRAG_ATTRIB_WPOS
|| attr
== FRAG_ATTRIB_FACE
)
158 /* Determine the set (or sets) of barycentric coordinates needed to
159 * interpolate this variable. Note that when
160 * brw->needs_unlit_centroid_workaround is set, centroid interpolation
161 * uses PIXEL interpolation for unlit pixels and CENTROID interpolation
162 * for lit pixels, so we need both sets of barycentric coordinates.
164 if (interp_qualifier
== INTERP_QUALIFIER_NOPERSPECTIVE
) {
166 barycentric_interp_modes
|=
167 1 << BRW_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC
;
169 if (!is_centroid
|| brw
->needs_unlit_centroid_workaround
) {
170 barycentric_interp_modes
|=
171 1 << BRW_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC
;
173 } else if (interp_qualifier
== INTERP_QUALIFIER_SMOOTH
||
174 (!(shade_model_flat
&& is_gl_Color
) &&
175 interp_qualifier
== INTERP_QUALIFIER_NONE
)) {
177 barycentric_interp_modes
|=
178 1 << BRW_WM_PERSPECTIVE_CENTROID_BARYCENTRIC
;
180 if (!is_centroid
|| brw
->needs_unlit_centroid_workaround
) {
181 barycentric_interp_modes
|=
182 1 << BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC
;
187 return barycentric_interp_modes
;
192 brw_wm_payload_setup(struct brw_context
*brw
,
193 struct brw_wm_compile
*c
)
195 struct intel_context
*intel
= &brw
->intel
;
196 bool uses_depth
= (c
->fp
->program
.Base
.InputsRead
&
197 (1 << FRAG_ATTRIB_WPOS
)) != 0;
198 unsigned barycentric_interp_modes
= c
->prog_data
.barycentric_interp_modes
;
201 if (intel
->gen
>= 6) {
202 /* R0-1: masks, pixel X/Y coordinates. */
203 c
->nr_payload_regs
= 2;
204 /* R2: only for 32-pixel dispatch.*/
206 /* R3-26: barycentric interpolation coordinates. These appear in the
207 * same order that they appear in the brw_wm_barycentric_interp_mode
208 * enum. Each set of coordinates occupies 2 registers if dispatch width
209 * == 8 and 4 registers if dispatch width == 16. Coordinates only
210 * appear if they were enabled using the "Barycentric Interpolation
211 * Mode" bits in WM_STATE.
213 for (i
= 0; i
< BRW_WM_BARYCENTRIC_INTERP_MODE_COUNT
; ++i
) {
214 if (barycentric_interp_modes
& (1 << i
)) {
215 c
->barycentric_coord_reg
[i
] = c
->nr_payload_regs
;
216 c
->nr_payload_regs
+= 2;
217 if (c
->dispatch_width
== 16) {
218 c
->nr_payload_regs
+= 2;
223 /* R27: interpolated depth if uses source depth */
225 c
->source_depth_reg
= c
->nr_payload_regs
;
226 c
->nr_payload_regs
++;
227 if (c
->dispatch_width
== 16) {
228 /* R28: interpolated depth if not 8-wide. */
229 c
->nr_payload_regs
++;
232 /* R29: interpolated W set if GEN6_WM_USES_SOURCE_W.
235 c
->source_w_reg
= c
->nr_payload_regs
;
236 c
->nr_payload_regs
++;
237 if (c
->dispatch_width
== 16) {
238 /* R30: interpolated W if not 8-wide. */
239 c
->nr_payload_regs
++;
242 /* R31: MSAA position offsets. */
243 /* R32-: bary for 32-pixel. */
244 /* R58-59: interp W for 32-pixel. */
246 if (c
->fp
->program
.Base
.OutputsWritten
&
247 BITFIELD64_BIT(FRAG_RESULT_DEPTH
)) {
248 c
->source_depth_to_render_target
= true;
249 c
->computes_depth
= true;
252 brw_wm_lookup_iz(intel
, c
);
257 brw_wm_prog_data_compare(const void *in_a
, const void *in_b
,
258 int aux_size
, const void *in_key
)
260 const struct brw_wm_prog_data
*a
= in_a
;
261 const struct brw_wm_prog_data
*b
= in_b
;
263 /* Compare all the struct up to the pointers. */
264 if (memcmp(a
, b
, offsetof(struct brw_wm_prog_data
, param
)))
267 if (memcmp(a
->param
, b
->param
, a
->nr_params
* sizeof(void *)))
270 if (memcmp(a
->pull_param
, b
->pull_param
, a
->nr_pull_params
* sizeof(void *)))
277 * All Mesa program -> GPU code generation goes through this function.
278 * Depending on the instructions used (i.e. flow control instructions)
279 * we'll use one of two code generators.
281 bool do_wm_prog(struct brw_context
*brw
,
282 struct gl_shader_program
*prog
,
283 struct brw_fragment_program
*fp
,
284 struct brw_wm_prog_key
*key
)
286 struct intel_context
*intel
= &brw
->intel
;
287 struct brw_wm_compile
*c
;
288 const GLuint
*program
;
291 c
= brw
->wm
.compile_data
;
293 brw
->wm
.compile_data
= rzalloc(NULL
, struct brw_wm_compile
);
294 c
= brw
->wm
.compile_data
;
296 /* Ouch - big out of memory problem. Can't continue
297 * without triggering a segfault, no way to signal,
303 void *instruction
= c
->instruction
;
304 void *prog_instructions
= c
->prog_instructions
;
305 void *vreg
= c
->vreg
;
306 void *refs
= c
->refs
;
307 memset(c
, 0, sizeof(*brw
->wm
.compile_data
));
308 c
->instruction
= instruction
;
309 c
->prog_instructions
= prog_instructions
;
313 memcpy(&c
->key
, key
, sizeof(*key
));
316 c
->env_param
= brw
->intel
.ctx
.FragmentProgram
.Parameters
;
318 brw_init_compile(brw
, &c
->func
, c
);
320 c
->prog_data
.barycentric_interp_modes
=
321 brw_compute_barycentric_interp_modes(brw
, c
->key
.flat_shade
,
324 if (prog
&& prog
->_LinkedShaders
[MESA_SHADER_FRAGMENT
]) {
325 if (!brw_wm_fs_emit(brw
, c
, prog
))
328 if (!c
->instruction
) {
329 c
->instruction
= rzalloc_array(c
, struct brw_wm_instruction
, BRW_WM_MAX_INSN
);
330 c
->prog_instructions
= rzalloc_array(c
, struct prog_instruction
, BRW_WM_MAX_INSN
);
331 c
->vreg
= rzalloc_array(c
, struct brw_wm_value
, BRW_WM_MAX_VREG
);
332 c
->refs
= rzalloc_array(c
, struct brw_wm_ref
, BRW_WM_MAX_REF
);
335 /* Fallback for fixed function and ARB_fp shaders. */
336 c
->dispatch_width
= 16;
337 brw_wm_payload_setup(brw
, c
);
338 brw_wm_non_glsl_emit(brw
, c
);
339 c
->prog_data
.dispatch_width
= 16;
342 /* Scratch space is used for register spilling */
343 if (c
->last_scratch
) {
344 perf_debug("Fragment shader triggered register spilling. "
345 "Try reducing the number of live scalar values to "
346 "improve performance.\n");
348 c
->prog_data
.total_scratch
= brw_get_scratch_size(c
->last_scratch
);
350 brw_get_scratch_bo(intel
, &brw
->wm
.scratch_bo
,
351 c
->prog_data
.total_scratch
* brw
->max_wm_threads
);
354 if (unlikely(INTEL_DEBUG
& DEBUG_WM
))
355 fprintf(stderr
, "\n");
359 program
= brw_get_program(&c
->func
, &program_size
);
361 brw_upload_cache(&brw
->cache
, BRW_WM_PROG
,
362 &c
->key
, sizeof(c
->key
),
363 program
, program_size
,
364 &c
->prog_data
, sizeof(c
->prog_data
),
365 &brw
->wm
.prog_offset
, &brw
->wm
.prog_data
);
371 key_debug(const char *name
, int a
, int b
)
374 perf_debug(" %s %d->%d\n", name
, a
, b
);
382 brw_debug_recompile_sampler_key(const struct brw_sampler_prog_key_data
*old_key
,
383 const struct brw_sampler_prog_key_data
*key
)
387 for (unsigned int i
= 0; i
< MAX_SAMPLERS
; i
++) {
388 found
|= key_debug("EXT_texture_swizzle or DEPTH_TEXTURE_MODE",
389 old_key
->swizzles
[i
], key
->swizzles
[i
]);
391 found
|= key_debug("GL_CLAMP enabled on any texture unit's 1st coordinate",
392 old_key
->gl_clamp_mask
[0], key
->gl_clamp_mask
[0]);
393 found
|= key_debug("GL_CLAMP enabled on any texture unit's 2nd coordinate",
394 old_key
->gl_clamp_mask
[1], key
->gl_clamp_mask
[1]);
395 found
|= key_debug("GL_CLAMP enabled on any texture unit's 3rd coordinate",
396 old_key
->gl_clamp_mask
[2], key
->gl_clamp_mask
[2]);
397 found
|= key_debug("GL_MESA_ycbcr texturing\n",
398 old_key
->yuvtex_mask
, key
->yuvtex_mask
);
399 found
|= key_debug("GL_MESA_ycbcr UV swapping\n",
400 old_key
->yuvtex_swap_mask
, key
->yuvtex_swap_mask
);
406 brw_wm_debug_recompile(struct brw_context
*brw
,
407 struct gl_shader_program
*prog
,
408 const struct brw_wm_prog_key
*key
)
410 struct brw_cache_item
*c
= NULL
;
411 const struct brw_wm_prog_key
*old_key
= NULL
;
414 perf_debug("Recompiling fragment shader for program %d\n", prog
->Name
);
416 for (unsigned int i
= 0; i
< brw
->cache
.size
; i
++) {
417 for (c
= brw
->cache
.items
[i
]; c
; c
= c
->next
) {
418 if (c
->cache_id
== BRW_WM_PROG
) {
421 if (old_key
->program_string_id
== key
->program_string_id
)
430 perf_debug(" Didn't find previous compile in the shader cache for "
435 found
|= key_debug("alphatest, computed depth, depth test, or depth write",
436 old_key
->iz_lookup
, key
->iz_lookup
);
437 found
|= key_debug("depth statistics", old_key
->stats_wm
, key
->stats_wm
);
438 found
|= key_debug("flat shading", old_key
->flat_shade
, key
->flat_shade
);
439 found
|= key_debug("number of color buffers", old_key
->nr_color_regions
, key
->nr_color_regions
);
440 found
|= key_debug("rendering to FBO", old_key
->render_to_fbo
, key
->render_to_fbo
);
441 found
|= key_debug("fragment color clamping", old_key
->clamp_fragment_color
, key
->clamp_fragment_color
);
442 found
|= key_debug("line smoothing", old_key
->line_aa
, key
->line_aa
);
443 found
|= key_debug("proj_attrib_mask", old_key
->proj_attrib_mask
, key
->proj_attrib_mask
);
444 found
|= key_debug("renderbuffer height", old_key
->drawable_height
, key
->drawable_height
);
445 found
|= key_debug("vertex shader outputs", old_key
->vp_outputs_written
, key
->vp_outputs_written
);
447 found
|= brw_debug_recompile_sampler_key(&old_key
->tex
, &key
->tex
);
450 perf_debug(" Something else\n");
455 brw_populate_sampler_prog_key_data(struct gl_context
*ctx
,
456 const struct gl_program
*prog
,
457 struct brw_sampler_prog_key_data
*key
)
459 for (int s
= 0; s
< MAX_SAMPLERS
; s
++) {
460 key
->swizzles
[s
] = SWIZZLE_NOOP
;
462 if (!(prog
->SamplersUsed
& (1 << s
)))
465 int unit_id
= prog
->SamplerUnits
[s
];
466 const struct gl_texture_unit
*unit
= &ctx
->Texture
.Unit
[unit_id
];
468 if (unit
->_ReallyEnabled
&& unit
->_Current
->Target
!= GL_TEXTURE_BUFFER
) {
469 const struct gl_texture_object
*t
= unit
->_Current
;
470 const struct gl_texture_image
*img
= t
->Image
[0][t
->BaseLevel
];
471 struct gl_sampler_object
*sampler
= _mesa_get_samplerobj(ctx
, unit_id
);
472 int swizzles
[SWIZZLE_NIL
+ 1] = {
482 if (img
->_BaseFormat
== GL_DEPTH_COMPONENT
||
483 img
->_BaseFormat
== GL_DEPTH_STENCIL
) {
484 /* We handle GL_DEPTH_TEXTURE_MODE here instead of as surface
485 * format overrides because shadow comparison always returns the
486 * result of the comparison in all channels anyway.
488 switch (t
->DepthMode
) {
490 swizzles
[0] = SWIZZLE_ZERO
;
491 swizzles
[1] = SWIZZLE_ZERO
;
492 swizzles
[2] = SWIZZLE_ZERO
;
493 swizzles
[3] = SWIZZLE_X
;
496 swizzles
[0] = SWIZZLE_X
;
497 swizzles
[1] = SWIZZLE_X
;
498 swizzles
[2] = SWIZZLE_X
;
499 swizzles
[3] = SWIZZLE_ONE
;
502 swizzles
[0] = SWIZZLE_X
;
503 swizzles
[1] = SWIZZLE_X
;
504 swizzles
[2] = SWIZZLE_X
;
505 swizzles
[3] = SWIZZLE_X
;
508 swizzles
[0] = SWIZZLE_X
;
509 swizzles
[1] = SWIZZLE_ZERO
;
510 swizzles
[2] = SWIZZLE_ZERO
;
511 swizzles
[3] = SWIZZLE_ONE
;
516 if (img
->InternalFormat
== GL_YCBCR_MESA
) {
517 key
->yuvtex_mask
|= 1 << s
;
518 if (img
->TexFormat
== MESA_FORMAT_YCBCR
)
519 key
->yuvtex_swap_mask
|= 1 << s
;
523 MAKE_SWIZZLE4(swizzles
[GET_SWZ(t
->_Swizzle
, 0)],
524 swizzles
[GET_SWZ(t
->_Swizzle
, 1)],
525 swizzles
[GET_SWZ(t
->_Swizzle
, 2)],
526 swizzles
[GET_SWZ(t
->_Swizzle
, 3)]);
528 if (sampler
->MinFilter
!= GL_NEAREST
&&
529 sampler
->MagFilter
!= GL_NEAREST
) {
530 if (sampler
->WrapS
== GL_CLAMP
)
531 key
->gl_clamp_mask
[0] |= 1 << s
;
532 if (sampler
->WrapT
== GL_CLAMP
)
533 key
->gl_clamp_mask
[1] |= 1 << s
;
534 if (sampler
->WrapR
== GL_CLAMP
)
535 key
->gl_clamp_mask
[2] |= 1 << s
;
541 static void brw_wm_populate_key( struct brw_context
*brw
,
542 struct brw_wm_prog_key
*key
)
544 struct gl_context
*ctx
= &brw
->intel
.ctx
;
545 struct intel_context
*intel
= &brw
->intel
;
546 /* BRW_NEW_FRAGMENT_PROGRAM */
547 const struct brw_fragment_program
*fp
=
548 (struct brw_fragment_program
*)brw
->fragment_program
;
549 const struct gl_program
*prog
= (struct gl_program
*) brw
->fragment_program
;
552 bool program_uses_dfdy
= fp
->program
.UsesDFdy
;
554 memset(key
, 0, sizeof(*key
));
556 /* Build the index for table lookup
558 if (intel
->gen
< 6) {
560 if (fp
->program
.UsesKill
|| ctx
->Color
.AlphaEnabled
)
561 lookup
|= IZ_PS_KILL_ALPHATEST_BIT
;
563 if (fp
->program
.Base
.OutputsWritten
& BITFIELD64_BIT(FRAG_RESULT_DEPTH
))
564 lookup
|= IZ_PS_COMPUTES_DEPTH_BIT
;
568 lookup
|= IZ_DEPTH_TEST_ENABLE_BIT
;
570 if (ctx
->Depth
.Test
&& ctx
->Depth
.Mask
) /* ?? */
571 lookup
|= IZ_DEPTH_WRITE_ENABLE_BIT
;
574 if (ctx
->Stencil
._Enabled
) {
575 lookup
|= IZ_STENCIL_TEST_ENABLE_BIT
;
577 if (ctx
->Stencil
.WriteMask
[0] ||
578 ctx
->Stencil
.WriteMask
[ctx
->Stencil
._BackFace
])
579 lookup
|= IZ_STENCIL_WRITE_ENABLE_BIT
;
581 key
->iz_lookup
= lookup
;
586 /* _NEW_LINE, _NEW_POLYGON, BRW_NEW_REDUCED_PRIMITIVE */
587 if (ctx
->Line
.SmoothFlag
) {
588 if (brw
->intel
.reduced_primitive
== GL_LINES
) {
591 else if (brw
->intel
.reduced_primitive
== GL_TRIANGLES
) {
592 if (ctx
->Polygon
.FrontMode
== GL_LINE
) {
593 line_aa
= AA_SOMETIMES
;
595 if (ctx
->Polygon
.BackMode
== GL_LINE
||
596 (ctx
->Polygon
.CullFlag
&&
597 ctx
->Polygon
.CullFaceMode
== GL_BACK
))
600 else if (ctx
->Polygon
.BackMode
== GL_LINE
) {
601 line_aa
= AA_SOMETIMES
;
603 if ((ctx
->Polygon
.CullFlag
&&
604 ctx
->Polygon
.CullFaceMode
== GL_FRONT
))
610 key
->line_aa
= line_aa
;
613 key
->stats_wm
= brw
->intel
.stats_wm
;
615 /* BRW_NEW_WM_INPUT_DIMENSIONS */
616 /* Only set this for fixed function. The optimization it enables isn't
617 * useful for programs using shaders.
619 if (ctx
->Shader
.CurrentFragmentProgram
)
620 key
->proj_attrib_mask
= 0xffffffff;
622 key
->proj_attrib_mask
= brw
->wm
.input_size_masks
[4-1];
625 key
->flat_shade
= (ctx
->Light
.ShadeModel
== GL_FLAT
);
627 /* _NEW_FRAG_CLAMP | _NEW_BUFFERS */
628 key
->clamp_fragment_color
= ctx
->Color
._ClampFragmentColor
;
631 brw_populate_sampler_prog_key_data(ctx
, prog
, &key
->tex
);
635 * Include the draw buffer origin and height so that we can calculate
636 * fragment position values relative to the bottom left of the drawable,
637 * from the incoming screen origin relative position we get as part of our
640 * This is only needed for the WM_WPOSXY opcode when the fragment program
641 * uses the gl_FragCoord input.
643 * We could avoid recompiling by including this as a constant referenced by
644 * our program, but if we were to do that it would also be nice to handle
645 * getting that constant updated at batchbuffer submit time (when we
646 * hold the lock and know where the buffer really is) rather than at emit
647 * time when we don't hold the lock and are just guessing. We could also
648 * just avoid using this as key data if the program doesn't use
651 * For DRI2 the origin_x/y will always be (0,0) but we still need the
652 * drawable height in order to invert the Y axis.
654 if (fp
->program
.Base
.InputsRead
& FRAG_BIT_WPOS
) {
655 key
->drawable_height
= ctx
->DrawBuffer
->Height
;
658 if ((fp
->program
.Base
.InputsRead
& FRAG_BIT_WPOS
) || program_uses_dfdy
) {
659 key
->render_to_fbo
= _mesa_is_user_fbo(ctx
->DrawBuffer
);
663 key
->nr_color_regions
= ctx
->DrawBuffer
->_NumColorDrawBuffers
;
664 /* _NEW_MULTISAMPLE */
665 key
->sample_alpha_to_coverage
= ctx
->Multisample
.SampleAlphaToCoverage
;
667 /* CACHE_NEW_VS_PROG */
669 key
->vp_outputs_written
= brw
->vs
.prog_data
->outputs_written
;
671 /* The unique fragment program ID */
672 key
->program_string_id
= fp
->id
;
677 brw_upload_wm_prog(struct brw_context
*brw
)
679 struct intel_context
*intel
= &brw
->intel
;
680 struct gl_context
*ctx
= &intel
->ctx
;
681 struct brw_wm_prog_key key
;
682 struct brw_fragment_program
*fp
= (struct brw_fragment_program
*)
683 brw
->fragment_program
;
685 brw_wm_populate_key(brw
, &key
);
687 if (!brw_search_cache(&brw
->cache
, BRW_WM_PROG
,
689 &brw
->wm
.prog_offset
, &brw
->wm
.prog_data
)) {
690 bool success
= do_wm_prog(brw
, ctx
->Shader
._CurrentFragmentProgram
, fp
,
698 const struct brw_tracked_state brw_wm_prog
= {
700 .mesa
= (_NEW_COLOR
|
710 .brw
= (BRW_NEW_FRAGMENT_PROGRAM
|
711 BRW_NEW_WM_INPUT_DIMENSIONS
|
712 BRW_NEW_REDUCED_PRIMITIVE
),
713 .cache
= CACHE_NEW_VS_PROG
,
715 .emit
= brw_upload_wm_prog