mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-02 04:29:14 +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(
|
||||
const D3D11_BUFFER_DESC* pDesc) const {
|
||||
DxvkBufferCreateInfo info;
|
||||
|
@ -37,6 +37,10 @@ namespace dxvk {
|
||||
void STDMETHODCALLTYPE GetDesc(
|
||||
D3D11_BUFFER_DESC *pDesc) final;
|
||||
|
||||
bool CheckViewCompatibility(
|
||||
UINT BindFlags,
|
||||
DXGI_FORMAT Format) const;
|
||||
|
||||
const D3D11_BUFFER_DESC* Desc() const {
|
||||
return &m_desc;
|
||||
}
|
||||
|
@ -35,10 +35,11 @@ namespace dxvk {
|
||||
UINT BindFlags,
|
||||
DXGI_FORMAT Format) {
|
||||
auto texture = GetCommonTexture(pResource);
|
||||
auto buffer = GetCommonBuffer (pResource);
|
||||
|
||||
return texture != nullptr
|
||||
? texture->CheckViewCompatibility(BindFlags, Format)
|
||||
: true; /* for buffers */
|
||||
: buffer ->CheckViewCompatibility(BindFlags, Format);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user