mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
fix compiling error with merged code (#10332)
* fix compiling error with merged code * code style
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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); \
|
||||
} \
|
||||
\
|
||||
|
||||
Reference in New Issue
Block a user