ctx->prog.dirty |= FD_SHADER_DIRTY_FP;
}
+ if (last_key->vclamp_color != key->vclamp_color)
+ ctx->prog.dirty |= FD_SHADER_DIRTY_VP;
+
+ if (last_key->fclamp_color != key->fclamp_color)
+ ctx->prog.dirty |= FD_SHADER_DIRTY_FP;
+
if (last_key->color_two_side != key->color_two_side)
ctx->prog.dirty |= FD_SHADER_DIRTY_FP;
/* do binning pass first: */
.binning_pass = true,
.color_two_side = ctx->rasterizer->light_twoside,
+ .vclamp_color = ctx->rasterizer->clamp_vertex_color,
+ .fclamp_color = ctx->rasterizer->clamp_fragment_color,
// TODO set .half_precision based on render target format,
// ie. float16 and smaller use half, float32 use full..
.half_precision = !!(fd_mesa_debug & FD_DBG_FRAGHALF),
ctx->prog.dirty |= FD_SHADER_DIRTY_FP;
}
+ if (last_key->vclamp_color != key->vclamp_color)
+ ctx->prog.dirty |= FD_SHADER_DIRTY_VP;
+
+ if (last_key->fclamp_color != key->fclamp_color)
+ ctx->prog.dirty |= FD_SHADER_DIRTY_FP;
+
if (last_key->color_two_side != key->color_two_side)
ctx->prog.dirty |= FD_SHADER_DIRTY_FP;
/* do binning pass first: */
.binning_pass = true,
.color_two_side = ctx->rasterizer->light_twoside,
+ .vclamp_color = ctx->rasterizer->clamp_vertex_color,
+ .fclamp_color = ctx->rasterizer->clamp_fragment_color,
.rasterflat = ctx->rasterizer->flatshade,
// TODO set .half_precision based on render target format,
// ie. float16 and smaller use half, float32 use full..
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
- case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
- case PIPE_CAP_VERTEX_COLOR_CLAMPED:
case PIPE_CAP_USER_VERTEX_BUFFERS:
case PIPE_CAP_USER_INDEX_BUFFERS:
case PIPE_CAP_QUERY_PIPELINE_STATISTICS:
case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
case PIPE_CAP_DEPTH_BOUNDS_TEST:
case PIPE_CAP_TGSI_TXQS:
+ /* TODO if we need this, do it in nir/ir3 backend to avoid breaking precompile: */
case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
case PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS:
case PIPE_CAP_CLEAR_TEXTURE:
return 1;
case PIPE_CAP_SHAREABLE_SHADERS:
+ /* manage the variants for these ourself, to avoid breaking precompile: */
+ case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
+ case PIPE_CAP_VERTEX_COLOR_CLAMPED:
if (is_ir3(screen))
return 1;
return 0;
{
return key->fsaturate_s | key->fsaturate_t | key->fsaturate_r |
key->vsaturate_s | key->vsaturate_t | key->vsaturate_r |
- key->ucp_enables | key->color_two_side;
+ key->ucp_enables | key->color_two_side |
+ key->fclamp_color | key->vclamp_color;
}
#define OPT(nir, pass, ...) ({ \
if (key) {
if (s->stage == MESA_SHADER_VERTEX) {
OPT_V(s, nir_lower_clip_vs, key->ucp_enables);
+ if (key->vclamp_color)
+ OPT_V(s, nir_lower_clamp_color_outputs);
} else if (s->stage == MESA_SHADER_FRAGMENT) {
OPT_V(s, nir_lower_clip_fs, key->ucp_enables);
+ if (key->fclamp_color)
+ OPT_V(s, nir_lower_clamp_color_outputs);
}
if (key->color_two_side) {
OPT_V(s, nir_lower_two_sided_color);
* Vertex shader variant parameters:
*/
unsigned binning_pass : 1;
+ unsigned vclamp_color : 1;
/*
* Fragment shader variant parameters:
* for front/back color inputs to frag shader:
*/
unsigned rasterflat : 1;
+ unsigned fclamp_color : 1;
};
uint32_t global;
};