glsl_to_tgsi: set shader_info::writes_memory
authorMarek Olšák <marek.olsak@amd.com>
Wed, 11 Mar 2020 03:33:46 +0000 (23:33 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 26 Mar 2020 07:08:34 +0000 (03:08 -0400)
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4152>

src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 31ffa24958cbcb75a6fcab0849e16387e028e870..254f966b4e33add3c5397ae2c7b6cb76cf1111c8 100644 (file)
@@ -7344,6 +7344,14 @@ st_link_tgsi(struct gl_context *ctx, struct gl_shader_program *prog)
       st_set_prog_affected_state_flags(linked_prog);
 
       if (linked_prog) {
+         /* This is really conservative: */
+         linked_prog->info.writes_memory =
+            linked_prog->info.num_ssbos ||
+            linked_prog->info.num_images ||
+            ctx->Extensions.ARB_bindless_texture ||
+            (linked_prog->sh.LinkedTransformFeedback &&
+             linked_prog->sh.LinkedTransformFeedback->NumVarying);
+
          if (!ctx->Driver.ProgramStringNotify(ctx,
                                               _mesa_shader_stage_to_program(i),
                                               linked_prog)) {