vkd3d: Mark resources as being RTAS depending on initial resource state.
RTAS must stay in this resource state forever. The only way to synchronize them is UAV barriers. Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
parent
86f7fdfe7a
commit
221a658884
|
@ -2300,6 +2300,10 @@ static HRESULT d3d12_resource_create(struct d3d12_device *device, uint32_t flags
|
|||
object->format = vkd3d_format_from_d3d12_resource_desc(device, desc, 0);
|
||||
object->res.cookie = vkd3d_allocate_cookie();
|
||||
|
||||
/* RTAS are "special" buffers. They can never transition out of this state. */
|
||||
if (initial_state == D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE)
|
||||
object->flags |= VKD3D_RESOURCE_ACCELERATION_STRUCTURE;
|
||||
|
||||
if (heap_properties)
|
||||
object->heap_properties = *heap_properties;
|
||||
object->heap_flags = heap_flags;
|
||||
|
|
|
@ -615,12 +615,13 @@ struct d3d12_heap *unsafe_impl_from_ID3D12Heap(ID3D12Heap *iface);
|
|||
|
||||
enum vkd3d_resource_flag
|
||||
{
|
||||
VKD3D_RESOURCE_COMMITTED = (1u << 0),
|
||||
VKD3D_RESOURCE_PLACED = (1u << 1),
|
||||
VKD3D_RESOURCE_RESERVED = (1u << 2),
|
||||
VKD3D_RESOURCE_ALLOCATION = (1u << 3),
|
||||
VKD3D_RESOURCE_LINEAR_TILING = (1u << 4),
|
||||
VKD3D_RESOURCE_EXTERNAL = (1u << 5),
|
||||
VKD3D_RESOURCE_COMMITTED = (1u << 0),
|
||||
VKD3D_RESOURCE_PLACED = (1u << 1),
|
||||
VKD3D_RESOURCE_RESERVED = (1u << 2),
|
||||
VKD3D_RESOURCE_ALLOCATION = (1u << 3),
|
||||
VKD3D_RESOURCE_LINEAR_TILING = (1u << 4),
|
||||
VKD3D_RESOURCE_EXTERNAL = (1u << 5),
|
||||
VKD3D_RESOURCE_ACCELERATION_STRUCTURE = (1u << 6),
|
||||
};
|
||||
|
||||
struct d3d12_sparse_image_region
|
||||
|
@ -708,6 +709,11 @@ static inline bool d3d12_resource_is_buffer(const struct d3d12_resource *resourc
|
|||
return resource->desc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER;
|
||||
}
|
||||
|
||||
static inline bool d3d12_resource_is_acceleration_structure(const struct d3d12_resource *resource)
|
||||
{
|
||||
return !!(resource->flags & VKD3D_RESOURCE_ACCELERATION_STRUCTURE);
|
||||
}
|
||||
|
||||
static inline bool d3d12_resource_is_texture(const struct d3d12_resource *resource)
|
||||
{
|
||||
return resource->desc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER;
|
||||
|
|
Loading…
Reference in New Issue