Renaming msdfSampler to linearSampler; adding loadShaderModule utility method; busting the rain render out of its render bundle (which won't be useful long-term).

This commit is contained in:
Rezmason
2021-11-03 20:01:59 -07:00
parent 8f09fade43
commit f8959cd7d9
4 changed files with 20 additions and 22 deletions

View File

@@ -27,6 +27,12 @@ const loadTexture = async (device, url) => {
return texture;
};
const loadShaderModule = async (device, url) => {
const response = await fetch(url);
const code = await response.text();
return device.createShaderModule({ code });
};
const makeUniformBuffer = (device, structLayout, values = null) => {
const buffer = device.createBuffer({
size: structLayout.size,
@@ -40,4 +46,4 @@ const makeUniformBuffer = (device, structLayout, values = null) => {
return buffer;
};
export { getCanvasSize, loadTexture, makeUniformBuffer };
export { getCanvasSize, loadTexture, loadShaderModule, makeUniformBuffer };