From 1b5c7e7ecd43d3526c0a6831ff6c1edfab4529af Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 6 Nov 2015 15:12:33 -0800 Subject: anv/pipeline: Expose is_scalar_shader_stage --- src/vulkan/anv_pipeline.c | 11 ++++++----- src/vulkan/anv_private.h | 3 +++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/vulkan/anv_pipeline.c b/src/vulkan/anv_pipeline.c index e4f68350b81..67579c14e87 100644 --- a/src/vulkan/anv_pipeline.c +++ b/src/vulkan/anv_pipeline.c @@ -121,8 +121,9 @@ static const gl_shader_stage vk_shader_stage_to_mesa_stage[] = { [VK_SHADER_STAGE_COMPUTE] = MESA_SHADER_COMPUTE, }; -static bool -is_scalar_shader_stage(const struct brw_compiler *compiler, VkShaderStage stage) +bool +anv_is_scalar_shader_stage(const struct brw_compiler *compiler, + VkShaderStage stage) { switch (stage) { case VK_SHADER_STAGE_VERTEX: @@ -187,7 +188,7 @@ anv_shader_compile_to_nir(struct anv_device *device, assert(entrypoint != NULL); brw_preprocess_nir(nir, &device->info, - is_scalar_shader_stage(compiler, vk_stage)); + anv_is_scalar_shader_stage(compiler, vk_stage)); nir_shader_gather_info(nir, entrypoint); @@ -357,7 +358,7 @@ anv_pipeline_compile(struct anv_pipeline *pipeline, if (nir == NULL) return NULL; - anv_nir_lower_push_constants(nir, is_scalar_shader_stage(compiler, stage)); + anv_nir_lower_push_constants(nir, anv_is_scalar_shader_stage(compiler, stage)); /* Figure out the number of parameters */ prog_data->nr_params = 0; @@ -409,7 +410,7 @@ anv_pipeline_compile(struct anv_pipeline *pipeline, /* Finish the optimization and compilation process */ brw_postprocess_nir(nir, &pipeline->device->info, - is_scalar_shader_stage(compiler, stage)); + anv_is_scalar_shader_stage(compiler, stage)); /* nir_lower_io will only handle the push constants; we need to set this * to the full number of possible uniforms. diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h index 6ba2e460a8d..631b92cf267 100644 --- a/src/vulkan/anv_private.h +++ b/src/vulkan/anv_private.h @@ -430,6 +430,9 @@ struct anv_physical_device { struct brw_compiler * compiler; }; +bool anv_is_scalar_shader_stage(const struct brw_compiler *compiler, + VkShaderStage stage); + struct anv_instance { VK_LOADER_DATA _loader_data; -- cgit v1.2.3