diff options
author | Jason Ekstrand <[email protected]> | 2016-11-12 08:07:54 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-11-16 10:08:38 -0800 |
commit | 623e1e06d8cf4150b9cffea1072ca6b21f7719e2 (patch) | |
tree | 296f32849201fcde2bc1e2560496b2e44ec3234e /src/intel/vulkan/gen7_pipeline.c | |
parent | 0087064f26d94ded714b9d6231fdb815a9f3f9a1 (diff) |
anv/pipeline: Get rid of the kernel pointer fields
Now that we have anv_shader_bin, they're completely redundant with other
information we have in the pipeline. For vertex shaders, we also go
through way too much work to put the offset in one or the other field and
then look at which one we put it in later.
Reviewed-by: Timothy Arceri <[email protected]>
Reviewed-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/intel/vulkan/gen7_pipeline.c')
-rw-r--r-- | src/intel/vulkan/gen7_pipeline.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/intel/vulkan/gen7_pipeline.c b/src/intel/vulkan/gen7_pipeline.c index b54610c072c..57d44773e77 100644 --- a/src/intel/vulkan/gen7_pipeline.c +++ b/src/intel/vulkan/gen7_pipeline.c @@ -106,14 +106,14 @@ genX(graphics_pipeline_create)( gen7_emit_vs_workaround_flush(brw); #endif - if (pipeline->vs_vec4 == NO_KERNEL) { + if (!anv_pipeline_has_stage(pipeline, MESA_SHADER_VERTEX)) { anv_batch_emit(&pipeline->batch, GENX(3DSTATE_VS), vs); } else { const struct anv_shader_bin *vs_bin = pipeline->shaders[MESA_SHADER_VERTEX]; anv_batch_emit(&pipeline->batch, GENX(3DSTATE_VS), vs) { - vs.KernelStartPointer = pipeline->vs_vec4; + vs.KernelStartPointer = vs_bin->kernel.offset; vs.ScratchSpaceBasePointer = (struct anv_address) { .bo = anv_scratch_pool_alloc(device, &device->scratch_pool, @@ -139,14 +139,14 @@ genX(graphics_pipeline_create)( const struct brw_gs_prog_data *gs_prog_data = get_gs_prog_data(pipeline); - if (pipeline->gs_kernel == NO_KERNEL) { + if (!anv_pipeline_has_stage(pipeline, MESA_SHADER_GEOMETRY)) { anv_batch_emit(&pipeline->batch, GENX(3DSTATE_GS), gs); } else { const struct anv_shader_bin *gs_bin = pipeline->shaders[MESA_SHADER_GEOMETRY]; anv_batch_emit(&pipeline->batch, GENX(3DSTATE_GS), gs) { - gs.KernelStartPointer = pipeline->gs_kernel; + gs.KernelStartPointer = gs_bin->kernel.offset; gs.ScratchSpaceBasePointer = (struct anv_address) { .bo = anv_scratch_pool_alloc(device, &device->scratch_pool, @@ -184,7 +184,7 @@ genX(graphics_pipeline_create)( } } - if (pipeline->ps_ksp0 == NO_KERNEL) { + if (!anv_pipeline_has_stage(pipeline, MESA_SHADER_FRAGMENT)) { anv_batch_emit(&pipeline->batch, GENX(3DSTATE_SBE), sbe); anv_batch_emit(&pipeline->batch, GENX(3DSTATE_WM), wm) { @@ -205,8 +205,8 @@ genX(graphics_pipeline_create)( } else { const struct anv_shader_bin *fs_bin = pipeline->shaders[MESA_SHADER_FRAGMENT]; - const struct brw_wm_prog_data *wm_prog_data = get_wm_prog_data(pipeline); + if (wm_prog_data->urb_setup[VARYING_SLOT_BFC0] != -1 || wm_prog_data->urb_setup[VARYING_SLOT_BFC1] != -1) anv_finishme("two-sided color needs sbe swizzling setup"); @@ -216,9 +216,10 @@ genX(graphics_pipeline_create)( emit_3dstate_sbe(pipeline); anv_batch_emit(&pipeline->batch, GENX(3DSTATE_PS), ps) { - ps.KernelStartPointer0 = pipeline->ps_ksp0; + ps.KernelStartPointer0 = fs_bin->kernel.offset; ps.KernelStartPointer1 = 0; - ps.KernelStartPointer2 = pipeline->ps_ksp0 + wm_prog_data->prog_offset_2; + ps.KernelStartPointer2 = fs_bin->kernel.offset + + wm_prog_data->prog_offset_2; ps.ScratchSpaceBasePointer = (struct anv_address) { .bo = anv_scratch_pool_alloc(device, &device->scratch_pool, |