iris: bind state helper function
This commit is contained in:
@@ -82,22 +82,27 @@ iris_delete_shader_state(struct pipe_context *ctx, void *state)
|
|||||||
free(ish);
|
free(ish);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
bind_state(struct iris_context *ice,
|
||||||
|
struct iris_uncompiled_shader *ish,
|
||||||
|
gl_shader_stage stage)
|
||||||
|
{
|
||||||
|
uint64_t dirty_bit = IRIS_DIRTY_UNCOMPILED_VS << stage;
|
||||||
|
|
||||||
|
ice->shaders.uncompiled[stage] = ish;
|
||||||
|
ice->state.dirty |= dirty_bit;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
iris_bind_vs_state(struct pipe_context *ctx, void *state)
|
iris_bind_vs_state(struct pipe_context *ctx, void *state)
|
||||||
{
|
{
|
||||||
struct iris_context *ice = (struct iris_context *)ctx;
|
bind_state((void *) ctx, state, MESA_SHADER_VERTEX);
|
||||||
|
|
||||||
ice->shaders.uncompiled[MESA_SHADER_VERTEX] = state;
|
|
||||||
ice->state.dirty |= IRIS_DIRTY_UNCOMPILED_VS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
iris_bind_tcs_state(struct pipe_context *ctx, void *state)
|
iris_bind_tcs_state(struct pipe_context *ctx, void *state)
|
||||||
{
|
{
|
||||||
struct iris_context *ice = (struct iris_context *)ctx;
|
bind_state((void *) ctx, state, MESA_SHADER_TESS_CTRL);
|
||||||
|
|
||||||
ice->shaders.uncompiled[MESA_SHADER_TESS_CTRL] = state;
|
|
||||||
ice->state.dirty |= IRIS_DIRTY_UNCOMPILED_TCS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -108,8 +113,7 @@ iris_bind_tes_state(struct pipe_context *ctx, void *state)
|
|||||||
if (!!state != !!ice->shaders.uncompiled[MESA_SHADER_TESS_EVAL])
|
if (!!state != !!ice->shaders.uncompiled[MESA_SHADER_TESS_EVAL])
|
||||||
ice->state.dirty |= IRIS_DIRTY_URB;
|
ice->state.dirty |= IRIS_DIRTY_URB;
|
||||||
|
|
||||||
ice->shaders.uncompiled[MESA_SHADER_TESS_EVAL] = state;
|
bind_state((void *) ctx, state, MESA_SHADER_TESS_EVAL);
|
||||||
ice->state.dirty |= IRIS_DIRTY_UNCOMPILED_TES;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -120,17 +124,13 @@ iris_bind_gs_state(struct pipe_context *ctx, void *state)
|
|||||||
if (!!state != !!ice->shaders.uncompiled[MESA_SHADER_GEOMETRY])
|
if (!!state != !!ice->shaders.uncompiled[MESA_SHADER_GEOMETRY])
|
||||||
ice->state.dirty |= IRIS_DIRTY_URB;
|
ice->state.dirty |= IRIS_DIRTY_URB;
|
||||||
|
|
||||||
ice->shaders.uncompiled[MESA_SHADER_GEOMETRY] = state;
|
bind_state((void *) ctx, state, MESA_SHADER_GEOMETRY);
|
||||||
ice->state.dirty |= IRIS_DIRTY_UNCOMPILED_GS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
iris_bind_fs_state(struct pipe_context *ctx, void *state)
|
iris_bind_fs_state(struct pipe_context *ctx, void *state)
|
||||||
{
|
{
|
||||||
struct iris_context *ice = (struct iris_context *)ctx;
|
bind_state((void *) ctx, state, MESA_SHADER_FRAGMENT);
|
||||||
|
|
||||||
ice->shaders.uncompiled[MESA_SHADER_FRAGMENT] = state;
|
|
||||||
ice->state.dirty |= IRIS_DIRTY_UNCOMPILED_FS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user