diff --git a/src/gui/rhi/qrhid3d12.cpp b/src/gui/rhi/qrhid3d12.cpp index f018492ef1..a62e41319d 100644 --- a/src/gui/rhi/qrhid3d12.cpp +++ b/src/gui/rhi/qrhid3d12.cpp @@ -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) diff --git a/src/gui/rhi/qrhid3d12_p_p.h b/src/gui/rhi/qrhid3d12_p_p.h index 1048e66142..9f72055e7c 100644 --- a/src/gui/rhi/qrhid3d12_p_p.h +++ b/src/gui/rhi/qrhid3d12_p_p.h @@ -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();