Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit 7f7c490

Browse files
committed
hard fix computer buffer issue (disable it by default and skip shader preparation when enablecomputebuffer = false)
1 parent cafba59 commit 7f7c490

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Runtime/ui/renderer/cmdbufferCanvas/rendering/canvas_shader.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ static Shader GetShader(string shaderName) {
169169
return shader;
170170
}
171171

172-
public static bool enableComputeBuffer = true;
173-
174-
public static bool supportComputeBuffer;
175-
176172
static CanvasShader() {
177173

178174
}

Runtime/ui/renderer/cmdbufferCanvas/rendering/canvas_shader_initializer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ static partial class CanvasShader {
1515
static int initialFrameCount;
1616
static Shader testShader;
1717
const string testShaderName = "UIWidgets/canvas_convexFill_cb";
18+
19+
20+
const bool enableComputeBuffer = false;
21+
22+
public static bool supportComputeBuffer;
1823

1924
static bool OnNotPrepared() {
2025
initStage = InitStage.Prepared;
@@ -24,7 +29,7 @@ static bool OnNotPrepared() {
2429
var material = new Material(testShader);
2530
//for Unity 2018 or below, shader is compiled after Shader.Find() call immediately,
2631
//therefore we can just skip the manually preload if the compilation fails
27-
if (!material.shader.isSupported) {
32+
if (!material.shader.isSupported || !enableComputeBuffer) {
2833
ObjectUtils.SafeDestroy(material);
2934
return OnPrepared(true);
3035
}

0 commit comments

Comments
 (0)