From 1932df174dbec55f7a4fa31b0660cdc8ceb7657c Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Wed, 6 Mar 2019 00:02:14 -0800 Subject: Final updates to make GL backend work --- DiligentCore | 2 +- DiligentSamples | 2 +- DiligentTools | 2 +- Projects/Asteroids/src/asteroids_DE.cpp | 2 +- Tests/TestApp/src/ShaderConverterTest.cpp | 34 +++++++++++----------- Tests/TestApp/src/TestApp.cpp | 4 +-- .../PluginSource/src/RenderAPI_OpenGLCoreES.cpp | 4 +-- .../src/DiligentGraphicsAdapterGL.cpp | 4 +-- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/DiligentCore b/DiligentCore index bdbca67..c87e69d 160000 --- a/DiligentCore +++ b/DiligentCore @@ -1 +1 @@ -Subproject commit bdbca67b0e03baec3b9dd803e803d267210e892b +Subproject commit c87e69d08937a012ed00d9c5395b942a8f6de9b1 diff --git a/DiligentSamples b/DiligentSamples index 6a58ebe..e0361c0 160000 --- a/DiligentSamples +++ b/DiligentSamples @@ -1 +1 @@ -Subproject commit 6a58ebeb40987b6b6658906569f4974581063004 +Subproject commit e0361c03aa143b5d160b6669c1cfd86f93734177 diff --git a/DiligentTools b/DiligentTools index 3143f62..5b2da8d 160000 --- a/DiligentTools +++ b/DiligentTools @@ -1 +1 @@ -Subproject commit 3143f62446c373f600583de07ba0e2e33364149d +Subproject commit 5b2da8d2da0a71465a5bcbc9ed4780eb8568c891 diff --git a/Projects/Asteroids/src/asteroids_DE.cpp b/Projects/Asteroids/src/asteroids_DE.cpp index 52be188..5962108 100644 --- a/Projects/Asteroids/src/asteroids_DE.cpp +++ b/Projects/Asteroids/src/asteroids_DE.cpp @@ -156,7 +156,7 @@ void Asteroids::InitDevice(HWND hWnd, DeviceType DevType) LoadGraphicsEngineOpenGL(GetEngineFactoryOpenGL); } #endif - EngineGLAttribs CreationAttribs; + EngineGLCreateInfo CreationAttribs; CreationAttribs.pNativeWndHandle = hWnd; GetEngineFactoryOpenGL()->CreateDeviceAndSwapChainGL( CreationAttribs, &mDevice, &mDeviceCtxt, SwapChainDesc, &mSwapChain); diff --git a/Tests/TestApp/src/ShaderConverterTest.cpp b/Tests/TestApp/src/ShaderConverterTest.cpp index b69f7fb..e0049a7 100644 --- a/Tests/TestApp/src/ShaderConverterTest.cpp +++ b/Tests/TestApp/src/ShaderConverterTest.cpp @@ -38,29 +38,29 @@ using namespace Diligent; ShaderConverterTest::ShaderConverterTest( IRenderDevice *pRenderDevice, IDeviceContext *pContext ) : UnitTestBase("Shader Converter Test") { - ShaderCreationAttribs CreationAttrs; - CreationAttrs.FilePath = "Shaders\\ConverterTest.fx"; + ShaderCreateInfo ShaderCI; + ShaderCI.FilePath = "Shaders\\ConverterTest.fx"; BasicShaderSourceStreamFactory BasicSSSFactory("Shaders"); - CreationAttrs.pShaderSourceStreamFactory = &BasicSSSFactory; - CreationAttrs.SourceLanguage = SHADER_SOURCE_LANGUAGE_HLSL; - CreationAttrs.Desc.Name = "Test converted shader"; - CreationAttrs.UseCombinedTextureSamplers = pRenderDevice->GetDeviceCaps().IsGLDevice(); + ShaderCI.pShaderSourceStreamFactory = &BasicSSSFactory; + ShaderCI.SourceLanguage = SHADER_SOURCE_LANGUAGE_HLSL; + ShaderCI.Desc.Name = "Test converted shader"; + ShaderCI.UseCombinedTextureSamplers = pRenderDevice->GetDeviceCaps().IsGLDevice(); RefCntAutoPtr pStream; - CreationAttrs.ppConversionStream = pStream.GetRawDblPtr(); + ShaderCI.ppConversionStream = pStream.GetRawDblPtr(); { - CreationAttrs.Desc.ShaderType = SHADER_TYPE_PIXEL; - CreationAttrs.EntryPoint = "TestPS"; + ShaderCI.Desc.ShaderType = SHADER_TYPE_PIXEL; + ShaderCI.EntryPoint = "TestPS"; RefCntAutoPtr pShader; - pRenderDevice->CreateShader( CreationAttrs, &pShader ); + pRenderDevice->CreateShader( ShaderCI, &pShader ); VERIFY_EXPR( pShader ); } { - CreationAttrs.EntryPoint = "TestVS"; - CreationAttrs.Desc.ShaderType = SHADER_TYPE_VERTEX; + ShaderCI.EntryPoint = "TestVS"; + ShaderCI.Desc.ShaderType = SHADER_TYPE_VERTEX; RefCntAutoPtr pShader; - pRenderDevice->CreateShader( CreationAttrs, &pShader ); + pRenderDevice->CreateShader( ShaderCI, &pShader ); VERIFY_EXPR( pShader ); } @@ -68,11 +68,11 @@ ShaderConverterTest::ShaderConverterTest( IRenderDevice *pRenderDevice, IDeviceC if(pRenderDevice->GetDeviceCaps().bComputeShadersSupported) { #if PLATFORM_LINUX - CreationAttrs.FilePath = "Shaders\\CSConversionTest.fx"; - CreationAttrs.EntryPoint = "TestCS"; - CreationAttrs.Desc.ShaderType = SHADER_TYPE_COMPUTE; + ShaderCI.FilePath = "Shaders\\CSConversionTest.fx"; + ShaderCI.EntryPoint = "TestCS"; + ShaderCI.Desc.ShaderType = SHADER_TYPE_COMPUTE; RefCntAutoPtr pShader; - pRenderDevice->CreateShader( CreationAttrs, &pShader ); + pRenderDevice->CreateShader( ShaderCI, &pShader ); VERIFY_EXPR( pShader ); #elif PLATFORM_WIN32 status = "Skipped compute shader conversion test as on Win32, only 8 image uniforms are allowed. Besides, an error is generated when passing image as a function argument."; diff --git a/Tests/TestApp/src/TestApp.cpp b/Tests/TestApp/src/TestApp.cpp index b859ac4..dcfca89 100644 --- a/Tests/TestApp/src/TestApp.cpp +++ b/Tests/TestApp/src/TestApp.cpp @@ -249,8 +249,8 @@ void TestApp::InitializeDiligentEngine( // Load the dll and import GetEngineFactoryOpenGL() function LoadGraphicsEngineOpenGL(GetEngineFactoryOpenGL); #endif - auto *pFactoryOpenGL = GetEngineFactoryOpenGL(); - EngineGLAttribs CreationAttribs; + auto* pFactoryOpenGL = GetEngineFactoryOpenGL(); + EngineGLCreateInfo CreationAttribs; CreationAttribs.pNativeWndHandle = NativeWindowHandle; #if PLATFORM_LINUX CreationAttribs.pDisplay = display; diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_OpenGLCoreES.cpp b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_OpenGLCoreES.cpp index 3d4899c..d56979e 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_OpenGLCoreES.cpp +++ b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_OpenGLCoreES.cpp @@ -6,7 +6,7 @@ #if SUPPORT_OPENGL_UNIFIED #include "RenderAPI.h" -#include "RenderDeviceFactoryOpenGL.h" +#include "EngineFactoryOpenGL.h" #include "DeviceContextGL.h" #include "RenderDeviceGL.h" @@ -49,7 +49,7 @@ void RenderAPI_OpenGLCoreES::ProcessDeviceEvent(UnityGfxDeviceEventType type, IU if (type == kUnityGfxDeviceEventInitialize) { auto *pFactoryGL = GetEngineFactoryOpenGL(); - EngineGLAttribs Attribs; + EngineGLCreateInfo Attribs; pFactoryGL->AttachToActiveGLContext(Attribs, &m_Device, &m_Context); if (m_Context) { diff --git a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterGL.cpp b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterGL.cpp index 58cb89d..43cd75e 100644 --- a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterGL.cpp +++ b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterGL.cpp @@ -3,7 +3,7 @@ #if GL_SUPPORTED || GLES_SUPPORTED #include "UnityGraphicsGLCoreES_Emulator.h" -#include "RenderDeviceFactoryOpenGL.h" +#include "EngineFactoryOpenGL.h" #include "SwapChainBase.h" #include "DefaultRawMemoryAllocator.h" @@ -69,7 +69,7 @@ DiligentGraphicsAdapterGL::DiligentGraphicsAdapterGL(const UnityGraphicsGLCoreES auto *UnityGraphicsGLImpl = UnityGraphicsGL.GetGraphicsImpl(); auto *pFactoryGL = GetEngineFactoryOpenGL(); - EngineGLAttribs Attribs; + EngineGLCreateInfo Attribs; pFactoryGL->AttachToActiveGLContext(Attribs, &m_pDevice, &m_pDeviceCtx); auto BackBufferGLFormat = UnityGraphicsGLImpl->GetBackBufferFormat(); -- cgit v1.2.3