From 9bf044d2541e1612419ff2ba41758e71a6fd9a9c Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Tue, 3 Mar 2020 10:19:15 -0800 Subject: anv: Use a dynamic array for storing executables in pipeline Avoids waste for pipelines that don't use all the shaders, and is flexible enough to cover cases where there are multiple variants per shader (e.g. SIMD8/16/32 for fragment shader). Even though we could pre-calculate the exact size of the array, this is not a critical path so it is worth preventing the bug that will likely happen when new variants are added but not accounted for. Reviewed-by: Ian Romanick Reviewed-by: Jason Ekstrand Part-of: --- src/intel/vulkan/anv_private.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/intel/vulkan/anv_private.h') diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index cdb2a725a91..3607b7d4fcd 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -3145,9 +3145,6 @@ anv_shader_bin_unref(struct anv_device *device, struct anv_shader_bin *shader) anv_shader_bin_destroy(device, shader); } -/* 5 possible simultaneous shader stages and FS may have up to 3 binaries */ -#define MAX_PIPELINE_EXECUTABLES 7 - struct anv_pipeline_executable { gl_shader_stage stage; @@ -3178,8 +3175,7 @@ struct anv_pipeline { struct anv_shader_bin * shaders[MESA_SHADER_STAGES]; - uint32_t num_executables; - struct anv_pipeline_executable executables[MAX_PIPELINE_EXECUTABLES]; + struct util_dynarray executables; const struct gen_l3_config * l3_config; -- cgit v1.2.3