Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/startup_stubs/d3d12_draw.inl
Original file line number Diff line number Diff line change
Expand Up @@ -2839,10 +2839,15 @@ bool resolve_pixel_uavs(const Translation& tr, const Pass& pass, PixelUavBinding
if (resource->own().tiled_address_srv) return refuse(i, "resource is a texture by title address", record.resource);
auto* texture = static_cast<ID3D12Resource*>(resource->own().real);
D3D12_UNORDERED_ACCESS_VIEW_DESC title_view{};
const bool described = record.desc_bytes >= sizeof(title_view);
// The guest record is ViewRecord::uav_desc_bytes wide whatever the desktop struct is. Ordering this
// by sizeof(title_view) refuses every described view when the Agility header makes that struct 48
// bytes, because the record still carries 40 and the view reads as truncated.
constexpr std::size_t record_bytes = ViewRecord::uav_desc_bytes;
static_assert(sizeof(title_view) >= record_bytes);
const bool described = record.desc_bytes >= record_bytes;
if (record.desc_bytes && !described) return refuse(i, "truncated view description", record.desc_bytes);
if (described) {
std::memcpy(&title_view, record.desc, sizeof(title_view));
std::memcpy(&title_view, record.desc, record_bytes);
title_view.Format = desktop_format(title_view.Format);
}
const D3D12_RESOURCE_DESC desc = texture->GetDesc();
Expand Down
Loading