Mesa (master): ilo: add kernel queries for compute shaders

Chia-I Wu olv at kemper.freedesktop.org
Thu Nov 6 02:45:42 UTC 2014


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

Author: Chia-I Wu <olvaffe at gmail.com>
Date:   Thu Oct 30 10:03:17 2014 +0800

ilo: add kernel queries for compute shaders

We need to know the local/input/private sizes and others.  This is not
complete.  We need many others for CURBE setup.

Signed-off-by: Chia-I Wu <olvaffe at gmail.com>

---

 src/gallium/drivers/ilo/ilo_shader.c               |   25 ++++++++++++++++++++
 src/gallium/drivers/ilo/ilo_shader.h               |    9 +++++++
 .../drivers/ilo/shader/ilo_shader_internal.h       |    3 +++
 3 files changed, 37 insertions(+)

diff --git a/src/gallium/drivers/ilo/ilo_shader.c b/src/gallium/drivers/ilo/ilo_shader.c
index f4203aa..626bc1b 100644
--- a/src/gallium/drivers/ilo/ilo_shader.c
+++ b/src/gallium/drivers/ilo/ilo_shader.c
@@ -1036,6 +1036,12 @@ ilo_shader_get_kernel_param(const struct ilo_shader_state *shader,
    case ILO_KERNEL_SURFACE_CONST_COUNT:
       val = kernel->bt.const_count;
       break;
+   case ILO_KERNEL_SURFACE_RES_BASE:
+      val = kernel->bt.res_base;
+      break;
+   case ILO_KERNEL_SURFACE_RES_COUNT:
+      val = kernel->bt.res_count;
+      break;
 
    case ILO_KERNEL_VS_INPUT_INSTANCEID:
       val = shader->info.has_instanceid;
@@ -1111,6 +1117,25 @@ ilo_shader_get_kernel_param(const struct ilo_shader_state *shader,
       val = kernel->bt.rt_count;
       break;
 
+   case ILO_KERNEL_CS_LOCAL_SIZE:
+      val = shader->info.compute.req_local_mem;
+      break;
+   case ILO_KERNEL_CS_PRIVATE_SIZE:
+      val = shader->info.compute.req_private_mem;
+      break;
+   case ILO_KERNEL_CS_INPUT_SIZE:
+      val = shader->info.compute.req_input_mem;
+      break;
+   case ILO_KERNEL_CS_SIMD_SIZE:
+      val = 16;
+      break;
+   case ILO_KERNEL_CS_SURFACE_GLOBAL_BASE:
+      val = kernel->bt.global_base;
+      break;
+   case ILO_KERNEL_CS_SURFACE_GLOBAL_COUNT:
+      val = kernel->bt.global_count;
+      break;
+
    default:
       assert(!"unknown kernel parameter");
       val = 0;
diff --git a/src/gallium/drivers/ilo/ilo_shader.h b/src/gallium/drivers/ilo/ilo_shader.h
index c66513e..ea500e3 100644
--- a/src/gallium/drivers/ilo/ilo_shader.h
+++ b/src/gallium/drivers/ilo/ilo_shader.h
@@ -43,6 +43,8 @@ enum ilo_kernel_param {
    ILO_KERNEL_SURFACE_TEX_COUNT,
    ILO_KERNEL_SURFACE_CONST_BASE,
    ILO_KERNEL_SURFACE_CONST_COUNT,
+   ILO_KERNEL_SURFACE_RES_BASE,
+   ILO_KERNEL_SURFACE_RES_COUNT,
 
    ILO_KERNEL_VS_INPUT_INSTANCEID,
    ILO_KERNEL_VS_INPUT_VERTEXID,
@@ -69,6 +71,13 @@ enum ilo_kernel_param {
    ILO_KERNEL_FS_SURFACE_RT_BASE,
    ILO_KERNEL_FS_SURFACE_RT_COUNT,
 
+   ILO_KERNEL_CS_LOCAL_SIZE,
+   ILO_KERNEL_CS_PRIVATE_SIZE,
+   ILO_KERNEL_CS_INPUT_SIZE,
+   ILO_KERNEL_CS_SIMD_SIZE,
+   ILO_KERNEL_CS_SURFACE_GLOBAL_BASE,
+   ILO_KERNEL_CS_SURFACE_GLOBAL_COUNT,
+
    ILO_KERNEL_PARAM_COUNT,
 };
 
diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_internal.h b/src/gallium/drivers/ilo/shader/ilo_shader_internal.h
index 98ec8dd..c55fde7 100644
--- a/src/gallium/drivers/ilo/shader/ilo_shader_internal.h
+++ b/src/gallium/drivers/ilo/shader/ilo_shader_internal.h
@@ -138,9 +138,12 @@ struct ilo_shader {
       int rt_base, rt_count;
       int tex_base, tex_count;
       int const_base, const_count;
+      int res_base, res_count;
 
       int gen6_so_base, gen6_so_count;
 
+      int global_base, global_count;
+
       int total_count;
    } bt;
 




More information about the mesa-commit mailing list