summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3DBase
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-09-16 23:11:56 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-09-16 23:11:56 +0000
commit0cc841bc76eda21793f2a158b0ededad5a5ae3bf (patch)
tree39e1f2bee602263336754d990eaab557f16b98d6 /Graphics/GraphicsEngineD3DBase
parentAnother improvement to texture format tests in OpenGL (diff)
downloadDiligentCore-0cc841bc76eda21793f2a158b0ededad5a5ae3bf.tar.gz
DiligentCore-0cc841bc76eda21793f2a158b0ededad5a5ae3bf.zip
Added GPU vendor and memory size detection (API 240071), closed https://github.com/DiligentGraphics/DiligentCore/issues/144.
Fixed shader model selection in D3D12 backend
Diffstat (limited to 'Graphics/GraphicsEngineD3DBase')
-rw-r--r--Graphics/GraphicsEngineD3DBase/include/RenderDeviceD3DBase.hpp25
-rw-r--r--Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp2
2 files changed, 26 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngineD3DBase/include/RenderDeviceD3DBase.hpp b/Graphics/GraphicsEngineD3DBase/include/RenderDeviceD3DBase.hpp
index 61e5fb12..738a8efe 100644
--- a/Graphics/GraphicsEngineD3DBase/include/RenderDeviceD3DBase.hpp
+++ b/Graphics/GraphicsEngineD3DBase/include/RenderDeviceD3DBase.hpp
@@ -30,7 +30,10 @@
/// \file
/// Implementation of the Diligent::RenderDeviceBase template class and related structures
+#include <dxgi.h>
+
#include "RenderDeviceBase.hpp"
+#include "GraphicsAccessories.hpp"
namespace Diligent
{
@@ -178,6 +181,28 @@ public:
Features.PixelUAVWritesAndAtomics = DEVICE_FEATURE_STATE_ENABLED;
Features.TextureUAVExtendedFormats = DEVICE_FEATURE_STATE_ENABLED;
}
+
+protected:
+ void ReadAdapterInfo(IDXGIAdapter1* pdxgiAdapter)
+ {
+ DXGI_ADAPTER_DESC1 dxgiAdapterDesc = {};
+
+ auto hr = pdxgiAdapter->GetDesc1(&dxgiAdapterDesc);
+ if (SUCCEEDED(hr))
+ {
+ auto& AdapterInfo = m_DeviceCaps.AdapterInfo;
+
+ AdapterInfo.Type = (dxgiAdapterDesc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) ? ADAPTER_TYPE_SOFTWARE : ADAPTER_TYPE_HARDWARE;
+ AdapterInfo.Vendor = VendorIdToAdapterVendor(dxgiAdapterDesc.VendorId);
+ AdapterInfo.DeviceLocalMemory = dxgiAdapterDesc.DedicatedVideoMemory;
+ AdapterInfo.HostVisibileMemory = dxgiAdapterDesc.SharedSystemMemory;
+ AdapterInfo.UnifiedMemory = 0;
+ }
+ else
+ {
+ LOG_ERROR_MESSAGE("Failed to get DXGIDevice adapter desc. Adapter properties will be unknown.");
+ }
+ }
};
} // namespace Diligent
diff --git a/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp b/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
index 4ac72599..14ceb576 100644
--- a/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
+++ b/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
@@ -142,7 +142,7 @@ ShaderD3DBase::ShaderD3DBase(const ShaderCreateInfo& ShaderCI, const ShaderVersi
if (UseDXC)
{
VERIFY_EXPR(__uuidof(ID3DBlob) == __uuidof(IDxcBlob));
- DxCompiler->Compile(ShaderCI, nullptr, reinterpret_cast<IDxcBlob**>(&m_pShaderByteCode), nullptr, ShaderCI.ppCompilerOutput);
+ DxCompiler->Compile(ShaderCI, ShaderModel, nullptr, reinterpret_cast<IDxcBlob**>(&m_pShaderByteCode), nullptr, ShaderCI.ppCompilerOutput);
}
else
{