fix compiling error with merged code (#10332)

* fix compiling error with merged code

* code style
This commit is contained in:
jk20012001
2022-03-14 17:53:06 +08:00
committed by GitHub
parent 396dca5ce1
commit 48e45ce2d7
3 changed files with 13 additions and 10 deletions
+11 -1
View File
@@ -3,7 +3,17 @@
#pragma define-meta USE_INSTANCING editor(elevated: true)
#pragma define-meta USE_BATCHING editor(elevated: true)
#include <cc-local>
#if !USE_INSTANCING
#if USE_BATCHING
#pragma define BATCHING_COUNT 10
#pragma builtin(local)
layout(set = 2, binding = 0) uniform CCLocalBatched {
highp mat4 cc_matWorlds[BATCHING_COUNT];
};
#else
#include <cc-local>
#endif
#endif
void CCGetWorldMatrix(out mat4 matWorld)
{
-8
View File
@@ -1,13 +1,5 @@
// Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd.
#if USE_BATCHING
#pragma define BATCHING_COUNT 10
#pragma builtin(local)
layout(set = 2, binding = 0) uniform CCLocalBatched {
highp mat4 cc_matWorlds[BATCHING_COUNT];
};
#endif
#pragma builtin(local)
layout(set = 2, binding = 0) uniform CCLocal {
highp mat4 cc_matWorld;
@@ -43,6 +43,7 @@
layout(location = 0) out vec4 fragColor0; \
layout(location = 1) out vec4 fragColor1; \
layout(location = 2) out vec4 fragColor2; \
layout(location = 3) out vec4 fragColor3; \
\
void main () { \
StandardSurface s; surf(s); \
@@ -50,7 +51,7 @@
vec3 position; \
HIGHP_VALUE_FROM_STRUCT_DEFINED(position, s.position); \
fragColor1 = vec4(position, s.roughness); \
fragColor1 = vec4(float32x3_to_oct(s.normal), s.roughness, s.metallic); \
fragColor2 = vec4(float32x3_to_oct(s.normal), s.roughness, s.metallic); \
fragColor3 = vec4(s.emissive, s.occlusion); \
} \
\