Implement readonly storage buffer on Metal backend
BUG=dawn:180, dawn:284 Change-Id: I07358e5817faa85a0695a7c44db7b6472307d101 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14360 Commit-Queue: Yunchao He <yunchao.he@intel.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
5554283717
commit
ef8dee90a7
|
@ -453,7 +453,8 @@ namespace dawn_native { namespace metal {
|
|||
|
||||
switch (layout.types[bindingIndex]) {
|
||||
case wgpu::BindingType::UniformBuffer:
|
||||
case wgpu::BindingType::StorageBuffer: {
|
||||
case wgpu::BindingType::StorageBuffer:
|
||||
case wgpu::BindingType::ReadonlyStorageBuffer: {
|
||||
const BufferBinding& binding =
|
||||
group->GetBindingAsBufferBinding(bindingIndex);
|
||||
const id<MTLBuffer> buffer = ToBackend(binding.buffer)->GetMTLBuffer();
|
||||
|
@ -527,7 +528,6 @@ namespace dawn_native { namespace metal {
|
|||
} break;
|
||||
|
||||
case wgpu::BindingType::StorageTexture:
|
||||
case wgpu::BindingType::ReadonlyStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ namespace dawn_native { namespace metal {
|
|||
switch (groupInfo.types[binding]) {
|
||||
case wgpu::BindingType::UniformBuffer:
|
||||
case wgpu::BindingType::StorageBuffer:
|
||||
case wgpu::BindingType::ReadonlyStorageBuffer:
|
||||
mIndexInfo[stage][group][binding] = bufferIndex;
|
||||
bufferIndex++;
|
||||
break;
|
||||
|
@ -53,7 +54,6 @@ namespace dawn_native { namespace metal {
|
|||
textureIndex++;
|
||||
break;
|
||||
case wgpu::BindingType::StorageTexture:
|
||||
case wgpu::BindingType::ReadonlyStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -688,4 +688,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) {
|
|||
EXPECT_PIXEL_RGBA8_EQ(RGBA8::kYellow, renderPass.color, max, max);
|
||||
}
|
||||
|
||||
DAWN_INSTANTIATE_TEST(MultipleWriteThenMultipleReadTests, D3D12Backend, VulkanBackend);
|
||||
DAWN_INSTANTIATE_TEST(MultipleWriteThenMultipleReadTests,
|
||||
D3D12Backend,
|
||||
MetalBackend,
|
||||
VulkanBackend);
|
||||
|
|
Loading…
Reference in New Issue