ilo: add kernel queries for compute shaders
authorChia-I Wu <olvaffe@gmail.com>
Thu, 30 Oct 2014 02:03:17 +0000 (10:03 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Thu, 6 Nov 2014 02:42:19 +0000 (10:42 +0800)
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@gmail.com>
src/gallium/drivers/ilo/ilo_shader.c
src/gallium/drivers/ilo/ilo_shader.h
src/gallium/drivers/ilo/shader/ilo_shader_internal.h

index f4203aa97565d3d816e7e745c81fb10aa06e28bd..626bc1b9c4596d79fffe6f007e073dc82059c21f 100644 (file)
@@ -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;
index c66513e27e09c34fd3a0c6f52d04a3e58b9907e8..ea500e328ee8f06ee2e63b18a78f893c0b4f8ab0 100644 (file)
@@ -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,
 };
 
index 98ec8dd0e04bb1af2ea4300d8a9bae5403a3fe57..c55fde78ef0ad9b9adfae196a223233bec65608d 100644 (file)
@@ -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;