Mesa (master): mesa: store shared size in gl_compute_program

Samuel Pitoiset hakzsam at kemper.freedesktop.org
Sat Feb 13 15:10:44 UTC 2016


Module: Mesa
Branch: master
Commit: a9eb1327be6932aae972532dbd87cd2fc50e846a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a9eb1327be6932aae972532dbd87cd2fc50e846a

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Wed Feb  3 18:08:46 2016 +0100

mesa: store shared size in gl_compute_program

The size of shared variables needs to be stored in gl_compute_program
in order to set up pipe_compute_state::req_local_mem.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/mesa/main/mtypes.h    | 5 +++++
 src/mesa/main/shaderapi.c | 1 +
 2 files changed, 6 insertions(+)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 840e226..432cda9 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2044,6 +2044,11 @@ struct gl_compute_program
     * Size specified using local_size_{x,y,z}.
     */
    unsigned LocalSize[3];
+
+   /**
+    * Size of shared variables accessed by the compute shader.
+    */
+   unsigned SharedSize;
 };
 
 
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index df92c09..cdf15b4 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -2124,6 +2124,7 @@ _mesa_copy_linked_program_data(gl_shader_stage type,
       int i;
       for (i = 0; i < 3; i++)
          dst_cp->LocalSize[i] = src->Comp.LocalSize[i];
+      dst_cp->SharedSize = src->Comp.SharedSize;
       break;
    }
    default:




More information about the mesa-commit mailing list