summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-07-26 03:28:26 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2021-11-16 22:11:28 +0100
commitbaf0993d5c019a1ef617a94fe17035f872ae6954 (patch)
tree4ebac5764e720a158c7651012fc6c0465a25dbd9 /src/video_core/renderer_vulkan
parentopengl: Use Shader::NumDescriptors when possible (diff)
downloadyuzu-baf0993d5c019a1ef617a94fe17035f872ae6954.tar
yuzu-baf0993d5c019a1ef617a94fe17035f872ae6954.tar.gz
yuzu-baf0993d5c019a1ef617a94fe17035f872ae6954.tar.bz2
yuzu-baf0993d5c019a1ef617a94fe17035f872ae6954.tar.lz
yuzu-baf0993d5c019a1ef617a94fe17035f872ae6954.tar.xz
yuzu-baf0993d5c019a1ef617a94fe17035f872ae6954.tar.zst
yuzu-baf0993d5c019a1ef617a94fe17035f872ae6954.zip
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
index 8634c3316..7e48d4458 100644
--- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
+++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
@@ -402,13 +402,9 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
add_buffer(desc);
}
}
- for (const auto& desc : info.texture_descriptors) {
- texture_buffer_index += desc.count;
- }
+ texture_buffer_index += Shader::NumDescriptors(info.texture_descriptors);
if constexpr (Spec::has_images) {
- for (const auto& desc : info.image_descriptors) {
- texture_buffer_index += desc.count;
- }
+ texture_buffer_index += Shader::NumDescriptors(info.image_descriptors);
}
}};
if constexpr (Spec::enabled_stages[0]) {
@@ -826,18 +822,10 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) {
void GraphicsPipeline::Validate() {
size_t num_images{};
for (const auto& info : stage_infos) {
- for (const auto& desc : info.texture_buffer_descriptors) {
- num_images += desc.count;
- }
- for (const auto& desc : info.image_buffer_descriptors) {
- num_images += desc.count;
- }
- for (const auto& desc : info.texture_descriptors) {
- num_images += desc.count;
- }
- for (const auto& desc : info.image_descriptors) {
- num_images += desc.count;
- }
+ num_images += Shader::NumDescriptors(info.texture_buffer_descriptors);
+ num_images += Shader::NumDescriptors(info.image_buffer_descriptors);
+ num_images += Shader::NumDescriptors(info.texture_descriptors);
+ num_images += Shader::NumDescriptors(info.image_descriptors);
}
ASSERT(num_images <= MAX_IMAGE_ELEMENTS);
}