From 2666b219fb70dfe0db44ff1b3c5253ac0c8cef22 Mon Sep 17 00:00:00 2001 From: Brandon Jones Date: Thu, 10 Oct 2024 13:39:06 -0700 Subject: [PATCH] Stop only clearing the first view in WebGPU samples. --- webgpu/ar-barebones.html | 8 ++++---- webgpu/vr-barebones.html | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/webgpu/ar-barebones.html b/webgpu/ar-barebones.html index b1cc6a4d..1a1fe80c 100644 --- a/webgpu/ar-barebones.html +++ b/webgpu/ar-barebones.html @@ -67,9 +67,9 @@ fn vertexMain(@builtin(vertex_index) vert_index: u32, @builtin(instance_index) view_index: u32) -> VertexOut { var pos = array( - vec4f(0.0, 0.5, -1, 1), - vec4f(-0.5, -0.5, -1, 1), - vec4f(0.5, -0.5, -1, 1) + vec4f(0.0, 0.25, -0.5, 1), + vec4f(-0.25, -0.25, -0.5, 1), + vec4f(0.25, -0.25, -0.5, 1) ); var color = array( @@ -361,7 +361,7 @@ colorAttachments: [{ view: subImage.colorTexture.createView(subImage.getViewDescriptor()), // Clear the color texture to a solid color. - loadOp: viewIndex == 0 ? 'clear' : 'load', + loadOp: 'clear', storeOp: 'store', // Clear the canvas to transparent black so the user's environment // shows through. diff --git a/webgpu/vr-barebones.html b/webgpu/vr-barebones.html index e310110a..2e3b8683 100644 --- a/webgpu/vr-barebones.html +++ b/webgpu/vr-barebones.html @@ -67,9 +67,9 @@ fn vertexMain(@builtin(vertex_index) vert_index: u32, @builtin(instance_index) view_index: u32) -> VertexOut { var pos = array( - vec4f(0.0, 0.5, -1, 1), - vec4f(-0.5, -0.5, -1, 1), - vec4f(0.5, -0.5, -1, 1) + vec4f(0.0, 0.25, -0.5, 1), + vec4f(-0.25, -0.25, -0.5, 1), + vec4f(0.25, -0.25, -0.5, 1) ); var color = array( @@ -361,7 +361,7 @@ colorAttachments: [{ view: subImage.colorTexture.createView(subImage.getViewDescriptor()), // Clear the color texture to a solid color. - loadOp: viewIndex == 0 ? 'clear' : 'load', + loadOp: 'clear', storeOp: 'store', // Clear to a non-black color so we can see if it's working // even when the triangle isn't in view.