mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 08:40:11 +01:00
dzn: use a null-rtv to handle no-attachment
This fixes a crash in this test:
dEQP-VK.renderpass2.suballocation.simple.color_unused_omit_blend_state
Fixes: 2d0798440b ("dzn: Add support for dynamic rendering")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17027>
This commit is contained in:
parent
bd4c8f562c
commit
b45f1e24ae
2 changed files with 28 additions and 1 deletions
|
|
@ -231,6 +231,7 @@ dzn_cmd_buffer_reset(struct dzn_cmd_buffer *cmdbuf)
|
|||
hash_table_foreach(cmdbuf->rtvs.ht, he)
|
||||
vk_free(&cmdbuf->vk.pool->alloc, he->data);
|
||||
_mesa_hash_table_clear(cmdbuf->rtvs.ht, NULL);
|
||||
cmdbuf->null_rtv.ptr = 0;
|
||||
dzn_descriptor_heap_pool_reset(&cmdbuf->rtvs.pool);
|
||||
hash_table_foreach(cmdbuf->dsvs.ht, he)
|
||||
vk_free(&cmdbuf->vk.pool->alloc, he->data);
|
||||
|
|
@ -828,6 +829,29 @@ dzn_cmd_buffer_get_rtv(struct dzn_cmd_buffer *cmdbuf,
|
|||
return rtve->handle;
|
||||
}
|
||||
|
||||
static D3D12_CPU_DESCRIPTOR_HANDLE
|
||||
dzn_cmd_buffer_get_null_rtv(struct dzn_cmd_buffer *cmdbuf)
|
||||
{
|
||||
struct dzn_device *device = container_of(cmdbuf->vk.base.device, struct dzn_device, vk);
|
||||
|
||||
if (!cmdbuf->null_rtv.ptr) {
|
||||
struct dzn_descriptor_heap *heap;
|
||||
uint32_t slot;
|
||||
dzn_descriptor_heap_pool_alloc_slots(&cmdbuf->rtvs.pool, device, 1, &heap, &slot);
|
||||
cmdbuf->null_rtv = dzn_descriptor_heap_get_cpu_handle(heap, slot);
|
||||
|
||||
D3D12_RENDER_TARGET_VIEW_DESC desc = { 0 };
|
||||
desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
desc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D;
|
||||
desc.Texture2D.MipSlice = 0;
|
||||
desc.Texture2D.PlaneSlice = 0;
|
||||
|
||||
ID3D12Device1_CreateRenderTargetView(device->dev, NULL, &desc, cmdbuf->null_rtv);
|
||||
}
|
||||
|
||||
return cmdbuf->null_rtv;
|
||||
}
|
||||
|
||||
static VkResult
|
||||
dzn_cmd_buffer_alloc_internal_buf(struct dzn_cmd_buffer *cmdbuf,
|
||||
uint32_t size,
|
||||
|
|
@ -3450,8 +3474,10 @@ dzn_CmdBeginRendering(VkCommandBuffer commandBuffer,
|
|||
att->resolveImageLayout;
|
||||
cmdbuf->state.render.attachments.colors[i].store_op = att->storeOp;
|
||||
|
||||
if (!iview)
|
||||
if (!iview) {
|
||||
rt_handles[i] = dzn_cmd_buffer_get_null_rtv(cmdbuf);
|
||||
continue;
|
||||
}
|
||||
|
||||
struct dzn_image *img = container_of(iview->vk.image, struct dzn_image, vk);
|
||||
rt_handles[i] = dzn_cmd_buffer_get_rtv(cmdbuf, img, &iview->rtv_desc);
|
||||
|
|
|
|||
|
|
@ -544,6 +544,7 @@ struct dzn_cmd_buffer {
|
|||
} rtvs, dsvs;
|
||||
|
||||
struct dzn_descriptor_heap_pool cbv_srv_uav_pool, sampler_pool;
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE null_rtv;
|
||||
|
||||
struct list_head internal_bufs;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue