mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-02 22:29:16 +01:00
[d3d11] Validate buffer view bind flags
This commit is contained in:
parent
b06eb4fe2a
commit
f586970c59
@ -65,6 +65,20 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool D3D11Buffer::CheckViewCompatibility(
|
||||||
|
UINT BindFlags,
|
||||||
|
DXGI_FORMAT Format) const {
|
||||||
|
// Check whether the given bind flags are supported
|
||||||
|
VkBufferUsageFlags usage = GetBufferUsageFlags(BindFlags);
|
||||||
|
|
||||||
|
if ((m_buffer->info().usage & usage) != usage)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// TODO implement format validation
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Rc<DxvkBuffer> D3D11Buffer::CreateBuffer(
|
Rc<DxvkBuffer> D3D11Buffer::CreateBuffer(
|
||||||
const D3D11_BUFFER_DESC* pDesc) const {
|
const D3D11_BUFFER_DESC* pDesc) const {
|
||||||
DxvkBufferCreateInfo info;
|
DxvkBufferCreateInfo info;
|
||||||
|
@ -37,6 +37,10 @@ namespace dxvk {
|
|||||||
void STDMETHODCALLTYPE GetDesc(
|
void STDMETHODCALLTYPE GetDesc(
|
||||||
D3D11_BUFFER_DESC *pDesc) final;
|
D3D11_BUFFER_DESC *pDesc) final;
|
||||||
|
|
||||||
|
bool CheckViewCompatibility(
|
||||||
|
UINT BindFlags,
|
||||||
|
DXGI_FORMAT Format) const;
|
||||||
|
|
||||||
const D3D11_BUFFER_DESC* Desc() const {
|
const D3D11_BUFFER_DESC* Desc() const {
|
||||||
return &m_desc;
|
return &m_desc;
|
||||||
}
|
}
|
||||||
|
@ -35,10 +35,11 @@ namespace dxvk {
|
|||||||
UINT BindFlags,
|
UINT BindFlags,
|
||||||
DXGI_FORMAT Format) {
|
DXGI_FORMAT Format) {
|
||||||
auto texture = GetCommonTexture(pResource);
|
auto texture = GetCommonTexture(pResource);
|
||||||
|
auto buffer = GetCommonBuffer (pResource);
|
||||||
|
|
||||||
return texture != nullptr
|
return texture != nullptr
|
||||||
? texture->CheckViewCompatibility(BindFlags, Format)
|
? texture->CheckViewCompatibility(BindFlags, Format)
|
||||||
: true; /* for buffers */
|
: buffer ->CheckViewCompatibility(BindFlags, Format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user