aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_texture.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-01-05 23:53:30 +0100
committerSamuel Pitoiset <[email protected]>2016-02-13 16:01:01 +0100
commit805d92e54038255c145e464670d3352276ae27a9 (patch)
tree743ca7564b0b88a5786a896bf93ea45989290ea5 /src/mesa/state_tracker/st_atom_texture.c
parent61c87cd2c0698fad68e4a02c44cdcbd4fd00191a (diff)
st/mesa: add state validation for compute shaders
This binds atomics, constants, samplers, ssbos, textures and ubos. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_atom_texture.c')
-rw-r--r--src/mesa/state_tracker/st_atom_texture.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index 3e3775200a8..b4e6f9b639a 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -534,6 +534,22 @@ update_tesseval_textures(struct st_context *st)
}
+static void
+update_compute_textures(struct st_context *st)
+{
+ const struct gl_context *ctx = st->ctx;
+
+ if (ctx->ComputeProgram._Current) {
+ update_textures(st,
+ MESA_SHADER_COMPUTE,
+ &ctx->ComputeProgram._Current->Base,
+ ctx->Const.Program[MESA_SHADER_COMPUTE].MaxTextureImageUnits,
+ st->state.sampler_views[PIPE_SHADER_COMPUTE],
+ &st->state.num_sampler_views[PIPE_SHADER_COMPUTE]);
+ }
+}
+
+
const struct st_tracked_state st_update_fragment_texture = {
"st_update_texture", /* name */
{ /* dirty */
@@ -582,3 +598,13 @@ const struct st_tracked_state st_update_tesseval_texture = {
},
update_tesseval_textures /* update */
};
+
+
+const struct st_tracked_state st_update_compute_texture = {
+ "st_update_compute_texture", /* name */
+ { /* dirty */
+ _NEW_TEXTURE, /* mesa */
+ ST_NEW_COMPUTE_PROGRAM | ST_NEW_SAMPLER_VIEWS, /* st */
+ },
+ update_compute_textures /* update */
+};