Vulkan: Fix buffer barriers for readonly storage.
Some of the helper methods to compute buffer barriers didn't handle the kReadOnlyStorage usage, which made barriers issued too small. Issue was caught by running the GpuMemorySynchronizationTests with the Vulkan barrier validation enabled. Bug: dawn:635 Change-Id: Ice76edd21b2fa1c25cf9922418f65cfa7d802bdb Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38100 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Stephen White <senorblanco@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Auto-Submit: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
f83df90fae
commit
40422659d4
|
@ -45,7 +45,7 @@ namespace dawn_native { namespace vulkan {
|
||||||
if (usage & wgpu::BufferUsage::Uniform) {
|
if (usage & wgpu::BufferUsage::Uniform) {
|
||||||
flags |= VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
|
flags |= VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
|
||||||
}
|
}
|
||||||
if (usage & wgpu::BufferUsage::Storage) {
|
if (usage & (wgpu::BufferUsage::Storage | kReadOnlyStorageBuffer)) {
|
||||||
flags |= VK_BUFFER_USAGE_STORAGE_BUFFER_BIT;
|
flags |= VK_BUFFER_USAGE_STORAGE_BUFFER_BIT;
|
||||||
}
|
}
|
||||||
if (usage & wgpu::BufferUsage::Indirect) {
|
if (usage & wgpu::BufferUsage::Indirect) {
|
||||||
|
@ -116,6 +116,9 @@ namespace dawn_native { namespace vulkan {
|
||||||
if (usage & wgpu::BufferUsage::Storage) {
|
if (usage & wgpu::BufferUsage::Storage) {
|
||||||
flags |= VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT;
|
flags |= VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT;
|
||||||
}
|
}
|
||||||
|
if (usage & kReadOnlyStorageBuffer) {
|
||||||
|
flags |= VK_ACCESS_SHADER_READ_BIT;
|
||||||
|
}
|
||||||
if (usage & wgpu::BufferUsage::Indirect) {
|
if (usage & wgpu::BufferUsage::Indirect) {
|
||||||
flags |= VK_ACCESS_INDIRECT_COMMAND_READ_BIT;
|
flags |= VK_ACCESS_INDIRECT_COMMAND_READ_BIT;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue