Only define SUPPORTS_RAYTRACING if it was detected

This commit is contained in:
Magnus Norddahl 2022-06-14 03:01:58 +02:00 committed by Christoph Oelckers
parent e0907f62d5
commit 5aa0fb536f

View file

@ -351,7 +351,8 @@ std::unique_ptr<VulkanShader> VkShaderManager::LoadVertShader(FString shadername
std::unique_ptr<VulkanShader> VkShaderManager::LoadFragShader(FString shadername, const char *frag_lump, const char *material_lump, const char *light_lump, const char *defines, bool alphatest, bool gbufferpass) std::unique_ptr<VulkanShader> VkShaderManager::LoadFragShader(FString shadername, const char *frag_lump, const char *material_lump, const char *light_lump, const char *defines, bool alphatest, bool gbufferpass)
{ {
FString code = GetTargetGlslVersion(); FString code = GetTargetGlslVersion();
code << "\n#define SUPPORTS_RAYTRACING\n"; if (fb->device->SupportsDeviceExtension(VK_KHR_RAY_QUERY_EXTENSION_NAME))
code << "\n#define SUPPORTS_RAYTRACING\n";
code << defines; code << defines;
code << "\n$placeholder$"; // here the code can later add more needed #defines. code << "\n$placeholder$"; // here the code can later add more needed #defines.
code << "\n#define MAX_STREAM_DATA " << std::to_string(MAX_STREAM_DATA).c_str() << "\n"; code << "\n#define MAX_STREAM_DATA " << std::to_string(MAX_STREAM_DATA).c_str() << "\n";