TextureVk: Add a couple TODOs related to barriers.

Bug: None
Change-Id: I2da575ce7b79c92f5a2a320334e51e571f672b46
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28003
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2020-09-02 12:56:29 +00:00 committed by Commit Bot service account
parent 5ffc1e1adb
commit e9bc506e0a
1 changed files with 5 additions and 0 deletions

View File

@ -51,6 +51,8 @@ namespace dawn_native { namespace vulkan {
} }
// Computes which vulkan access type could be required for the given Dawn usage. // Computes which vulkan access type could be required for the given Dawn usage.
// TODO(cwallez@chromium.org): We shouldn't need any access usages for srcAccessMask when
// the previous usage is readonly because an execution dependency is sufficient.
VkAccessFlags VulkanAccessFlags(wgpu::TextureUsage usage, const Format& format) { VkAccessFlags VulkanAccessFlags(wgpu::TextureUsage usage, const Format& format) {
VkAccessFlags flags = 0; VkAccessFlags flags = 0;
@ -151,6 +153,9 @@ namespace dawn_native { namespace vulkan {
flags |= VK_PIPELINE_STAGE_TRANSFER_BIT; flags |= VK_PIPELINE_STAGE_TRANSFER_BIT;
} }
if (usage & (wgpu::TextureUsage::Sampled | kReadonlyStorageTexture)) { if (usage & (wgpu::TextureUsage::Sampled | kReadonlyStorageTexture)) {
// TODO(cwallez@chromium.org): Only transition to the usage we care about to avoid
// introducing FS -> VS dependencies that would prevent parallelization on tiler
// GPUs
flags |= VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | flags |= VK_PIPELINE_STAGE_VERTEX_SHADER_BIT |
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT |
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT; VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;