mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
panvk: Emit viewport when state is NULL
When rasterizerDiscardEnable is active, it is allowed to have viewport and scissor disabled. In case we don't have any viewport defined we now define an empty one. This is required for "dEQP-VK.api.pipeline.pipeline_invalid_pointers_unused_structs.graphics" as it never set any viewports and cause fault on IDVS jobs as a result. Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30293>
This commit is contained in:
parent
cec45cac84
commit
0329070233
1 changed files with 11 additions and 2 deletions
|
|
@ -778,11 +778,20 @@ static void
|
|||
panvk_draw_prepare_viewport(struct panvk_cmd_buffer *cmdbuf,
|
||||
struct panvk_draw_info *draw)
|
||||
{
|
||||
if (is_dirty(cmdbuf, VP_VIEWPORTS) || is_dirty(cmdbuf, VP_SCISSORS)) {
|
||||
/* When rasterizerDiscardEnable is active, it is allowed to have viewport and
|
||||
* scissor disabled.
|
||||
* As a result, we define an empty one.
|
||||
*/
|
||||
if (!cmdbuf->state.gfx.vpd || is_dirty(cmdbuf, VP_VIEWPORTS) ||
|
||||
is_dirty(cmdbuf, VP_SCISSORS)) {
|
||||
struct panfrost_ptr vp =
|
||||
pan_pool_alloc_desc(&cmdbuf->desc_pool.base, VIEWPORT);
|
||||
|
||||
panvk_emit_viewport(&cmdbuf->vk.dynamic_graphics_state.vp, vp.cpu);
|
||||
const struct vk_viewport_state *vps =
|
||||
&cmdbuf->vk.dynamic_graphics_state.vp;
|
||||
|
||||
if (vps->viewport_count > 0)
|
||||
panvk_emit_viewport(vps, vp.cpu);
|
||||
cmdbuf->state.gfx.vpd = vp.gpu;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue