summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-10-08 15:02:25 -0700
committerJason Ekstrand <[email protected]>2015-10-19 08:47:03 -0700
commit4889c73dd1ed0af7920b950f6810361a6eeabcc2 (patch)
tree2ca99b6a17b7446203af317642ac2a6b77300dd6
parentfe399f3a69689a78ca4a5fb5a6b76435adcd41e5 (diff)
nir/info: Add compute shader local size to nir_shader_info
Reviewed-by: Topi Pohjolainen <[email protected]>
-rw-r--r--src/glsl/nir/glsl_to_nir.cpp8
-rw-r--r--src/glsl/nir/nir.h4
2 files changed, 12 insertions, 0 deletions
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
index 95b2312f30e..d230ad4416d 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -173,6 +173,14 @@ glsl_to_nir(const struct gl_shader_program *shader_prog,
shader->info.gs.invocations = sh->Geom.Invocations;
break;
+ case MESA_SHADER_COMPUTE: {
+ struct gl_compute_program *cp = (struct gl_compute_program *)sh->Program;
+ shader->info.cs.local_size[0] = cp->LocalSize[0];
+ shader->info.cs.local_size[1] = cp->LocalSize[1];
+ shader->info.cs.local_size[2] = cp->LocalSize[2];
+ break;
+ }
+
default:
break; /* No stage-specific info */
}
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index 719e6cebff4..32259e720d9 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -1501,6 +1501,10 @@ typedef struct nir_shader_info {
/** 1 .. MAX_GEOMETRY_SHADER_INVOCATIONS */
unsigned invocations;
} gs;
+
+ struct {
+ unsigned local_size[3];
+ } cs;
};
} nir_shader_info;