[Mesa-dev] [PATCH 6/6] anv: Enable UBO pushing
Jason Ekstrand
jason at jlekstrand.net
Sat Dec 2 01:20:09 UTC 2017
---
src/intel/vulkan/anv_device.c | 1 +
src/intel/vulkan/anv_pipeline.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 937efb9..43781bd 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -405,6 +405,7 @@ anv_physical_device_init(struct anv_physical_device *device,
device->compiler->shader_debug_log = compiler_debug_log;
device->compiler->shader_perf_log = compiler_perf_log;
device->compiler->supports_pull_constants = false;
+ device->compiler->constant_buffer_0_is_relative = true;
isl_device_init(&device->isl_dev, &device->info, swizzled);
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 907b24a..3bb19ff 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -385,6 +385,9 @@ anv_pipeline_compile(struct anv_pipeline *pipeline,
struct brw_stage_prog_data *prog_data,
struct anv_pipeline_bind_map *map)
{
+ const struct brw_compiler *compiler =
+ pipeline->device->instance->physicalDevice.compiler;
+
nir_shader *nir = anv_shader_compile_to_nir(pipeline, mem_ctx,
module, entrypoint, stage,
spec_info);
@@ -436,6 +439,9 @@ anv_pipeline_compile(struct anv_pipeline *pipeline,
if (pipeline->layout)
anv_nir_apply_pipeline_layout(pipeline, nir, prog_data, map);
+ if (stage != MESA_SHADER_COMPUTE)
+ brw_nir_analyze_ubo_ranges(compiler, nir, prog_data->ubo_ranges);
+
assert(nir->num_uniforms == prog_data->nr_params * 4);
return nir;
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list