mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
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:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user