diff options
author | Dave Airlie <[email protected]> | 2017-06-07 09:04:30 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-06-07 10:24:36 +1000 |
commit | 734ea16bdb8f06f74177664577a754b029504e4b (patch) | |
tree | 34322370c241200f51539eb412d13f432b405ef1 /src/amd/vulkan/radv_pipeline.c | |
parent | 3f48021b86e3876405376798b545f5b28622cf77 (diff) |
radv: move calculating the vertex sgpr to the pipeline.
There is no need to calculate this at draw time.
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_pipeline.c')
-rw-r--r-- | src/amd/vulkan/radv_pipeline.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 6671acd6633..e77f9597bac 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -2206,6 +2206,16 @@ radv_pipeline_init(struct radv_pipeline *pipeline, pipeline->binding_stride[desc->binding] = desc->stride; } + struct ac_userdata_info *loc = radv_lookup_user_sgpr(pipeline, MESA_SHADER_VERTEX, + AC_UD_VS_BASE_VERTEX_START_INSTANCE); + if (loc->sgpr_idx != -1) { + pipeline->graphics.vtx_base_sgpr = radv_shader_stage_to_user_data_0(MESA_SHADER_VERTEX, radv_pipeline_has_gs(pipeline), radv_pipeline_has_tess(pipeline)); + pipeline->graphics.vtx_base_sgpr += loc->sgpr_idx * 4; + if (pipeline->shaders[MESA_SHADER_VERTEX]->info.info.vs.needs_draw_id) + pipeline->graphics.vtx_emit_num = 3; + else + pipeline->graphics.vtx_emit_num = 2; + } if (device->debug_flags & RADV_DEBUG_DUMP_SHADER_STATS) { radv_dump_pipeline_stats(device, pipeline); } |