ST_STATE(ST_NEW_TES_SAMPLER_VIEWS, st_update_tesseval_texture)
/* Non-compute samplers. */
-ST_STATE(ST_NEW_RENDER_SAMPLERS, st_update_sampler) /* depends on update_*_texture for swizzle */
+ST_STATE(ST_NEW_VS_SAMPLERS, st_update_vertex_sampler) /* depends on update_*_texture for swizzle */
+ST_STATE(ST_NEW_TCS_SAMPLERS, st_update_tessctrl_sampler) /* depends on update_*_texture for swizzle */
+ST_STATE(ST_NEW_TES_SAMPLERS, st_update_tesseval_sampler) /* depends on update_*_texture for swizzle */
+ST_STATE(ST_NEW_GS_SAMPLERS, st_update_geometry_sampler) /* depends on update_*_texture for swizzle */
+ST_STATE(ST_NEW_FS_SAMPLERS, st_update_fragment_sampler) /* depends on update_*_texture for swizzle */
ST_STATE(ST_NEW_VS_IMAGES, st_bind_vs_images)
ST_STATE(ST_NEW_TCS_IMAGES, st_bind_tcs_images)
/* Compute states must be last. */
ST_STATE(ST_NEW_CS_STATE, st_update_cp)
ST_STATE(ST_NEW_CS_SAMPLER_VIEWS, st_update_compute_texture)
-ST_STATE(ST_NEW_CS_SAMPLERS, st_update_sampler) /* depends on update_compute_texture for swizzle */
+ST_STATE(ST_NEW_CS_SAMPLERS, st_update_compute_sampler) /* depends on update_compute_texture for swizzle */
ST_STATE(ST_NEW_CS_CONSTANTS, st_update_cs_constants)
ST_STATE(ST_NEW_CS_UBOS, st_bind_cs_ubos)
ST_STATE(ST_NEW_CS_ATOMICS, st_bind_cs_atomics)
static void
-update_samplers(struct st_context *st)
+update_vertex_samplers(struct st_context *st)
{
const struct gl_context *ctx = st->ctx;
update_shader_samplers(st,
- PIPE_SHADER_FRAGMENT,
- ctx->FragmentProgram._Current,
- ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
- st->state.samplers[PIPE_SHADER_FRAGMENT],
- &st->state.num_samplers[PIPE_SHADER_FRAGMENT]);
-
- update_shader_samplers(st,
PIPE_SHADER_VERTEX,
ctx->VertexProgram._Current,
ctx->Const.Program[MESA_SHADER_VERTEX].MaxTextureImageUnits,
st->state.samplers[PIPE_SHADER_VERTEX],
&st->state.num_samplers[PIPE_SHADER_VERTEX]);
+}
+
+
+static void
+update_tessctrl_samplers(struct st_context *st)
+{
+ const struct gl_context *ctx = st->ctx;
- if (ctx->GeometryProgram._Current) {
- update_shader_samplers(st,
- PIPE_SHADER_GEOMETRY,
- ctx->GeometryProgram._Current,
- ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits,
- st->state.samplers[PIPE_SHADER_GEOMETRY],
- &st->state.num_samplers[PIPE_SHADER_GEOMETRY]);
- }
if (ctx->TessCtrlProgram._Current) {
update_shader_samplers(st,
PIPE_SHADER_TESS_CTRL,
st->state.samplers[PIPE_SHADER_TESS_CTRL],
&st->state.num_samplers[PIPE_SHADER_TESS_CTRL]);
}
+}
+
+
+static void
+update_tesseval_samplers(struct st_context *st)
+{
+ const struct gl_context *ctx = st->ctx;
+
if (ctx->TessEvalProgram._Current) {
update_shader_samplers(st,
PIPE_SHADER_TESS_EVAL,
st->state.samplers[PIPE_SHADER_TESS_EVAL],
&st->state.num_samplers[PIPE_SHADER_TESS_EVAL]);
}
+}
+
+
+static void
+update_geometry_samplers(struct st_context *st)
+{
+ const struct gl_context *ctx = st->ctx;
+
+ if (ctx->GeometryProgram._Current) {
+ update_shader_samplers(st,
+ PIPE_SHADER_GEOMETRY,
+ ctx->GeometryProgram._Current,
+ ctx->Const.Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits,
+ st->state.samplers[PIPE_SHADER_GEOMETRY],
+ &st->state.num_samplers[PIPE_SHADER_GEOMETRY]);
+ }
+}
+
+
+static void
+update_fragment_samplers(struct st_context *st)
+{
+ const struct gl_context *ctx = st->ctx;
+
+ update_shader_samplers(st,
+ PIPE_SHADER_FRAGMENT,
+ ctx->FragmentProgram._Current,
+ ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
+ st->state.samplers[PIPE_SHADER_FRAGMENT],
+ &st->state.num_samplers[PIPE_SHADER_FRAGMENT]);
+}
+
+
+static void
+update_compute_samplers(struct st_context *st)
+{
+ const struct gl_context *ctx = st->ctx;
+
if (ctx->ComputeProgram._Current) {
update_shader_samplers(st,
PIPE_SHADER_COMPUTE,
}
-const struct st_tracked_state st_update_sampler = {
- update_samplers /* update */
+const struct st_tracked_state st_update_vertex_sampler = {
+ update_vertex_samplers /* update */
+};
+
+const struct st_tracked_state st_update_tessctrl_sampler = {
+ update_tessctrl_samplers /* update */
+};
+
+const struct st_tracked_state st_update_tesseval_sampler = {
+ update_tesseval_samplers /* update */
+};
+
+const struct st_tracked_state st_update_geometry_sampler = {
+ update_geometry_samplers /* update */
+};
+
+const struct st_tracked_state st_update_fragment_sampler = {
+ update_fragment_samplers /* update */
+};
+
+const struct st_tracked_state st_update_compute_sampler = {
+ update_compute_samplers /* update */
};
set_affected_state_flags(states, prog,
ST_NEW_VS_CONSTANTS,
ST_NEW_VS_SAMPLER_VIEWS,
- ST_NEW_RENDER_SAMPLERS,
+ ST_NEW_VS_SAMPLERS,
ST_NEW_VS_IMAGES,
ST_NEW_VS_UBOS,
ST_NEW_VS_SSBOS,
set_affected_state_flags(states, prog,
ST_NEW_TCS_CONSTANTS,
ST_NEW_TCS_SAMPLER_VIEWS,
- ST_NEW_RENDER_SAMPLERS,
+ ST_NEW_TCS_SAMPLERS,
ST_NEW_TCS_IMAGES,
ST_NEW_TCS_UBOS,
ST_NEW_TCS_SSBOS,
set_affected_state_flags(states, prog,
ST_NEW_TES_CONSTANTS,
ST_NEW_TES_SAMPLER_VIEWS,
- ST_NEW_RENDER_SAMPLERS,
+ ST_NEW_TES_SAMPLERS,
ST_NEW_TES_IMAGES,
ST_NEW_TES_UBOS,
ST_NEW_TES_SSBOS,
set_affected_state_flags(states, prog,
ST_NEW_GS_CONSTANTS,
ST_NEW_GS_SAMPLER_VIEWS,
- ST_NEW_RENDER_SAMPLERS,
+ ST_NEW_GS_SAMPLERS,
ST_NEW_GS_IMAGES,
ST_NEW_GS_UBOS,
ST_NEW_GS_SSBOS,
set_affected_state_flags(states, prog,
ST_NEW_FS_CONSTANTS,
ST_NEW_FS_SAMPLER_VIEWS,
- ST_NEW_RENDER_SAMPLERS,
+ ST_NEW_FS_SAMPLERS,
ST_NEW_FS_IMAGES,
ST_NEW_FS_UBOS,
ST_NEW_FS_SSBOS,
if (stfp->ati_fs) {
/* Just set them for ATI_fs unconditionally. */
stfp->affected_states |= ST_NEW_FS_SAMPLER_VIEWS |
- ST_NEW_RENDER_SAMPLERS;
+ ST_NEW_FS_SAMPLERS;
} else {
/* ARB_fp */
if (stfp->Base.SamplersUsed)
stfp->affected_states |= ST_NEW_FS_SAMPLER_VIEWS |
- ST_NEW_RENDER_SAMPLERS;
+ ST_NEW_FS_SAMPLERS;
}
}