diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-12-26 03:34:38 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-12-26 03:34:38 +0100 |
commit | 661483f313a7dbbbebd4f233acecb06b6505a636 (patch) | |
tree | 4d549417a89e271cd1d66295c1993ed7704e6d2e /src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | |
parent | Merge pull request #5226 from ReinUsesLisp/c4715-vc (diff) | |
download | yuzu-661483f313a7dbbbebd4f233acecb06b6505a636.tar yuzu-661483f313a7dbbbebd4f233acecb06b6505a636.tar.gz yuzu-661483f313a7dbbbebd4f233acecb06b6505a636.tar.bz2 yuzu-661483f313a7dbbbebd4f233acecb06b6505a636.tar.lz yuzu-661483f313a7dbbbebd4f233acecb06b6505a636.tar.xz yuzu-661483f313a7dbbbebd4f233acecb06b6505a636.tar.zst yuzu-661483f313a7dbbbebd4f233acecb06b6505a636.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp index 5ec43db11..08662f4a8 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp @@ -75,7 +75,7 @@ void FixedPipelineState::Fill(const Maxwell& regs, bool has_extended_dynamic_sta regs.instanced_arrays.IsInstancingEnabled(index) ? regs.vertex_array[index].divisor : 0; } - for (std::size_t index = 0; index < Maxwell::NumVertexAttributes; ++index) { + for (size_t index = 0; index < Maxwell::NumVertexAttributes; ++index) { const auto& input = regs.vertex_attrib_format[index]; auto& attribute = attributes[index]; attribute.raw = 0; @@ -84,6 +84,7 @@ void FixedPipelineState::Fill(const Maxwell& regs, bool has_extended_dynamic_sta attribute.offset.Assign(input.offset); attribute.type.Assign(static_cast<u32>(input.type.Value())); attribute.size.Assign(static_cast<u32>(input.size.Value())); + attribute.binding_index_enabled.Assign(regs.vertex_array[index].IsEnabled() ? 1 : 0); } for (std::size_t index = 0; index < std::size(attachments); ++index) { @@ -171,14 +172,9 @@ void FixedPipelineState::DynamicState::Fill(const Maxwell& regs) { depth_test_func.Assign(PackComparisonOp(regs.depth_test_func)); cull_face.Assign(PackCullFace(regs.cull_face)); cull_enable.Assign(regs.cull_test_enabled != 0 ? 1 : 0); - - for (std::size_t index = 0; index < Maxwell::NumVertexArrays; ++index) { - const auto& input = regs.vertex_array[index]; - VertexBinding& binding = vertex_bindings[index]; - binding.raw = 0; - binding.enabled.Assign(input.IsEnabled() ? 1 : 0); - binding.stride.Assign(static_cast<u16>(input.stride.Value())); - } + std::ranges::transform(regs.vertex_array, vertex_strides.begin(), [](const auto& array) { + return static_cast<u16>(array.stride.Value()); + }); } std::size_t FixedPipelineState::Hash() const noexcept { |