diff options
author | egdaniel <egdaniel@google.com> | 2016-04-21 08:03:10 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-21 08:03:10 -0700 |
commit | 58a8d9214a70e0f6c81c88a8b0b563c06bf0f70e (patch) | |
tree | dbbf36d4bd35f3c57669aacdeffb84b13aee003a /src/gpu/vk/GrVkPipelineState.cpp | |
parent | 12d62a7d51a1826e221ffd34224d01c9bec49bab (diff) |
Update min Vulkan version to 1.0.8.0, and fix various bugs
With updating the SDK, the debug layers also showed multiple bugs.
I have fixed those as well in this CL. These include:
1. Incorrectly tracking the allocated descriptor sets from the descriptor pools
2. Using MemoryBarriers inside render passes.
3. Correctly setting the Stencil Image layout anytime we are using a render pass with a stencil attachment
4. Setting the correct aspect mask for Depth/Stencil in a barrier.
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1906623002
Review URL: https://codereview.chromium.org/1906623002
Diffstat (limited to 'src/gpu/vk/GrVkPipelineState.cpp')
-rw-r--r-- | src/gpu/vk/GrVkPipelineState.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp index e464848034..0194e290ad 100644 --- a/src/gpu/vk/GrVkPipelineState.cpp +++ b/src/gpu/vk/GrVkPipelineState.cpp @@ -408,30 +408,29 @@ void GrVkPipelineState::addUniformResources(GrVkCommandBuffer& commandBuffer) { void GrVkPipelineState::DescriptorPoolManager::getNewPool(GrVkGpu* gpu) { if (fPool) { fPool->unref(gpu); - SkASSERT(fMaxDescriptorSets < (SK_MaxU32 >> 1)); - if (fMaxDescriptorSets < kMaxDescSetLimit >> 1) { - fMaxDescriptorSets = fMaxDescriptorSets << 1; + if (fMaxDescriptors < kMaxDescLimit >> 1) { + fMaxDescriptors = fMaxDescriptors << 1; } else { - fMaxDescriptorSets = kMaxDescSetLimit; + fMaxDescriptors = kMaxDescLimit; } } - if (fMaxDescriptorSets) { + if (fMaxDescriptors) { fPool = gpu->resourceProvider().findOrCreateCompatibleDescriptorPool(fDescType, - fMaxDescriptorSets); + fMaxDescriptors); } - SkASSERT(fPool || !fMaxDescriptorSets); + SkASSERT(fPool || !fMaxDescriptors); } void GrVkPipelineState::DescriptorPoolManager::getNewDescriptorSet(GrVkGpu* gpu, VkDescriptorSet* ds) { - if (!fMaxDescriptorSets) { + if (!fMaxDescriptors) { return; } - if (fCurrentDescriptorSet == fMaxDescriptorSets) { + if (fCurrentDescriptorCount == fMaxDescriptors) { this->getNewPool(gpu); - fCurrentDescriptorSet = 0; + fCurrentDescriptorCount = 0; } - fCurrentDescriptorSet++; + fCurrentDescriptorCount += fDescCountPerSet; VkDescriptorSetAllocateInfo dsAllocateInfo; memset(&dsAllocateInfo, 0, sizeof(VkDescriptorSetAllocateInfo)); |