Skip to content

Commit fb4a631

Browse files
committed
fix texturelayout flag and another flag
1 parent 8d9cbbb commit fb4a631

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/API/DX/Device.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,10 @@ static D3D12_RESOURCE_DESC getResourceDescription(const Resource &R) {
150150
R.isTexture() ? B.OutputProps.Width : getUAVBufferSize(R);
151151
const uint32_t Height = R.isTexture() ? B.OutputProps.Height : 1;
152152
D3D12_TEXTURE_LAYOUT Layout;
153-
if (R.isTexture() && getDXKind(R.Kind) == SRV)
154-
Layout = D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE;
153+
if (R.isTexture())
154+
Layout = getDXKind(R.Kind) == SRV
155+
? D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE
156+
: D3D12_TEXTURE_LAYOUT_UNKNOWN;
155157
else
156158
Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
157159

@@ -589,7 +591,7 @@ class DXDevice : public offloadtest::Device {
589591
HeapDesc.Alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
590592
HeapDesc.SizeInBytes = static_cast<UINT64>(NumTiles) *
591593
D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
592-
HeapDesc.Flags = D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS;
594+
HeapDesc.Flags = D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES;
593595

594596
if (auto Err =
595597
HR::toError(Device->CreateHeap(&HeapDesc, IID_PPV_ARGS(&Heap)),

0 commit comments

Comments
 (0)