From f7668d6fe5aed6706e7ee1c42d4053ed2c61adfb Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 4 Sep 2020 12:00:42 -0500 Subject: [PATCH] anv,iris: Move the SHADER_RELOC enums to brw_compiler.h They're common between the two drivers and we want to add a couple more that get emitted from code in src/intel/compiler. Reviewed-by: Lionel Landwerlin Part-of: --- src/gallium/drivers/iris/iris_context.h | 5 ----- src/gallium/drivers/iris/iris_program.c | 4 ++-- src/gallium/drivers/iris/iris_program_cache.c | 4 ++-- src/intel/compiler/brw_compiler.h | 5 +++++ src/intel/vulkan/anv_nir_apply_pipeline_layout.c | 4 ++-- src/intel/vulkan/anv_pipeline_cache.c | 4 ++-- src/intel/vulkan/anv_private.h | 5 ----- 7 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h index ca21bcd..f34aead 100644 --- a/src/gallium/drivers/iris/iris_context.h +++ b/src/gallium/drivers/iris/iris_context.h @@ -58,11 +58,6 @@ enum iris_param_domain { BRW_PARAM_DOMAIN_IMAGE, }; -enum iris_shader_reloc { - IRIS_SHADER_RELOC_CONST_DATA_ADDR_LOW, - IRIS_SHADER_RELOC_CONST_DATA_ADDR_HIGH, -}; - enum { DRI_CONF_BO_REUSE_DISABLED, DRI_CONF_BO_REUSE_ALL diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index ec3c493..9e5ae7a 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -440,8 +440,8 @@ iris_setup_uniforms(const struct brw_compiler *compiler, offset = nir_umin(&b, offset, nir_imm_int(&b, max_offset)); nir_ssa_def *const_data_base_addr = nir_pack_64_2x32_split(&b, - nir_load_reloc_const_intel(&b, IRIS_SHADER_RELOC_CONST_DATA_ADDR_LOW), - nir_load_reloc_const_intel(&b, IRIS_SHADER_RELOC_CONST_DATA_ADDR_HIGH)); + nir_load_reloc_const_intel(&b, BRW_SHADER_RELOC_CONST_DATA_ADDR_LOW), + nir_load_reloc_const_intel(&b, BRW_SHADER_RELOC_CONST_DATA_ADDR_HIGH)); nir_ssa_def *data = nir_load_global(&b, nir_iadd(&b, const_data_base_addr, diff --git a/src/gallium/drivers/iris/iris_program_cache.c b/src/gallium/drivers/iris/iris_program_cache.c index 5388615..36faeef 100644 --- a/src/gallium/drivers/iris/iris_program_cache.c +++ b/src/gallium/drivers/iris/iris_program_cache.c @@ -145,11 +145,11 @@ iris_upload_shader(struct iris_screen *screen, struct brw_shader_reloc_value reloc_values[] = { { - .id = IRIS_SHADER_RELOC_CONST_DATA_ADDR_LOW, + .id = BRW_SHADER_RELOC_CONST_DATA_ADDR_LOW, .value = shader_data_addr, }, { - .id = IRIS_SHADER_RELOC_CONST_DATA_ADDR_HIGH, + .id = BRW_SHADER_RELOC_CONST_DATA_ADDR_HIGH, .value = shader_data_addr >> 32, }, }; diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h index 3152dc3..65a0b57 100644 --- a/src/intel/compiler/brw_compiler.h +++ b/src/intel/compiler/brw_compiler.h @@ -675,6 +675,11 @@ enum brw_param_builtin { #define BRW_PARAM_BUILTIN_CLIP_PLANE_COMP(param) \ (((param) - BRW_PARAM_BUILTIN_CLIP_PLANE_0_X) & 0x3) +enum brw_shader_reloc_id { + BRW_SHADER_RELOC_CONST_DATA_ADDR_LOW, + BRW_SHADER_RELOC_CONST_DATA_ADDR_HIGH, +}; + /** Represents a code relocation * * Relocatable constants are immediates in the code which we want to be able diff --git a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c index e642ce1..0745e59 100644 --- a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c +++ b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c @@ -1079,8 +1079,8 @@ lower_load_constant(nir_builder *b, nir_intrinsic_instr *intrin, offset = nir_umin(b, offset, nir_imm_int(b, max_offset)); nir_ssa_def *const_data_base_addr = nir_pack_64_2x32_split(b, - nir_load_reloc_const_intel(b, ANV_SHADER_RELOC_CONST_DATA_ADDR_LOW), - nir_load_reloc_const_intel(b, ANV_SHADER_RELOC_CONST_DATA_ADDR_HIGH)); + nir_load_reloc_const_intel(b, BRW_SHADER_RELOC_CONST_DATA_ADDR_LOW), + nir_load_reloc_const_intel(b, BRW_SHADER_RELOC_CONST_DATA_ADDR_HIGH)); data = nir_load_global_constant(b, nir_iadd(b, const_data_base_addr, nir_u2u64(b, offset)), diff --git a/src/intel/vulkan/anv_pipeline_cache.c b/src/intel/vulkan/anv_pipeline_cache.c index dc4d123..b2491c2 100644 --- a/src/intel/vulkan/anv_pipeline_cache.c +++ b/src/intel/vulkan/anv_pipeline_cache.c @@ -84,11 +84,11 @@ anv_shader_bin_create(struct anv_device *device, struct brw_shader_reloc_value reloc_values[] = { { - .id = ANV_SHADER_RELOC_CONST_DATA_ADDR_LOW, + .id = BRW_SHADER_RELOC_CONST_DATA_ADDR_LOW, .value = shader_data_addr, }, { - .id = ANV_SHADER_RELOC_CONST_DATA_ADDR_HIGH, + .id = BRW_SHADER_RELOC_CONST_DATA_ADDR_HIGH, .value = shader_data_addr >> 32, }, }; diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 6d4b08b..7f454a2 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -3364,11 +3364,6 @@ void anv_semaphore_reset_temporary(struct anv_device *device, stage = __builtin_ffs(__tmp) - 1, __tmp; \ __tmp &= ~(1 << (stage))) -enum anv_shader_reloc { - ANV_SHADER_RELOC_CONST_DATA_ADDR_LOW, - ANV_SHADER_RELOC_CONST_DATA_ADDR_HIGH, -}; - struct anv_pipeline_bind_map { unsigned char surface_sha1[20]; unsigned char sampler_sha1[20]; -- 2.7.4