summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorazhirnov <zh1dron@gmail.com>2020-09-01 19:59:44 +0000
committerazhirnov <zh1dron@gmail.com>2020-09-01 21:57:32 +0000
commit2e6f369080b6911d17b4e8a5296ca8400b09de86 (patch)
tree0a553410f4cf68a979037bc373df5db274586d67 /Graphics
parentfixed compilation on linux & android (diff)
downloadDiligentCore-2e6f369080b6911d17b4e8a5296ca8400b09de86.tar.gz
DiligentCore-2e6f369080b6911d17b4e8a5296ca8400b09de86.zip
fixed compilation on Mac & UWP
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp3
-rw-r--r--Graphics/GraphicsEngineMetal/include/DeviceContextMtlImpl.h2
-rw-r--r--Graphics/GraphicsEngineMetal/src/DeviceContextMtlImpl.mm12
-rw-r--r--Graphics/GraphicsEngineMetal/src/PipelineStateMtlImpl.mm2
-rw-r--r--Graphics/GraphicsEngineVulkan/CMakeLists.txt7
-rw-r--r--Graphics/HLSLTools/src/DXILUtils.cpp43
6 files changed, 46 insertions, 23 deletions
diff --git a/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp b/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
index 1370a726..451cc610 100644
--- a/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
+++ b/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
@@ -162,7 +162,8 @@ static HRESULT CompileDxilShader(const char* Source,
//L"-Qembed_debug", // Embed debug info into the shader (some compilers do not recognize this flag)
L"-Od", // Disable optimization
#else
- L"-O3", // Optimization level 3
+ L"-Od", // TODO: something goes wrong if used any optimizations
+ //L"-O3", // Optimization level 3
#endif
};
diff --git a/Graphics/GraphicsEngineMetal/include/DeviceContextMtlImpl.h b/Graphics/GraphicsEngineMetal/include/DeviceContextMtlImpl.h
index 0bfff2b3..eaeaa0f0 100644
--- a/Graphics/GraphicsEngineMetal/include/DeviceContextMtlImpl.h
+++ b/Graphics/GraphicsEngineMetal/include/DeviceContextMtlImpl.h
@@ -106,6 +106,8 @@ public:
virtual void DrawIndexed(const DrawIndexedAttribs& Attribs) override final;
virtual void DrawIndirect(const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final;
virtual void DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final;
+ virtual void DrawMesh(const DrawMeshAttribs& Attribs) override final;
+ virtual void DrawMeshIndirect(const DrawMeshIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final;
virtual void DispatchCompute(const DispatchComputeAttribs& Attribs) override final;
virtual void DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) override final;
diff --git a/Graphics/GraphicsEngineMetal/src/DeviceContextMtlImpl.mm b/Graphics/GraphicsEngineMetal/src/DeviceContextMtlImpl.mm
index abfa15ba..b76fbb1f 100644
--- a/Graphics/GraphicsEngineMetal/src/DeviceContextMtlImpl.mm
+++ b/Graphics/GraphicsEngineMetal/src/DeviceContextMtlImpl.mm
@@ -55,7 +55,7 @@ namespace Diligent
LOG_ERROR_MESSAGE("DeviceContextMtlImpl::SetPipelineState() is not implemented");
auto& Desc = pPipelineStateMtl->GetDesc();
- if (Desc.IsComputePipeline)
+ if (Desc.IsComputePipeline())
{
}
@@ -138,6 +138,16 @@ namespace Diligent
LOG_ERROR_MESSAGE("DeviceContextMtlImpl::DrawIndexedIndirect() is not implemented");
}
+ void DeviceContextMtlImpl::DrawMesh(const DrawMeshAttribs& Attribs)
+ {
+ UNSUPPORTED("DrawMesh is not supported in Metal");
+ }
+
+ void DeviceContextMtlImpl::DrawMeshIndirect(const DrawMeshIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)
+ {
+ UNSUPPORTED("DrawMeshIndirect is not supported in Metal");
+ }
+
void DeviceContextMtlImpl::DispatchCompute(const DispatchComputeAttribs& Attribs)
{
if (!DvpVerifyDispatchArguments(Attribs))
diff --git a/Graphics/GraphicsEngineMetal/src/PipelineStateMtlImpl.mm b/Graphics/GraphicsEngineMetal/src/PipelineStateMtlImpl.mm
index 5ea1b909..ba399671 100644
--- a/Graphics/GraphicsEngineMetal/src/PipelineStateMtlImpl.mm
+++ b/Graphics/GraphicsEngineMetal/src/PipelineStateMtlImpl.mm
@@ -35,7 +35,7 @@ PipelineStateMtlImpl::PipelineStateMtlImpl(IReferenceCounters* pRefCo
TPipelineStateBase(pRefCounters, pRenderDeviceMtl, CreateInfo.PSODesc)
{
LOG_ERROR_AND_THROW("Pipeline states are not implemented in Metal backend");
- if (CreateInfo.PSODesc.IsComputePipeline)
+ if (CreateInfo.PSODesc.IsComputePipeline())
{
}
diff --git a/Graphics/GraphicsEngineVulkan/CMakeLists.txt b/Graphics/GraphicsEngineVulkan/CMakeLists.txt
index 896d91f1..f8445e5b 100644
--- a/Graphics/GraphicsEngineVulkan/CMakeLists.txt
+++ b/Graphics/GraphicsEngineVulkan/CMakeLists.txt
@@ -353,13 +353,6 @@ else()
)
endif()
-if(PLATFORM_LINUX)
- get_filename_component(VULKAN_LIBRARY_PATH ${Vulkan_LIBRARY} DIRECTORY)
- set_target_properties(Diligent-GraphicsEngineVk-shared PROPERTIES
- INSTALL_RPATH "${VULKAN_LIBRARY_PATH}"
- )
-endif()
-
set_common_target_properties(Diligent-GraphicsEngineVk-shared)
set_common_target_properties(Diligent-GraphicsEngineVk-static)
diff --git a/Graphics/HLSLTools/src/DXILUtils.cpp b/Graphics/HLSLTools/src/DXILUtils.cpp
index 376cfbca..aa496970 100644
--- a/Graphics/HLSLTools/src/DXILUtils.cpp
+++ b/Graphics/HLSLTools/src/DXILUtils.cpp
@@ -49,6 +49,11 @@
// Platforms that has DXIL compiler.
#if defined(PLATFORM_WIN32) || defined(PLATFORM_UNIVERSAL_WINDOWS) || defined(PLATFORM_LINUX)
+# ifdef _WIN32
+__declspec(dllimport) HMODULE __stdcall LoadLibraryA(LPCSTR);
+__declspec(dllimport) FARPROC __stdcall GetProcAddress(HMODULE, LPCSTR);
+# endif
+
namespace Diligent
{
namespace
@@ -362,22 +367,34 @@ bool DXILCompile(DXILCompilerTarget Target,
if (FAILED(hr))
return false;
- CComPtr<IDxcValidator> validator;
- hr = DxilCompiler->CreateInstance(CLSID_DxcValidator, IID_PPV_ARGS(&validator));
- if (FAILED(hr))
- return false;
-
- CComPtr<IDxcOperationResult> validationResult;
- hr = validator->Validate(compiled, DxcValidatorFlags_InPlaceEdit, &validationResult);
-
- if (FAILED(hr))
- return false; // validation failed
-
// validate and sign in
if (Target == DXILCompilerTarget::Direct3D12)
{
- HRESULT status;
- if (SUCCEEDED(validationResult->GetStatus(&status)) && FAILED(status))
+ CComPtr<IDxcValidator> validator;
+ hr = DxilCompiler->CreateInstance(CLSID_DxcValidator, IID_PPV_ARGS(&validator));
+ if (FAILED(hr))
+ return false;
+
+ CComPtr<IDxcOperationResult> validationResult;
+ hr = validator->Validate(compiled, DxcValidatorFlags_InPlaceEdit, &validationResult);
+
+ if (validationResult == nullptr || FAILED(hr))
+ return false; // validation failed
+
+ HRESULT status = E_FAIL;
+ validationResult->GetStatus(&status);
+
+ if (SUCCEEDED(status))
+ {
+ CComPtr<IDxcBlob> validated;
+ hr = validationResult->GetResult(&validated);
+ if (FAILED(hr))
+ return false;
+
+ *ppBlobOut = validated ? validated.Detach() : compiled.Detach();
+ return true;
+ }
+ else
{
CComPtr<IDxcBlobEncoding> validationOutput;
CComPtr<IDxcBlobEncoding> validationOutputUtf8;