anv/pipeline: Expose is_scalar_shader_stage
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 6 Nov 2015 23:12:33 +0000 (15:12 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 6 Nov 2015 23:12:33 +0000 (15:12 -0800)
src/vulkan/anv_pipeline.c
src/vulkan/anv_private.h

index e4f68350b81ccd1b4811bb2a59ab9e7e58a10c57..67579c14e87cfbb3f86773831c249f7daa06745c 100644 (file)
@@ -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.
index 6ba2e460a8d9d3039d0973d9bbd66328390bf8f0..631b92cf26716e6f9ef8fade9ead2e1ae09f3ff0 100644 (file)
@@ -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;