mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-05 06:03:34 +00:00
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]) {
|
switch (layout.types[bindingIndex]) {
|
||||||
case wgpu::BindingType::UniformBuffer:
|
case wgpu::BindingType::UniformBuffer:
|
||||||
case wgpu::BindingType::StorageBuffer: {
|
case wgpu::BindingType::StorageBuffer:
|
||||||
|
case wgpu::BindingType::ReadonlyStorageBuffer: {
|
||||||
const BufferBinding& binding =
|
const BufferBinding& binding =
|
||||||
group->GetBindingAsBufferBinding(bindingIndex);
|
group->GetBindingAsBufferBinding(bindingIndex);
|
||||||
const id<MTLBuffer> buffer = ToBackend(binding.buffer)->GetMTLBuffer();
|
const id<MTLBuffer> buffer = ToBackend(binding.buffer)->GetMTLBuffer();
|
||||||
@ -527,7 +528,6 @@ namespace dawn_native { namespace metal {
|
|||||||
} break;
|
} break;
|
||||||
|
|
||||||
case wgpu::BindingType::StorageTexture:
|
case wgpu::BindingType::StorageTexture:
|
||||||
case wgpu::BindingType::ReadonlyStorageBuffer:
|
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ namespace dawn_native { namespace metal {
|
|||||||
switch (groupInfo.types[binding]) {
|
switch (groupInfo.types[binding]) {
|
||||||
case wgpu::BindingType::UniformBuffer:
|
case wgpu::BindingType::UniformBuffer:
|
||||||
case wgpu::BindingType::StorageBuffer:
|
case wgpu::BindingType::StorageBuffer:
|
||||||
|
case wgpu::BindingType::ReadonlyStorageBuffer:
|
||||||
mIndexInfo[stage][group][binding] = bufferIndex;
|
mIndexInfo[stage][group][binding] = bufferIndex;
|
||||||
bufferIndex++;
|
bufferIndex++;
|
||||||
break;
|
break;
|
||||||
@ -53,7 +54,6 @@ namespace dawn_native { namespace metal {
|
|||||||
textureIndex++;
|
textureIndex++;
|
||||||
break;
|
break;
|
||||||
case wgpu::BindingType::StorageTexture:
|
case wgpu::BindingType::StorageTexture:
|
||||||
case wgpu::BindingType::ReadonlyStorageBuffer:
|
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -688,4 +688,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) {
|
|||||||
EXPECT_PIXEL_RGBA8_EQ(RGBA8::kYellow, renderPass.color, max, max);
|
EXPECT_PIXEL_RGBA8_EQ(RGBA8::kYellow, renderPass.color, max, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
DAWN_INSTANTIATE_TEST(MultipleWriteThenMultipleReadTests, D3D12Backend, VulkanBackend);
|
DAWN_INSTANTIATE_TEST(MultipleWriteThenMultipleReadTests,
|
||||||
|
D3D12Backend,
|
||||||
|
MetalBackend,
|
||||||
|
VulkanBackend);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user