From 57eed6698b5cf462f762a4b04ef45ec84c01f262 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 26 Oct 2021 16:39:08 +0300 Subject: [PATCH] intel/compiler: tracker number of ray queries in prog_data Signed-off-by: Lionel Landwerlin Reviewed-by: Caio Oliveira Part-of: --- src/intel/compiler/brw_compiler.h | 3 +++ src/intel/compiler/brw_fs.cpp | 3 +++ src/intel/compiler/brw_shader.cpp | 1 + src/intel/compiler/brw_vec4.cpp | 1 + src/intel/compiler/brw_vec4_gs_visitor.cpp | 1 + src/intel/compiler/brw_vec4_tcs.cpp | 1 + 6 files changed, 10 insertions(+) diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h index 984bb9695a6..fec4d6f43a7 100644 --- a/src/intel/compiler/brw_compiler.h +++ b/src/intel/compiler/brw_compiler.h @@ -769,6 +769,9 @@ struct brw_stage_prog_data { /** Does this program pull from any UBO or other constant buffers? */ bool has_ubo_pull; + /** How many ray queries objects in this shader. */ + unsigned ray_queries; + /** * Register where the thread expects to find input data from the URB * (typically uniforms, followed by vertex or fragment attributes). diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 3bd002726ad..4ccaea593c4 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -9687,6 +9687,7 @@ brw_compile_fs(const struct brw_compiler *compiler, INTEL_DEBUG(params->debug_flag ? params->debug_flag : DEBUG_WM); prog_data->base.stage = MESA_SHADER_FRAGMENT; + prog_data->base.ray_queries = nir->info.ray_queries; const struct intel_device_info *devinfo = compiler->devinfo; const unsigned max_subgroup_size = compiler->devinfo->ver >= 6 ? 32 : 16; @@ -10056,6 +10057,7 @@ brw_compile_cs(const struct brw_compiler *compiler, prog_data->base.stage = MESA_SHADER_COMPUTE; prog_data->base.total_shared = nir->info.shared_size; + prog_data->base.ray_queries = nir->info.ray_queries; if (!nir->info.workgroup_size_variable) { prog_data->local_size[0] = nir->info.workgroup_size[0]; @@ -10314,6 +10316,7 @@ brw_compile_bs(const struct brw_compiler *compiler, const bool debug_enabled = INTEL_DEBUG(DEBUG_RT); prog_data->base.stage = shader->info.stage; + prog_data->base.ray_queries = shader->info.ray_queries; prog_data->max_stack_size = 0; fs_generator g(compiler, params->log_data, mem_ctx, &prog_data->base, diff --git a/src/intel/compiler/brw_shader.cpp b/src/intel/compiler/brw_shader.cpp index c41152f1c3c..98bd33c6605 100644 --- a/src/intel/compiler/brw_shader.cpp +++ b/src/intel/compiler/brw_shader.cpp @@ -1342,6 +1342,7 @@ brw_compile_tes(const struct brw_compiler *compiler, const unsigned *assembly; prog_data->base.base.stage = MESA_SHADER_TESS_EVAL; + prog_data->base.base.ray_queries = nir->info.ray_queries; nir->info.inputs_read = key->inputs_read; nir->info.patch_inputs_read = key->patch_inputs_read; diff --git a/src/intel/compiler/brw_vec4.cpp b/src/intel/compiler/brw_vec4.cpp index 8af19b18943..6f4f18abac4 100644 --- a/src/intel/compiler/brw_vec4.cpp +++ b/src/intel/compiler/brw_vec4.cpp @@ -2542,6 +2542,7 @@ brw_compile_vs(const struct brw_compiler *compiler, INTEL_DEBUG(params->debug_flag ? params->debug_flag : DEBUG_VS); prog_data->base.base.stage = MESA_SHADER_VERTEX; + prog_data->base.base.ray_queries = nir->info.ray_queries; const bool is_scalar = compiler->scalar_stage[MESA_SHADER_VERTEX]; brw_nir_apply_key(nir, compiler, &key->base, 8, is_scalar); diff --git a/src/intel/compiler/brw_vec4_gs_visitor.cpp b/src/intel/compiler/brw_vec4_gs_visitor.cpp index 4e9669316d5..2d3c651dc51 100644 --- a/src/intel/compiler/brw_vec4_gs_visitor.cpp +++ b/src/intel/compiler/brw_vec4_gs_visitor.cpp @@ -596,6 +596,7 @@ brw_compile_gs(const struct brw_compiler *compiler, const bool debug_enabled = INTEL_DEBUG(DEBUG_GS); prog_data->base.base.stage = MESA_SHADER_GEOMETRY; + prog_data->base.base.ray_queries = nir->info.ray_queries; /* The GLSL linker will have already matched up GS inputs and the outputs * of prior stages. The driver does extend VS outputs in some cases, but diff --git a/src/intel/compiler/brw_vec4_tcs.cpp b/src/intel/compiler/brw_vec4_tcs.cpp index 6d18c1548f6..0ae713fef28 100644 --- a/src/intel/compiler/brw_vec4_tcs.cpp +++ b/src/intel/compiler/brw_vec4_tcs.cpp @@ -366,6 +366,7 @@ brw_compile_tcs(const struct brw_compiler *compiler, const unsigned *assembly; vue_prog_data->base.stage = MESA_SHADER_TESS_CTRL; + prog_data->base.base.ray_queries = nir->info.ray_queries; nir->info.outputs_written = key->outputs_written; nir->info.patch_outputs_written = key->patch_outputs_written;