mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 16:37:08 +00:00
Disallow storage buffer binding in vertex shader
Writable storage buffer in vertex shader is an optional feature. It is not supported in many devices/OSes. WebGPU doesn't support writable storage buffer in vertex shader. This change generates an error for storage buffer binding for vertex shader stage, in order to disallow writable storage buffer in vertex shader. This change also adds a validation test and revises existing end2end tests and validation tests accordingly. BUG=dawn:180 Change-Id: I9def918d19f65aab45a31acb985c1a0a09c97ca8 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14521 Commit-Queue: Yunchao He <yunchao.he@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
bfb2a5740f
commit
d28b578b6b
@@ -210,7 +210,7 @@ TEST_F(CommandBufferValidationTest, BufferWithReadAndWriteUsage) {
|
||||
|
||||
// Create the bind group to use the buffer as storage
|
||||
wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout(
|
||||
device, {{0, wgpu::ShaderStage::Vertex, wgpu::BindingType::StorageBuffer}});
|
||||
device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::StorageBuffer}});
|
||||
wgpu::BindGroup bg = utils::MakeBindGroup(device, bgl, {{0, buffer, 0, 4}});
|
||||
|
||||
// Use the buffer as both index and storage in the same pass
|
||||
@@ -258,8 +258,8 @@ TEST_F(CommandBufferValidationTest, BufferWithReadAndWriteStorageBufferUsage) {
|
||||
|
||||
// Create the bind group to use the buffer as storage
|
||||
wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout(
|
||||
device, {{0, wgpu::ShaderStage::Vertex, wgpu::BindingType::StorageBuffer},
|
||||
{1, wgpu::ShaderStage::Vertex, wgpu::BindingType::ReadonlyStorageBuffer}});
|
||||
device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::StorageBuffer},
|
||||
{1, wgpu::ShaderStage::Fragment, wgpu::BindingType::ReadonlyStorageBuffer}});
|
||||
wgpu::BindGroup bg =
|
||||
utils::MakeBindGroup(device, bgl, {{0, buffer, 0, 4}, {1, buffer, 256, 4}});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user