From c2f2c8e407207c31c29aab5570d23cd6e98d287a Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 16 Jun 2016 15:26:54 -0700 Subject: anv: Use different BOs for different scratch sizes and stages This solves a race condition where we can end up having different stages stomp on each other because they're all trying to scratch in the same BO but they have different views of its layout. Signed-off-by: Jason Ekstrand Cc: "12.0" --- src/intel/vulkan/gen8_pipeline.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/intel/vulkan/gen8_pipeline.c') diff --git a/src/intel/vulkan/gen8_pipeline.c b/src/intel/vulkan/gen8_pipeline.c index 53fca2b46e8..6d70df6921c 100644 --- a/src/intel/vulkan/gen8_pipeline.c +++ b/src/intel/vulkan/gen8_pipeline.c @@ -361,8 +361,10 @@ genX(graphics_pipeline_create)( gs.ExpectedVertexCount = gs_prog_data->vertices_in; gs.ScratchSpaceBasePointer = (struct anv_address) { - .bo = NULL, - .offset = pipeline->scratch_start[MESA_SHADER_GEOMETRY], + .bo = anv_scratch_pool_alloc(device, &device->scratch_pool, + MESA_SHADER_GEOMETRY, + gs_prog_data->base.base.total_scratch), + .offset = 0, }; gs.PerThreadScratchSpace = scratch_space(&gs_prog_data->base.base); gs.OutputVertexSize = gs_prog_data->output_vertex_size_hwords * 2 - 1; @@ -431,8 +433,10 @@ genX(graphics_pipeline_create)( vs.SoftwareExceptionEnable = false; vs.ScratchSpaceBasePointer = (struct anv_address) { - .bo = NULL, - .offset = pipeline->scratch_start[MESA_SHADER_VERTEX], + .bo = anv_scratch_pool_alloc(device, &device->scratch_pool, + MESA_SHADER_VERTEX, + vs_prog_data->base.base.total_scratch), + .offset = 0, }; vs.PerThreadScratchSpace = scratch_space(&vs_prog_data->base.base); @@ -483,8 +487,10 @@ genX(graphics_pipeline_create)( ps.MaximumNumberofThreadsPerPSD = 64 - num_thread_bias; ps.ScratchSpaceBasePointer = (struct anv_address) { - .bo = NULL, - .offset = pipeline->scratch_start[MESA_SHADER_FRAGMENT], + .bo = anv_scratch_pool_alloc(device, &device->scratch_pool, + MESA_SHADER_FRAGMENT, + wm_prog_data->base.total_scratch), + .offset = 0, }; ps.PerThreadScratchSpace = scratch_space(&wm_prog_data->base); -- cgit v1.2.3