summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/genX_pipeline.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-11-12 12:13:17 -0800
committerJason Ekstrand <[email protected]>2016-11-16 10:09:16 -0800
commitd33e2ad67c3621a01648292ece2148aa8b7d2fdb (patch)
tree62f77b24375828225d9a70192ed91be45a922c0f /src/intel/vulkan/genX_pipeline.c
parent8db6f2e6ebb9b41aadfa8becef2f948ce1b27568 (diff)
anv: Move INTERFACE_DESCRIPTOR_DATA setup to the pipeline
There are a few dynamic bits, namely binding table and sampler addresses, but most of it is static and really belongs in the pipeline. It certainly doesn't belong in flush_compute_descriptor_set. We'll use the same state merging trick we use for gen7 DEPTH_STENCIL. Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/intel/vulkan/genX_pipeline.c')
-rw-r--r--src/intel/vulkan/genX_pipeline.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c
index a8df968f6b0..2cc5c7d4ef0 100644
--- a/src/intel/vulkan/genX_pipeline.c
+++ b/src/intel/vulkan/genX_pipeline.c
@@ -1470,6 +1470,32 @@ compute_pipeline_create(
vfe.CURBEAllocationSize = vfe_curbe_allocation;
}
+ const struct anv_shader_bin *cs_bin =
+ pipeline->shaders[MESA_SHADER_COMPUTE];
+ struct GENX(INTERFACE_DESCRIPTOR_DATA) desc = {
+ .KernelStartPointer = cs_bin->kernel.offset,
+
+ .SamplerCount = get_sampler_count(cs_bin),
+ .BindingTableEntryCount = get_binding_table_entry_count(cs_bin),
+ .BarrierEnable = cs_prog_data->uses_barrier,
+ .SharedLocalMemorySize =
+ encode_slm_size(GEN_GEN, cs_prog_data->base.total_shared),
+
+#if !GEN_IS_HASWELL
+ .ConstantURBEntryReadOffset = 0,
+#endif
+ .ConstantURBEntryReadLength = cs_prog_data->push.per_thread.regs,
+#if GEN_GEN >= 8 || GEN_IS_HASWELL
+ .CrossThreadConstantDataReadLength =
+ cs_prog_data->push.cross_thread.regs,
+#endif
+
+ .NumberofThreadsinGPGPUThreadGroup = cs_prog_data->threads,
+ };
+ GENX(INTERFACE_DESCRIPTOR_DATA_pack)(NULL,
+ pipeline->interface_descriptor_data,
+ &desc);
+
*pPipeline = anv_pipeline_to_handle(pipeline);
return VK_SUCCESS;