Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.8.2 gfx #16664

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions native/cocos/renderer/gfx-base/SPIRVUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
#include "glslang/StandAlone/ResourceLimits.h"
#include "spirv/spirv.h"

#define CC_GLSLANG_VERSION_GREATOR_OR_EQUAL_TO(major, minor, patch) \
(((major) < GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
(((minor) < GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
((patch) <= GLSLANG_VERSION_PATCH)))))

namespace cc {
namespace gfx {

Expand All @@ -57,10 +62,7 @@ glslang::EShTargetClientVersion getClientVersion(int vulkanMinorVersion) {
case 0: return glslang::EShTargetVulkan_1_0;
case 1: return glslang::EShTargetVulkan_1_1;
case 2: return glslang::EShTargetVulkan_1_2;
#if GLSLANG_VERSION_LESS_OR_EQUAL_TO(11, 10, 0)
// This macro is defined in glslang/build_info.h. This expression means that the
// lib version is greater than or equal to 11.10.0 (not less than or equal to),
// which is very counterintuitive. But it's the only way to do it.
#if CC_GLSLANG_VERSION_GREATOR_OR_EQUAL_TO(11, 10, 0)
case 3: return glslang::EShTargetVulkan_1_3;
#else
case 3: return glslang::EShTargetVulkan_1_2;
Expand All @@ -77,10 +79,7 @@ glslang::EShTargetLanguageVersion getTargetVersion(int vulkanMinorVersion) {
case 0: return glslang::EShTargetSpv_1_0;
case 1: return glslang::EShTargetSpv_1_3;
case 2: return glslang::EShTargetSpv_1_5;
#if GLSLANG_VERSION_LESS_OR_EQUAL_TO(11, 10, 0)
// This macro is defined in glslang/build_info.h. This expression means that the
// lib version is greater than or equal to 11.10.0 (not less than or equal to),
// which is very counterintuitive. But it's the only way to do it.
#if CC_GLSLANG_VERSION_GREATOR_OR_EQUAL_TO(11, 10, 0)
case 3: return glslang::EShTargetSpv_1_6;
#else
case 3: return glslang::EShTargetSpv_1_5;
Expand Down
Loading