mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-14 00:56:05 +00:00
Implement readonly storage buffer on OpenGL backend
Note that storage buffer and readonly storage buffer may not be supported in vertex shader on OpenGL backend. In OpenGL Spec 4.6, the minimum value of MAX_VERTEX_SHADER_STORAGE_BLOCKS is 0. BUG=dawn:180, dawn:284 Change-Id: Ib637a61e4eee0a0996c0da33f492e075fd94e1e7 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14380 Commit-Queue: Yunchao He <yunchao.he@intel.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
ef8dee90a7
commit
56b12422da
@ -288,7 +288,8 @@ namespace dawn_native { namespace opengl {
|
||||
}
|
||||
} break;
|
||||
|
||||
case wgpu::BindingType::StorageBuffer: {
|
||||
case wgpu::BindingType::StorageBuffer:
|
||||
case wgpu::BindingType::ReadonlyStorageBuffer: {
|
||||
BufferBinding binding = group->GetBindingAsBufferBinding(bindingIndex);
|
||||
GLuint buffer = ToBackend(binding.buffer)->GetHandle();
|
||||
GLuint ssboIndex = indices[bindingIndex];
|
||||
@ -304,7 +305,6 @@ namespace dawn_native { namespace opengl {
|
||||
} break;
|
||||
|
||||
case wgpu::BindingType::StorageTexture:
|
||||
case wgpu::BindingType::ReadonlyStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
|
||||
|
@ -123,7 +123,8 @@ namespace dawn_native { namespace opengl {
|
||||
}
|
||||
} break;
|
||||
|
||||
case wgpu::BindingType::StorageBuffer: {
|
||||
case wgpu::BindingType::StorageBuffer:
|
||||
case wgpu::BindingType::ReadonlyStorageBuffer: {
|
||||
GLuint location = gl.GetProgramResourceIndex(
|
||||
mProgram, GL_SHADER_STORAGE_BLOCK, name.c_str());
|
||||
if (location != GL_INVALID_INDEX) {
|
||||
@ -139,7 +140,6 @@ namespace dawn_native { namespace opengl {
|
||||
break;
|
||||
|
||||
case wgpu::BindingType::StorageTexture:
|
||||
case wgpu::BindingType::ReadonlyStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
|
||||
|
@ -50,12 +50,12 @@ namespace dawn_native { namespace opengl {
|
||||
break;
|
||||
|
||||
case wgpu::BindingType::StorageBuffer:
|
||||
case wgpu::BindingType::ReadonlyStorageBuffer:
|
||||
mIndexInfo[group][binding] = ssboIndex;
|
||||
ssboIndex++;
|
||||
break;
|
||||
|
||||
case wgpu::BindingType::StorageTexture:
|
||||
case wgpu::BindingType::ReadonlyStorageBuffer:
|
||||
UNREACHABLE();
|
||||
break;
|
||||
|
||||
|
@ -691,4 +691,5 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) {
|
||||
DAWN_INSTANTIATE_TEST(MultipleWriteThenMultipleReadTests,
|
||||
D3D12Backend,
|
||||
MetalBackend,
|
||||
OpenGLBackend,
|
||||
VulkanBackend);
|
||||
|
Loading…
x
Reference in New Issue
Block a user