From 66814ea8db65ee4dfa306a9ae5306eafc4d71c15 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 18 Jul 2020 00:10:31 +0200 Subject: [PATCH] Revert "[d3d11] Move D3D11Shader implementation to its own file" Useless since it doesn't fix the clang problem. --- src/d3d11/d3d11_context_state.h | 2 +- src/d3d11/d3d11_device.cpp | 2 +- src/d3d11/d3d11_initializer.h | 1 - src/d3d11/d3d11_shader.h | 66 +++++++++++++++++++++++++++++ src/d3d11/d3d11_shader_types.h | 73 --------------------------------- 5 files changed, 68 insertions(+), 76 deletions(-) delete mode 100644 src/d3d11/d3d11_shader_types.h diff --git a/src/d3d11/d3d11_context_state.h b/src/d3d11/d3d11_context_state.h index 59c13ccb..eca2a3c9 100644 --- a/src/d3d11/d3d11_context_state.h +++ b/src/d3d11/d3d11_context_state.h @@ -6,7 +6,7 @@ #include "d3d11_input_layout.h" #include "d3d11_query.h" #include "d3d11_sampler.h" -#include "d3d11_shader_types.h" +#include "d3d11_shader.h" #include "d3d11_state.h" #include "d3d11_view_dsv.h" #include "d3d11_view_rtv.h" diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 914a572c..13db3b60 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -17,7 +17,7 @@ #include "d3d11_query.h" #include "d3d11_resource.h" #include "d3d11_sampler.h" -#include "d3d11_shader_types.h" +#include "d3d11_shader.h" #include "d3d11_state_object.h" #include "d3d11_swapchain.h" #include "d3d11_texture.h" diff --git a/src/d3d11/d3d11_initializer.h b/src/d3d11/d3d11_initializer.h index 46656d4c..de6e6099 100644 --- a/src/d3d11/d3d11_initializer.h +++ b/src/d3d11/d3d11_initializer.h @@ -2,7 +2,6 @@ #include "d3d11_buffer.h" #include "d3d11_texture.h" -#include "d3d11_view_uav.h" namespace dxvk { diff --git a/src/d3d11/d3d11_shader.h b/src/d3d11/d3d11_shader.h index 4d3da55c..3a26a46c 100644 --- a/src/d3d11/d3d11_shader.h +++ b/src/d3d11/d3d11_shader.h @@ -59,6 +59,72 @@ namespace dxvk { }; + /** + * \brief Common shader interface + * + * Implements methods for all D3D11*Shader + * interfaces and stores the actual shader + * module object. + */ + template + class D3D11Shader : public D3D11DeviceChild { + using D3D10ShaderClass = D3D10Shader; + public: + + D3D11Shader(D3D11Device* device, const D3D11CommonShader& shader) + : m_device(device), m_shader(shader), m_d3d10(this) { } + + ~D3D11Shader() { } + + HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) final { + *ppvObject = nullptr; + + if (riid == __uuidof(IUnknown) + || riid == __uuidof(ID3D11DeviceChild) + || riid == __uuidof(D3D11Interface)) { + *ppvObject = ref(this); + return S_OK; + } + + if (riid == __uuidof(IUnknown) + || riid == __uuidof(ID3D10DeviceChild) + || riid == __uuidof(D3D10Interface)) { + *ppvObject = ref(&m_d3d10); + return S_OK; + } + + Logger::warn("D3D11Shader::QueryInterface: Unknown interface query"); + return E_NOINTERFACE; + } + + void STDMETHODCALLTYPE GetDevice(ID3D11Device **ppDevice) final { + *ppDevice = m_device.ref(); + } + + const D3D11CommonShader* GetCommonShader() const { + return &m_shader; + } + + D3D10ShaderClass* GetD3D10Iface() { + return &m_d3d10; + } + + private: + + Com m_device; + D3D11CommonShader m_shader; + D3D10ShaderClass m_d3d10; + + }; + + using D3D11VertexShader = D3D11Shader; + using D3D11HullShader = D3D11Shader; + using D3D11DomainShader = D3D11Shader; + using D3D11GeometryShader = D3D11Shader; + using D3D11PixelShader = D3D11Shader; + using D3D11ComputeShader = D3D11Shader; + + /** * \brief Shader module set * diff --git a/src/d3d11/d3d11_shader_types.h b/src/d3d11/d3d11_shader_types.h deleted file mode 100644 index 2510c1c8..00000000 --- a/src/d3d11/d3d11_shader_types.h +++ /dev/null @@ -1,73 +0,0 @@ -#pragma once - -#include "d3d11_device.h" -#include "d3d11_shader.h" - -namespace dxvk { - - /** - * \brief Common shader interface - * - * Implements methods for all D3D11*Shader - * interfaces and stores the actual shader - * module object. - */ - template - class D3D11Shader : public D3D11DeviceChild { - using D3D10ShaderClass = D3D10Shader; - public: - - D3D11Shader(D3D11Device* device, const D3D11CommonShader& shader) - : m_device(device), m_shader(shader), m_d3d10(this) { } - - ~D3D11Shader() { } - - HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) final { - *ppvObject = nullptr; - - if (riid == __uuidof(IUnknown) - || riid == __uuidof(ID3D11DeviceChild) - || riid == __uuidof(D3D11Interface)) { - *ppvObject = ref(this); - return S_OK; - } - - if (riid == __uuidof(IUnknown) - || riid == __uuidof(ID3D10DeviceChild) - || riid == __uuidof(D3D10Interface)) { - *ppvObject = ref(&m_d3d10); - return S_OK; - } - - Logger::warn("D3D11Shader::QueryInterface: Unknown interface query"); - return E_NOINTERFACE; - } - - void STDMETHODCALLTYPE GetDevice(ID3D11Device **ppDevice) final { - *ppDevice = m_device.ref(); - } - - const D3D11CommonShader* GetCommonShader() const { - return &m_shader; - } - - D3D10ShaderClass* GetD3D10Iface() { - return &m_d3d10; - } - - private: - - Com m_device; - D3D11CommonShader m_shader; - D3D10ShaderClass m_d3d10; - - }; - - using D3D11VertexShader = D3D11Shader; - using D3D11HullShader = D3D11Shader; - using D3D11DomainShader = D3D11Shader; - using D3D11GeometryShader = D3D11Shader; - using D3D11PixelShader = D3D11Shader; - using D3D11ComputeShader = D3D11Shader; - -} \ No newline at end of file