This repository was archived by the owner on Apr 29, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Runtime/ui/renderer/cmdbufferCanvas/rendering Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,18 @@ static partial class CanvasShader {
19
19
20
20
const bool enableComputeBuffer = true ;
21
21
22
+ const bool enableDebugLog = true ;
23
+
22
24
public static bool supportComputeBuffer ;
23
25
26
+ static void DebugAssert ( bool condition , string logMsg ) {
27
+ if ( enableDebugLog && ! condition ) {
28
+ Debug . Log ( logMsg ) ;
29
+ }
30
+ }
31
+
24
32
static void DoPrepareDefaultShader ( ) {
25
- Debug . Log ( $ "do prepare default shader @frame = { Time . frameCount } ") ;
33
+ DebugAssert ( false , $ "do prepare default shader @frame = { Time . frameCount } ") ;
26
34
supportComputeBuffer = false ;
27
35
28
36
var convexFillShader = GetShader ( "UIWidgets/canvas_convexFill" ) ;
@@ -109,8 +117,8 @@ static void DoPrepareComputeBufferShader() {
109
117
var isShaderSupported = testShader . isSupported ;
110
118
testShader = null ;
111
119
supportComputeBuffer = enableComputeBuffer && SystemInfo . supportsComputeShaders && isShaderSupported ;
112
-
113
- Debug . Log ( $ "do prepare computebuffer shader @frame = { Time . frameCount } with support state = { supportComputeBuffer } ") ;
120
+
121
+ DebugAssert ( false , $ "do prepare computebuffer shader @frame = { Time . frameCount } with support state = { supportComputeBuffer } ") ;
114
122
115
123
if ( ! supportComputeBuffer ) {
116
124
return ;
You can’t perform that action at this time.
0 commit comments