radv: pre-calculate viewport transforms
this requires more storage in the viewport struct, but it avoids the need to repeatedly calculate the same transform if e.g., a meta operation occurs, which can save about 5% cpu in some cases Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11839>
This commit is contained in:

committed by
Marge Bot

parent
1e13cb1965
commit
a2ef92d7a5
@@ -1540,6 +1540,9 @@ radv_pipeline_init_dynamic_state(struct radv_pipeline *pipeline,
|
||||
if (states & RADV_DYNAMIC_VIEWPORT) {
|
||||
typed_memcpy(dynamic->viewport.viewports, pCreateInfo->pViewportState->pViewports,
|
||||
pCreateInfo->pViewportState->viewportCount);
|
||||
for (unsigned i = 0; i < dynamic->viewport.count; i++)
|
||||
radv_get_viewport_xform(&dynamic->viewport.viewports[i],
|
||||
dynamic->viewport.xform[i].scale, dynamic->viewport.xform[i].translate);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user