unsigned sample_shading : 1;
unsigned msaa : 1;
unsigned color_two_side : 1;
- unsigned half_precision : 1;
/* used when shader needs to handle flat varyings (a4xx)
* for front/back color inputs to frag shader:
*/
if (last_key->color_two_side != key->color_two_side)
return true;
- if (last_key->half_precision != key->half_precision)
- return true;
-
if (last_key->rasterflat != key->rasterflat)
return true;
case MESA_SHADER_VERTEX:
case MESA_SHADER_GEOMETRY:
key->color_two_side = false;
- key->half_precision = false;
key->rasterflat = false;
if (key->has_per_samp) {
key->fsaturate_s = 0;
case MESA_SHADER_TESS_CTRL:
case MESA_SHADER_TESS_EVAL:
key->color_two_side = false;
- key->half_precision = false;
key->rasterflat = false;
if (key->has_per_samp) {
key->fsaturate_s = 0;
.color_two_side = ctx->rasterizer->light_twoside,
.vclamp_color = ctx->rasterizer->clamp_vertex_color,
.fclamp_color = ctx->rasterizer->clamp_fragment_color,
- .half_precision = ctx->in_discard_blit &&
- fd_half_precision(&ctx->batch->framebuffer),
.has_per_samp = (fd3_ctx->fsaturate || fd3_ctx->vsaturate),
.vsaturate_s = fd3_ctx->vsaturate_s,
.vsaturate_t = fd3_ctx->vsaturate_t,
.debug = &ctx->debug,
.vtx = &ctx->solid_vbuf_state,
.prog = &ctx->solid_prog,
- .key = {
- .half_precision = true,
- },
};
OUT_PKT0(ring, REG_A3XX_RB_MODE_CONTROL, 2);
.debug = &ctx->debug,
.vtx = &ctx->solid_vbuf_state,
.prog = &ctx->solid_prog,
- .key = {
- .half_precision = true,
- },
};
int i;
.sprite_coord_enable = 1,
/* NOTE: They all use the same VP, this is for vtx bufs. */
.prog = &ctx->blit_prog[0],
- .key = {
- .half_precision = fd_half_precision(pfb),
- },
};
float x0, y0, x1, y1;
unsigned bin_w = tile->bin_w;
* components, so half precision is always sufficient.
*/
emit.prog = &ctx->blit_prog[0];
- emit.key.half_precision = true;
} else {
/* Float depth needs special blit shader that writes depth */
if (pfb->zsbuf->format == PIPE_FORMAT_Z32_FLOAT)
emit.prog = &ctx->blit_z;
else
emit.prog = &ctx->blit_zs;
- emit.key.half_precision = false;
}
emit.fs = NULL; /* frag shader changed so clear cache */
fd3_program_emit(ring, &emit, 1, &pfb->zsbuf);
.vclamp_color = ctx->rasterizer->clamp_vertex_color,
.fclamp_color = ctx->rasterizer->clamp_fragment_color,
.rasterflat = ctx->rasterizer->flatshade,
- .half_precision = ctx->in_discard_blit &&
- fd_half_precision(&ctx->batch->framebuffer),
.ucp_enables = ctx->rasterizer->clip_plane_enable,
.has_per_samp = (fd4_ctx->fsaturate || fd4_ctx->vsaturate ||
fd4_ctx->fastc_srgb || fd4_ctx->vastc_srgb),
.debug = &ctx->debug,
.vtx = &ctx->solid_vbuf_state,
.prog = &ctx->solid_prog,
- .key = {
- .half_precision = true,
- },
};
OUT_PKT0(ring, REG_A4XX_RB_DEPTH_CONTROL, 1);
.sprite_coord_enable = 1,
/* NOTE: They all use the same VP, this is for vtx bufs. */
.prog = &ctx->blit_prog[0],
- .key = {
- .half_precision = fd_half_precision(pfb),
- },
.no_decode_srgb = true,
};
unsigned char mrt_comp[A4XX_MAX_RENDER_TARGETS] = {0};
case PIPE_FORMAT_Z32_FLOAT:
emit.prog = (pfb->zsbuf->format == PIPE_FORMAT_Z32_FLOAT) ?
&ctx->blit_z : &ctx->blit_zs;
- emit.key.half_precision = false;
OUT_PKT0(ring, REG_A4XX_RB_DEPTH_CONTROL, 1);
OUT_RING(ring, A4XX_RB_DEPTH_CONTROL_Z_ENABLE |
* components, so half precision is always sufficient.
*/
emit.prog = &ctx->blit_prog[0];
- emit.key.half_precision = true;
break;
}
emit.fs = NULL; /* frag shader changed so clear cache */
if (!strcmp(argv[n], "--half-precision")) {
debug_printf(" %s", argv[n]);
- key.half_precision = true;
n++;
continue;
}