mirror of
https://github.com/ZDoom/ZDRay.git
synced 2025-01-26 01:21:02 +00:00
Update shader builder to latest shader compiler version
This commit is contained in:
parent
0e7bb52c19
commit
edc4b159d0
3 changed files with 119 additions and 115 deletions
|
@ -94,6 +94,7 @@ static const TBuiltInResource DefaultTBuiltInResource = {
|
||||||
/* .maxTaskWorkGroupSizeY_NV = */ 1,
|
/* .maxTaskWorkGroupSizeY_NV = */ 1,
|
||||||
/* .maxTaskWorkGroupSizeZ_NV = */ 1,
|
/* .maxTaskWorkGroupSizeZ_NV = */ 1,
|
||||||
/* .maxMeshViewCountNV = */ 4,
|
/* .maxMeshViewCountNV = */ 4,
|
||||||
|
/* .maxDualSourceDrawBuffersEXT = */ 1,
|
||||||
|
|
||||||
/* .limits = */ {
|
/* .limits = */ {
|
||||||
/* .nonInductiveForLoops = */ 1,
|
/* .nonInductiveForLoops = */ 1,
|
||||||
|
@ -128,14 +129,14 @@ void ShaderBuilder::setTessEvaluationShader(const std::string &c) { code = c; st
|
||||||
void ShaderBuilder::setGeometryShader(const std::string &c) { code = c; stage = EShLanguage::EShLangGeometry; }
|
void ShaderBuilder::setGeometryShader(const std::string &c) { code = c; stage = EShLanguage::EShLangGeometry; }
|
||||||
void ShaderBuilder::setFragmentShader(const std::string &c) { code = c; stage = EShLanguage::EShLangFragment; }
|
void ShaderBuilder::setFragmentShader(const std::string &c) { code = c; stage = EShLanguage::EShLangFragment; }
|
||||||
void ShaderBuilder::setComputeShader(const std::string &c) { code = c; stage = EShLanguage::EShLangCompute; }
|
void ShaderBuilder::setComputeShader(const std::string &c) { code = c; stage = EShLanguage::EShLangCompute; }
|
||||||
void ShaderBuilder::setRayGenShader(const std::string &c) { code = c; stage = EShLanguage::EShLangRayGenNV; }
|
void ShaderBuilder::setRayGenShader(const std::string &c) { code = c; stage = EShLanguage::EShLangRayGen; }
|
||||||
void ShaderBuilder::setIntersectShader(const std::string &c) { code = c; stage = EShLanguage::EShLangIntersectNV; }
|
void ShaderBuilder::setIntersectShader(const std::string &c) { code = c; stage = EShLanguage::EShLangIntersect; }
|
||||||
void ShaderBuilder::setAnyHitShader(const std::string &c) { code = c; stage = EShLanguage::EShLangAnyHitNV; }
|
void ShaderBuilder::setAnyHitShader(const std::string &c) { code = c; stage = EShLanguage::EShLangAnyHit; }
|
||||||
void ShaderBuilder::setClosestHitShader(const std::string &c) { code = c; stage = EShLanguage::EShLangClosestHitNV; }
|
void ShaderBuilder::setClosestHitShader(const std::string &c) { code = c; stage = EShLanguage::EShLangClosestHit; }
|
||||||
void ShaderBuilder::setMissShader(const std::string &c) { code = c; stage = EShLanguage::EShLangMissNV; }
|
void ShaderBuilder::setMissShader(const std::string &c) { code = c; stage = EShLanguage::EShLangMiss; }
|
||||||
void ShaderBuilder::setCallableShader(const std::string &c) { code = c; stage = EShLanguage::EShLangCallableNV; }
|
void ShaderBuilder::setCallableShader(const std::string &c) { code = c; stage = EShLanguage::EShLangCallable; }
|
||||||
void ShaderBuilder::setTaskShader(const std::string &c) { code = c; stage = EShLanguage::EShLangTaskNV; }
|
//void ShaderBuilder::setTaskShader(const std::string &c) { code = c; stage = EShLanguage::EShLangTaskNV; }
|
||||||
void ShaderBuilder::setMeshShader(const std::string &c) { code = c; stage = EShLanguage::EShLangMeshNV; }
|
//void ShaderBuilder::setMeshShader(const std::string &c) { code = c; stage = EShLanguage::EShLangMeshNV; }
|
||||||
|
|
||||||
std::unique_ptr<VulkanShader> ShaderBuilder::create(VulkanDevice *device)
|
std::unique_ptr<VulkanShader> ShaderBuilder::create(VulkanDevice *device)
|
||||||
{
|
{
|
||||||
|
@ -147,8 +148,8 @@ std::unique_ptr<VulkanShader> ShaderBuilder::create(VulkanDevice *device)
|
||||||
glslang::TShader shader(stage);
|
glslang::TShader shader(stage);
|
||||||
shader.setStrings(sources, 1);
|
shader.setStrings(sources, 1);
|
||||||
shader.setEnvInput(glslang::EShSourceGlsl, stage, glslang::EShClientVulkan, 100);
|
shader.setEnvInput(glslang::EShSourceGlsl, stage, glslang::EShClientVulkan, 100);
|
||||||
shader.setEnvClient(glslang::EShClientVulkan, glslang::EShTargetVulkan_1_0);
|
shader.setEnvClient(glslang::EShClientVulkan, glslang::EShTargetVulkan_1_2);
|
||||||
shader.setEnvTarget(glslang::EShTargetSpv, glslang::EShTargetSpv_1_0);
|
shader.setEnvTarget(glslang::EShTargetSpv, glslang::EShTargetSpv_1_5);
|
||||||
bool compileSuccess = shader.parse(&resources, 110, false, EShMsgVulkanRules);
|
bool compileSuccess = shader.parse(&resources, 110, false, EShMsgVulkanRules);
|
||||||
if (!compileSuccess)
|
if (!compileSuccess)
|
||||||
{
|
{
|
||||||
|
|
|
@ -121,8 +121,8 @@ public:
|
||||||
void setClosestHitShader(const std::string &code);
|
void setClosestHitShader(const std::string &code);
|
||||||
void setMissShader(const std::string &code);
|
void setMissShader(const std::string &code);
|
||||||
void setCallableShader(const std::string &code);
|
void setCallableShader(const std::string &code);
|
||||||
void setTaskShader(const std::string &code);
|
//void setTaskShader(const std::string &code);
|
||||||
void setMeshShader(const std::string &code);
|
//void setMeshShader(const std::string &code);
|
||||||
|
|
||||||
std::unique_ptr<VulkanShader> create(VulkanDevice *device);
|
std::unique_ptr<VulkanShader> create(VulkanDevice *device);
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
#include "VulkanDevice.h"
|
#include "VulkanDevice.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
class VulkanCommandPool;
|
class VulkanCommandPool;
|
||||||
class VulkanDescriptorPool;
|
class VulkanDescriptorPool;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue