File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ export declare namespace Env {
3636 /**
3737 * set or get a boolean value indicating whether to enable trace.
3838 *
39+ * @deprecated Use `env.trace` instead. If `env.trace` is set, this property will be ignored.
3940 * @defaultValue `false`
4041 */
4142 trace ?: boolean ;
@@ -167,13 +168,21 @@ export interface Env {
167168 * @defaultValue `'warning'`
168169 */
169170 logLevel ?: 'verbose' | 'info' | 'warning' | 'error' | 'fatal' ;
171+
170172 /**
171173 * Indicate whether run in debug mode.
172174 *
173175 * @defaultValue `false`
174176 */
175177 debug ?: boolean ;
176178
179+ /**
180+ * set or get a boolean value indicating whether to enable trace.
181+ *
182+ * @defaultValue `false`
183+ */
184+ trace ?: boolean ;
185+
177186 /**
178187 * Get version of the current package.
179188 */
Original file line number Diff line number Diff line change 44import { env } from './env-impl.js' ;
55
66export const TRACE = ( deviceType : string , label : string ) => {
7- if ( ! env . wasm . trace ) {
7+ if ( typeof env . trace === 'undefined' ? ! env . wasm . trace : ! env . trace ) {
88 return ;
99 }
1010 // eslint-disable-next-line no-console
@@ -30,14 +30,14 @@ const TRACE_FUNC = (msg: string, extraMsg?: string) => {
3030} ;
3131
3232export const TRACE_FUNC_BEGIN = ( extraMsg ?: string ) => {
33- if ( ! env . wasm . trace ) {
33+ if ( typeof env . trace === 'undefined' ? ! env . wasm . trace : ! env . trace ) {
3434 return ;
3535 }
3636 TRACE_FUNC ( 'BEGIN' , extraMsg ) ;
3737} ;
3838
3939export const TRACE_FUNC_END = ( extraMsg ?: string ) => {
40- if ( ! env . wasm . trace ) {
40+ if ( typeof env . trace === 'undefined' ? ! env . wasm . trace : ! env . trace ) {
4141 return ;
4242 }
4343 TRACE_FUNC ( 'END' , extraMsg ) ;
Original file line number Diff line number Diff line change @@ -710,7 +710,8 @@ export class WebGpuBackend {
710710 }
711711 setQueryType ( ) : void {
712712 this . queryType = 'none' ;
713- if ( this . env . webgpu . profiling ?. mode === 'default' || this . env . wasm . trace ) {
713+ if ( this . env . webgpu . profiling ?. mode === 'default' ||
714+ ( typeof this . env . trace === 'undefined' ? this . env . wasm . trace : this . env . trace ) ) {
714715 if ( this . device . features . has ( 'chromium-experimental-timestamp-query-inside-passes' ) ) {
715716 this . queryType = 'inside-passes' ;
716717 } else if ( this . device . features . has ( 'timestamp-query' ) ) {
You can’t perform that action at this time.
0 commit comments