- hook up the glsl compiler

This commit is contained in:
Magnus Norddahl 2019-02-21 00:25:51 +01:00
commit 75403ec744
4 changed files with 224 additions and 0 deletions

View file

@ -33,6 +33,10 @@
#include "vk_framebuffer.h"
#include "vulkan/textures/vk_samplers.h"
#include "vulkan/system/vk_builders.h"
#include "doomerrors.h"
#include <ShaderLang.h>
EXTERN_CVAR(Bool, vid_vsync)
EXTERN_CVAR(Bool, r_drawvoxels)
@ -41,8 +45,28 @@ EXTERN_CVAR(Int, gl_tonemap)
VulkanFrameBuffer::VulkanFrameBuffer(void *hMonitor, bool fullscreen, VulkanDevice *dev) :
Super(hMonitor, fullscreen)
{
ShInitialize();
//screen = this; // temporary hack to make the tutorial code work.
#if 0
{
const char *lumpName = "shaders/glsl/screenquad.vp";
int lump = Wads.CheckNumForFullName(lumpName, 0);
if (lump == -1) I_FatalError("Unable to load '%s'", lumpName);
FString code = Wads.ReadLump(lump).GetString().GetChars();
FString patchedCode;
patchedCode.AppendFormat("#version %d\n", 450);
patchedCode << "#line 1\n";
patchedCode << code;
ShaderBuilder builder;
builder.setVertexShader(patchedCode);
auto shader = builder.create(dev);
}
#endif
device = dev;
mSamplerManager = new VkSamplerManager(device);
SetViewportRects(nullptr);
@ -51,6 +75,7 @@ VulkanFrameBuffer::VulkanFrameBuffer(void *hMonitor, bool fullscreen, VulkanDevi
VulkanFrameBuffer::~VulkanFrameBuffer()
{
delete mSamplerManager;
ShFinalize();
}
void VulkanFrameBuffer::InitializeState()