diff options
| author | 2021-07-25 22:28:26 -0300 | |
|---|---|---|
| committer | 2021-11-16 22:11:28 +0100 | |
| commit | baf0993d5c019a1ef617a94fe17035f872ae6954 (patch) | |
| tree | 4ebac5764e720a158c7651012fc6c0465a25dbd9 /src | |
| parent | opengl: Use Shader::NumDescriptors when possible (diff) | |
| download | yuzu-baf0993d5c019a1ef617a94fe17035f872ae6954.tar.gz yuzu-baf0993d5c019a1ef617a94fe17035f872ae6954.tar.xz yuzu-baf0993d5c019a1ef617a94fe17035f872ae6954.zip | |
vk_graphics_pipeline: Use Shader::NumDescriptors when possible
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 24 |
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) { | |||
| 402 | add_buffer(desc); | 402 | add_buffer(desc); |
| 403 | } | 403 | } |
| 404 | } | 404 | } |
| 405 | for (const auto& desc : info.texture_descriptors) { | 405 | texture_buffer_index += Shader::NumDescriptors(info.texture_descriptors); |
| 406 | texture_buffer_index += desc.count; | ||
| 407 | } | ||
| 408 | if constexpr (Spec::has_images) { | 406 | if constexpr (Spec::has_images) { |
| 409 | for (const auto& desc : info.image_descriptors) { | 407 | texture_buffer_index += Shader::NumDescriptors(info.image_descriptors); |
| 410 | texture_buffer_index += desc.count; | ||
| 411 | } | ||
| 412 | } | 408 | } |
| 413 | }}; | 409 | }}; |
| 414 | if constexpr (Spec::enabled_stages[0]) { | 410 | if constexpr (Spec::enabled_stages[0]) { |
| @@ -826,18 +822,10 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { | |||
| 826 | void GraphicsPipeline::Validate() { | 822 | void GraphicsPipeline::Validate() { |
| 827 | size_t num_images{}; | 823 | size_t num_images{}; |
| 828 | for (const auto& info : stage_infos) { | 824 | for (const auto& info : stage_infos) { |
| 829 | for (const auto& desc : info.texture_buffer_descriptors) { | 825 | num_images += Shader::NumDescriptors(info.texture_buffer_descriptors); |
| 830 | num_images += desc.count; | 826 | num_images += Shader::NumDescriptors(info.image_buffer_descriptors); |
| 831 | } | 827 | num_images += Shader::NumDescriptors(info.texture_descriptors); |
| 832 | for (const auto& desc : info.image_buffer_descriptors) { | 828 | num_images += Shader::NumDescriptors(info.image_descriptors); |
| 833 | num_images += desc.count; | ||
| 834 | } | ||
| 835 | for (const auto& desc : info.texture_descriptors) { | ||
| 836 | num_images += desc.count; | ||
| 837 | } | ||
| 838 | for (const auto& desc : info.image_descriptors) { | ||
| 839 | num_images += desc.count; | ||
| 840 | } | ||
| 841 | } | 829 | } |
| 842 | ASSERT(num_images <= MAX_IMAGE_ELEMENTS); | 830 | ASSERT(num_images <= MAX_IMAGE_ELEMENTS); |
| 843 | } | 831 | } |