aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_atom_texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_atom_texture.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_texture.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom_texture.c b/mesalib/src/mesa/state_tracker/st_atom_texture.c
index e88675d4e..6e2efd960 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_texture.c
@@ -312,8 +312,8 @@ update_vertex_textures(struct st_context *st)
PIPE_SHADER_VERTEX,
&ctx->VertexProgram._Current->Base,
ctx->Const.MaxVertexTextureImageUnits,
- st->state.vertex_sampler_views,
- &st->state.num_vertex_textures);
+ st->state.sampler_views[PIPE_SHADER_VERTEX],
+ &st->state.num_sampler_views[PIPE_SHADER_VERTEX]);
}
}
@@ -327,12 +327,28 @@ update_fragment_textures(struct st_context *st)
PIPE_SHADER_FRAGMENT,
&ctx->FragmentProgram._Current->Base,
ctx->Const.MaxTextureImageUnits,
- st->state.fragment_sampler_views,
- &st->state.num_fragment_textures);
+ st->state.sampler_views[PIPE_SHADER_FRAGMENT],
+ &st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]);
}
-const struct st_tracked_state st_update_texture = {
+static void
+update_geometry_textures(struct st_context *st)
+{
+ const struct gl_context *ctx = st->ctx;
+
+ if (ctx->GeometryProgram._Current) {
+ update_textures(st,
+ PIPE_SHADER_GEOMETRY,
+ &ctx->GeometryProgram._Current->Base,
+ ctx->Const.MaxTextureImageUnits,
+ st->state.sampler_views[PIPE_SHADER_GEOMETRY],
+ &st->state.num_sampler_views[PIPE_SHADER_GEOMETRY]);
+ }
+}
+
+
+const struct st_tracked_state st_update_fragment_texture = {
"st_update_texture", /* name */
{ /* dirty */
_NEW_TEXTURE, /* mesa */
@@ -352,6 +368,16 @@ const struct st_tracked_state st_update_vertex_texture = {
};
+const struct st_tracked_state st_update_geometry_texture = {
+ "st_update_geometry_texture", /* name */
+ { /* dirty */
+ _NEW_TEXTURE, /* mesa */
+ ST_NEW_GEOMETRY_PROGRAM, /* st */
+ },
+ update_geometry_textures /* update */
+};
+
+
static void
finalize_textures(struct st_context *st)