mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-29 17:52:18 +01:00
[d3d11] Return error if an application creates an RTV for a buffer
Vulkan does not support buffer RTVs, and neither does DXVK, so we should return an error in that case. Previously, DXVK would crash upon querying image information.
This commit is contained in:
parent
69dd05b269
commit
0a473b4f86
@ -581,10 +581,15 @@ namespace dxvk {
|
||||
ID3D11Resource* pResource,
|
||||
const D3D11_RENDER_TARGET_VIEW_DESC* pDesc,
|
||||
ID3D11RenderTargetView** ppRTView) {
|
||||
// Only 2D textures and 2D texture arrays are allowed
|
||||
// DXVK only supports render target views for image resources
|
||||
D3D11_RESOURCE_DIMENSION resourceDim = D3D11_RESOURCE_DIMENSION_UNKNOWN;
|
||||
pResource->GetType(&resourceDim);
|
||||
|
||||
if (resourceDim == D3D11_RESOURCE_DIMENSION_BUFFER) {
|
||||
Logger::err("D3D11: Cannot create render target view for a buffer");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
// The view description is optional. If not defined, it
|
||||
// will use the resource's format and all array layers.
|
||||
D3D11_RENDER_TARGET_VIEW_DESC desc;
|
||||
@ -698,7 +703,6 @@ namespace dxvk {
|
||||
ID3D11Resource* pResource,
|
||||
const D3D11_DEPTH_STENCIL_VIEW_DESC* pDesc,
|
||||
ID3D11DepthStencilView** ppDepthStencilView) {
|
||||
// Only 2D textures and 2D texture arrays are allowed
|
||||
D3D11_RESOURCE_DIMENSION resourceDim = D3D11_RESOURCE_DIMENSION_UNKNOWN;
|
||||
pResource->GetType(&resourceDim);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user