aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkPipelineState.cpp
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2016-04-26 08:15:09 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-26 08:15:09 -0700
commitb1b59576baf8abe457be159b13438b8668f8eeac (patch)
tree6fe58fb507b87d64593663f94e3d16ef7a6fac7e /src/gpu/vk/GrVkPipelineState.cpp
parent62340067270c5c3365afa6b40b8e995ae6a6c1ec (diff)
Remove unnessary uniform barriers in Vulkan.
Diffstat (limited to 'src/gpu/vk/GrVkPipelineState.cpp')
-rw-r--r--src/gpu/vk/GrVkPipelineState.cpp20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp
index 4fe292917a..2821483ca6 100644
--- a/src/gpu/vk/GrVkPipelineState.cpp
+++ b/src/gpu/vk/GrVkPipelineState.cpp
@@ -238,13 +238,6 @@ void GrVkPipelineState::writeUniformBuffers(const GrVkGpu* gpu) {
descriptorWrites[0].pImageInfo = nullptr;
descriptorWrites[0].pBufferInfo = &vertBufferInfo;
descriptorWrites[0].pTexelBufferView = nullptr;
-
- fVertexUniformBuffer->addMemoryBarrier(gpu,
- VK_ACCESS_HOST_WRITE_BIT,
- VK_ACCESS_UNIFORM_READ_BIT,
- VK_PIPELINE_STAGE_HOST_BIT,
- VK_PIPELINE_STAGE_VERTEX_SHADER_BIT,
- false);
}
VkDescriptorBufferInfo fragBufferInfo;
@@ -269,13 +262,6 @@ void GrVkPipelineState::writeUniformBuffers(const GrVkGpu* gpu) {
descriptorWrites[1].pImageInfo = nullptr;
descriptorWrites[1].pBufferInfo = &fragBufferInfo;
descriptorWrites[1].pTexelBufferView = nullptr;
-
- fFragmentUniformBuffer->addMemoryBarrier(gpu,
- VK_ACCESS_HOST_WRITE_BIT,
- VK_ACCESS_UNIFORM_READ_BIT,
- VK_PIPELINE_STAGE_HOST_BIT,
- VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
- false);
}
if (uniformBindingUpdateCount) {
@@ -436,11 +422,11 @@ void GrVkPipelineState::DescriptorPoolManager::getNewDescriptorSet(GrVkGpu* gpu,
if (!fMaxDescriptors) {
return;
}
- if (fCurrentDescriptorCount == fMaxDescriptors) {
+ fCurrentDescriptorCount += fDescCountPerSet;
+ if (fCurrentDescriptorCount > fMaxDescriptors) {
this->getNewPool(gpu);
- fCurrentDescriptorCount = 0;
+ fCurrentDescriptorCount = fDescCountPerSet;
}
- fCurrentDescriptorCount += fDescCountPerSet;
VkDescriptorSetAllocateInfo dsAllocateInfo;
memset(&dsAllocateInfo, 0, sizeof(VkDescriptorSetAllocateInfo));