Skip to content

Commit

Permalink
Remove "unreachable code" warnings (#15694)
Browse files Browse the repository at this point in the history
  • Loading branch information
Popov72 authored Oct 11, 2024
1 parent 56dbb14 commit 9a55a49
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ export class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor {

vertexCode =
(needDiagnosticOff ? "diagnostic(off, derivative_uniformity);\n" : "") +
"diagnostic(off, chromium.unreachable_code);\n" +
InjectStartingAndEndingCode(vertexCode, "fn main", vertexMainStartingCode, vertexMainEndingCode);

// fragment code
Expand Down Expand Up @@ -423,7 +424,9 @@ export class WebGPUShaderProcessorWGSL extends WebGPUShaderProcessor {
needDiagnosticOff = fragmentCode.indexOf(Constants.DISABLEUA) !== -1;

fragmentCode =
(needDiagnosticOff ? "diagnostic(off, derivative_uniformity);\n" : "") + InjectStartingAndEndingCode(fragmentCode, "fn main", fragmentStartingCode, fragmentEndingCode);
(needDiagnosticOff ? "diagnostic(off, derivative_uniformity);\n" : "") +
"diagnostic(off, chromium.unreachable_code);\n" +
InjectStartingAndEndingCode(fragmentCode, "fn main", fragmentStartingCode, fragmentEndingCode);

this._collectBindingNames();
this._preCreateBindGroupEntries();
Expand Down

0 comments on commit 9a55a49

Please sign in to comment.