1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-29 17:52:18 +01:00

[d3d11] UAV prep work + cleanups

This commit is contained in:
Philip Rebohle 2017-12-27 01:36:45 +01:00
parent 8d5a2b92f9
commit 788f275315
5 changed files with 40 additions and 22 deletions

View File

@ -232,7 +232,7 @@ namespace dxvk {
D3D11TextureInfo textureInfo;
if (FAILED(GetCommonTextureInfo(pResource, &textureInfo))) {
Logger::err("D3D11DeviceContext: Cannot map a device-local image");
Logger::err("D3D11DeviceContext: Failed to retrieve texture info");
return E_FAIL;
}

View File

@ -22,6 +22,10 @@ namespace dxvk {
using D3D11ShaderResourceBindings = std::array<
Com<D3D11ShaderResourceView>, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT>;
using D3D11UnorderedAccessBindings = std::array<
Com<D3D11UnorderedAccessView>, D3D11_1_UAV_SLOT_COUNT>;
struct D3D11ContextStateVS {
Com<D3D11VertexShader> shader;
@ -68,6 +72,7 @@ namespace dxvk {
D3D11ConstantBufferBindings constantBuffers;
D3D11SamplerBindings samplers;
D3D11ShaderResourceBindings shaderResources;
D3D11UnorderedAccessBindings unorderedAccessViews;
};

View File

@ -11,21 +11,6 @@
#include "d3d11_texture.h"
#include "d3d11_view.h"
// These were copied from d3d11.h
// For some ridiculous reason, we cannot use the structures
// directly, although others from the same header work.
typedef struct D3D11_FEATURE_DATA_THREADING {
BOOL DriverConcurrentCreates;
BOOL DriverCommandLists;
} D3D11_FEATURE_DATA_THREADING;
typedef struct D3D11_FEATURE_DATA_DOUBLES {
BOOL DoublePrecisionFloatShaderOps;
} D3D11_FEATURE_DATA_DOUBLES;
typedef struct D3D11_FEATURE_DATA_FORMAT_SUPPORT {
DXGI_FORMAT InFormat;
UINT OutFormatSupport;
} D3D11_FEATURE_DATA_FORMAT_SUPPORT;
namespace dxvk {
D3D11Device::D3D11Device(
@ -268,7 +253,7 @@ namespace dxvk {
try {
*ppSRView = ref(new D3D11ShaderResourceView(
this, pResource, desc, nullptr,
this, pResource, desc,
m_dxvkDevice->createImageView(
textureInfo.image, viewInfo)));
return S_OK;
@ -372,7 +357,7 @@ namespace dxvk {
try {
*ppRTView = ref(new D3D11RenderTargetView(
this, pResource, desc, nullptr,
this, pResource, desc,
m_dxvkDevice->createImageView(
textureInfo.image, viewInfo)));
return S_OK;
@ -466,7 +451,7 @@ namespace dxvk {
try {
*ppDepthStencilView = ref(new D3D11DepthStencilView(
this, pResource, desc, nullptr,
this, pResource, desc,
m_dxvkDevice->createImageView(
textureInfo.image, viewInfo)));
return S_OK;

View File

@ -3,3 +3,24 @@
#include "../dxgi/dxgi_include.h"
#include <d3d11_1.h>
// This is not defined in the mingw headers
#ifndef D3D11_1_UAV_SLOT_COUNT
#define D3D11_1_UAV_SLOT_COUNT 64
#endif
// These were copied from d3d11.h
// For some strange reason, we cannot use the structures
// directly, although others from the same header work.
typedef struct D3D11_FEATURE_DATA_THREADING {
BOOL DriverConcurrentCreates;
BOOL DriverCommandLists;
} D3D11_FEATURE_DATA_THREADING;
typedef struct D3D11_FEATURE_DATA_DOUBLES {
BOOL DoublePrecisionFloatShaderOps;
} D3D11_FEATURE_DATA_DOUBLES;
typedef struct D3D11_FEATURE_DATA_FORMAT_SUPPORT {
DXGI_FORMAT InFormat;
UINT OutFormatSupport;
} D3D11_FEATURE_DATA_FORMAT_SUPPORT;

View File

@ -26,10 +26,17 @@ namespace dxvk {
D3D11Device* device,
ID3D11Resource* resource,
const DescType& desc,
const Rc<DxvkBufferView>& bufferView,
const Rc<DxvkBufferView>& bufferView)
: m_device(device), m_resource(resource),
m_desc(desc), m_bufferView(bufferView) { }
D3D11ResourceView(
D3D11Device* device,
ID3D11Resource* resource,
const DescType& desc,
const Rc<DxvkImageView>& imageView)
: m_device(device), m_resource(resource), m_desc(desc),
m_bufferView(bufferView), m_imageView(imageView) { }
: m_device(device), m_resource(resource),
m_desc(desc), m_imageView(imageView) { }
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) final {
COM_QUERY_IFACE(riid, ppvObject, IUnknown);