rhi: d3d12: Implement missing setNativeLayout function

Change-Id: I8281cf3cfadc2f7cb04017b05f05feb6c5047d9c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Laszlo Agocs 2023-02-17 15:32:27 +01:00
parent 3653ca72b1
commit 3e1100f908
2 changed files with 8 additions and 0 deletions

View File

@ -4049,6 +4049,13 @@ QRhiTexture::NativeTexture QD3D12Texture::nativeTexture()
return {};
}
void QD3D12Texture::setNativeLayout(int layout)
{
QRHI_RES_RHI(QRhiD3D12);
if (QD3D12Resource *res = rhiD->resourcePool.lookupRef(handle))
res->state = D3D12_RESOURCE_STATES(layout);
}
QD3D12Sampler::QD3D12Sampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
AddressMode u, AddressMode v, AddressMode w)
: QRhiSampler(rhi, magFilter, minFilter, mipmapMode, u, v, w)

View File

@ -703,6 +703,7 @@ struct QD3D12Texture : public QRhiTexture
bool create() override;
bool createFrom(NativeTexture src) override;
NativeTexture nativeTexture() override;
void setNativeLayout(int layout) override;
bool prepareCreate(QSize *adjustedSize = nullptr);
bool finishCreate();