Update glslang; fix BOO_HAS_GL on Windows

This commit is contained in:
Luke Street 2020-04-17 20:25:01 -04:00
parent ae07fcba0b
commit 42cedb77f0
5 changed files with 20 additions and 2 deletions

View File

@ -408,6 +408,10 @@ if(NOT NX)
function(glslang_set_link_args TARGET)
endfunction(glslang_set_link_args)
# Disable PCH for now
function(glslang_pch SRCS PCHCPP)
endfunction(glslang_pch)
set(ENABLE_SPVREMAPPER On)
add_definitions("-DENABLE_OPT=0")
add_subdirectory(glslang/glslang)

@ -1 +1 @@
Subproject commit c374030e80604ab5c2a516b3f9dd1e85b05898e4
Subproject commit 9f46e3dd5e11febbfbed971e74e10ed638e6578d

View File

@ -102,9 +102,11 @@ public:
m_3dCtx.m_ctx11.m_sampleCount = samples;
m_3dCtx.m_ctx11.m_anisotropy = anisotropy;
m_3dCtx.m_ctx11.m_fbFormat = deepColor ? DXGI_FORMAT_R16G16B16A16_FLOAT : DXGI_FORMAT_R8G8B8A8_UNORM;
#if BOO_HAS_GL
m_3dCtx.m_ctxOgl.m_glCtx.m_sampleCount = samples;
m_3dCtx.m_ctxOgl.m_glCtx.m_anisotropy = anisotropy;
m_3dCtx.m_ctxOgl.m_glCtx.m_deepColor = deepColor;
#endif
#if BOO_HAS_VULKAN
g_VulkanContext.m_sampleCountColor = samples;
g_VulkanContext.m_sampleCountDepth = samples;
@ -264,6 +266,7 @@ public:
}
#endif
#if BOO_HAS_GL
/* Finally try OpenGL */
{
/* Obtain DXGI Factory */
@ -274,6 +277,7 @@ public:
Log.report(logvisor::Info, FMT_STRING("initialized OpenGL renderer"));
return;
}
#endif
Log.report(logvisor::Fatal, FMT_STRING("system doesn't support Vulkan, D3D11, or OpenGL"));
}

View File

@ -45,8 +45,9 @@ struct OGLContext {
int m_fsCountDown = 0;
};
std::unordered_map<const boo::IWindow*, Window> m_windows;
#if BOO_HAS_GL
boo::GLContext m_glCtx;
#endif
};
#if !WINDOWS_STORE

View File

@ -7,8 +7,11 @@
#include "boo/IWindow.hpp"
#include "boo/audiodev/IAudioVoiceEngine.hpp"
#include "boo/graphicsdev/IGraphicsCommandQueue.hpp"
#include "boo/graphicsdev/D3D.hpp"
#if BOO_HAS_GL
#include "boo/graphicsdev/GL.hpp"
#endif
#include "boo/graphicsdev/glew.h"
#include "boo/graphicsdev/wglew.h"
@ -34,8 +37,10 @@ static logvisor::Module Log("boo::WindowWin32");
std::unique_ptr<IGraphicsCommandQueue> _NewD3D11CommandQueue(D3D11Context* ctx, D3D11Context::Window* windowCtx,
IGraphicsContext* parent);
std::unique_ptr<IGraphicsDataFactory> _NewD3D11DataFactory(D3D11Context* ctx, IGraphicsContext* parent);
#if BOO_HAS_GL
std::unique_ptr<IGraphicsCommandQueue> _NewGLCommandQueue(IGraphicsContext* parent, GLContext* glCtx);
std::unique_ptr<IGraphicsDataFactory> _NewGLDataFactory(IGraphicsContext* parent, GLContext* glCtx);
#endif
#if BOO_HAS_VULKAN
std::unique_ptr<IGraphicsCommandQueue> _NewVulkanCommandQueue(VulkanContext* ctx, VulkanContext::Window* windowCtx,
IGraphicsContext* parent);
@ -122,6 +127,7 @@ public:
IGraphicsDataFactory* getLoadContextDataFactory() override { return m_dataFactory.get(); }
};
#if BOO_HAS_GL
struct GraphicsContextWin32GL : GraphicsContextWin32 {
std::unique_ptr<IGraphicsDataFactory> m_dataFactory;
std::unique_ptr<IGraphicsCommandQueue> m_commandQueue;
@ -333,6 +339,7 @@ public:
return m_dataFactory.get();
}
};
#endif
#if BOO_HAS_VULKAN
struct GraphicsContextWin32Vulkan : GraphicsContextWin32 {
@ -871,11 +878,13 @@ public:
#endif
IGraphicsContext::EGraphicsAPI api = IGraphicsContext::EGraphicsAPI::D3D11;
#if BOO_HAS_GL
if (b3dCtx.m_ctxOgl.m_dxFactory) {
m_gfxCtx.reset(new GraphicsContextWin32GL(IGraphicsContext::EGraphicsAPI::OpenGL3_3, this, m_hwnd, b3dCtx));
m_openGL = true;
return;
}
#endif
m_gfxCtx.reset(new GraphicsContextWin32D3D(api, this, m_hwnd, b3dCtx));
}