/* Get pipeline state. */
switch (pipeline) {
case ST_PIPELINE_RENDER:
+ case ST_PIPELINE_RENDER_NO_VARRAYS:
if (st->ctx->API == API_OPENGL_COMPAT)
check_attrib_edgeflag(st);
st_manager_validate_framebuffers(st);
- pipeline_mask = ST_PIPELINE_RENDER_STATE_MASK;
+ if (pipeline == ST_PIPELINE_RENDER)
+ pipeline_mask = ST_PIPELINE_RENDER_STATE_MASK;
+ else
+ pipeline_mask = ST_PIPELINE_RENDER_STATE_MASK_NO_VARRAYS;
break;
case ST_PIPELINE_CLEAR:
*/
enum st_pipeline {
ST_PIPELINE_RENDER,
+ ST_PIPELINE_RENDER_NO_VARRAYS,
ST_PIPELINE_CLEAR,
ST_PIPELINE_META,
ST_PIPELINE_UPDATE_FRAMEBUFFER,
/* All state flags within each group: */
#define ST_PIPELINE_RENDER_STATE_MASK (ST_NEW_CS_STATE - 1)
+#define ST_PIPELINE_RENDER_STATE_MASK_NO_VARRAYS \
+ (ST_PIPELINE_RENDER_STATE_MASK & ~ST_NEW_VERTEX_ARRAYS)
#define ST_PIPELINE_COMPUTE_STATE_MASK (0xffull << ST_NEW_CS_STATE_INDEX)
#define ST_PIPELINE_CLEAR_STATE_MASK (ST_NEW_FB_STATE | \
ST_NEW_SCISSOR | \
ST_NEW_WINDOW_RECTANGLES)
-#define ST_PIPELINE_META_STATE_MASK (ST_PIPELINE_RENDER_STATE_MASK & \
- ~ST_NEW_VERTEX_ARRAYS)
+#define ST_PIPELINE_META_STATE_MASK ST_PIPELINE_RENDER_STATE_MASK_NO_VARRAYS
/* For ReadPixels, ReadBuffer, GetSamplePosition: */
#define ST_PIPELINE_UPDATE_FB_STATE_MASK (ST_NEW_FB_STATE)
}
static inline void
-prepare_draw(struct st_context *st, struct gl_context *ctx)
+prepare_draw(struct st_context *st, struct gl_context *ctx, uint64_t state_mask,
+ enum st_pipeline pipeline)
{
/* Mesa core state should have been validated already */
assert(ctx->NewState == 0x0);
st_invalidate_readpix_cache(st);
/* Validate state. */
- if ((st->dirty | ctx->NewDriverState) & st->active_states &
- ST_PIPELINE_RENDER_STATE_MASK ||
+ if ((st->dirty | ctx->NewDriverState) & st->active_states & state_mask ||
st->gfx_shaders_may_be_dirty) {
- st_validate_state(st, ST_PIPELINE_RENDER);
+ st_validate_state(st, pipeline);
}
/* Pin threads regularly to the same Zen CCX that the main thread is
{
struct st_context *st = st_context(ctx);
- prepare_draw(st, ctx);
+ prepare_draw(st, ctx, ST_PIPELINE_RENDER_STATE_MASK, ST_PIPELINE_RENDER);
if (!prepare_indexed_draw(st, ctx, info, draws, num_draws))
return;
{
struct st_context *st = st_context(ctx);
- prepare_draw(st, ctx);
+ prepare_draw(st, ctx, ST_PIPELINE_RENDER_STATE_MASK, ST_PIPELINE_RENDER);
if (!prepare_indexed_draw(st, ctx, info, draws, num_draws))
return;
struct pipe_draw_start_count_bias draw = {0};
assert(stride);
- prepare_draw(st, ctx);
+ prepare_draw(st, ctx, ST_PIPELINE_RENDER_STATE_MASK, ST_PIPELINE_RENDER);
memset(&indirect, 0, sizeof(indirect));
util_draw_init_info(&info);
struct pipe_draw_indirect_info indirect;
struct pipe_draw_start_count_bias draw = {0};
- prepare_draw(st, ctx);
+ prepare_draw(st, ctx, ST_PIPELINE_RENDER_STATE_MASK, ST_PIPELINE_RENDER);
memset(&indirect, 0, sizeof(indirect));
util_draw_init_info(&info);