Refactor and improve brush
This commit is contained in:
parent
9e582110ea
commit
d8a3ae7528
19 changed files with 367 additions and 92 deletions
15
src/utils/smart-compile.ts
Normal file
15
src/utils/smart-compile.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
export const smartCompile = (device: GPUDevice, code: string) => {
|
||||
const module = device.createShaderModule({
|
||||
code,
|
||||
});
|
||||
|
||||
module
|
||||
.getCompilationInfo()
|
||||
.then((info) =>
|
||||
info.messages.forEach((message) =>
|
||||
console.warn(message.type, message.message, code.split('\n')[message.lineNum - 1])
|
||||
)
|
||||
);
|
||||
|
||||
return module;
|
||||
};
|
||||
Loading…
Reference in a new issue