diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-06-23 00:07:04 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-06-27 01:57:22 +0200 |
commit | 8584a77eb2e51e702d4c941e0fca07aafc47f29b (patch) | |
tree | 0a6929b316f2d92dc04b898053a3da09401844c9 /src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | |
parent | vulkan/fixed_pipeline_state: Move state out of individual structures (diff) | |
download | yuzu-8584a77eb2e51e702d4c941e0fca07aafc47f29b.tar yuzu-8584a77eb2e51e702d4c941e0fca07aafc47f29b.tar.gz yuzu-8584a77eb2e51e702d4c941e0fca07aafc47f29b.tar.bz2 yuzu-8584a77eb2e51e702d4c941e0fca07aafc47f29b.tar.lz yuzu-8584a77eb2e51e702d4c941e0fca07aafc47f29b.tar.xz yuzu-8584a77eb2e51e702d4c941e0fca07aafc47f29b.tar.zst yuzu-8584a77eb2e51e702d4c941e0fca07aafc47f29b.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/fixed_pipeline_state.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp index 07358b0f9..d1f0ea932 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp @@ -39,7 +39,7 @@ constexpr std::array POLYGON_OFFSET_ENABLE_LUT = { } // Anonymous namespace -void FixedPipelineState::Fill(const Maxwell& regs) { +void FixedPipelineState::Fill(const Maxwell& regs, bool has_extended_dynamic_state) { const auto& clip = regs.view_volume_clip_control; const std::array enabled_lut = {regs.polygon_offset_point_enable, regs.polygon_offset_line_enable, @@ -86,7 +86,10 @@ void FixedPipelineState::Fill(const Maxwell& regs) { std::transform(transform.begin(), transform.end(), viewport_swizzles.begin(), [](const auto& viewport) { return static_cast<u16>(viewport.swizzle.raw); }); - dynamic_state.Fill(regs); + if (!has_extended_dynamic_state) { + no_extended_dynamic_state.Assign(1); + dynamic_state.Fill(regs); + } } void FixedPipelineState::BlendingAttachment::Fill(const Maxwell& regs, std::size_t index) { @@ -173,12 +176,12 @@ void FixedPipelineState::DynamicState::Fill(const Maxwell& regs) { } std::size_t FixedPipelineState::Hash() const noexcept { - const u64 hash = Common::CityHash64(reinterpret_cast<const char*>(this), sizeof *this); + const u64 hash = Common::CityHash64(reinterpret_cast<const char*>(this), Size()); return static_cast<std::size_t>(hash); } bool FixedPipelineState::operator==(const FixedPipelineState& rhs) const noexcept { - return std::memcmp(this, &rhs, sizeof *this) == 0; + return std::memcmp(this, &rhs, Size()) == 0; } u32 FixedPipelineState::PackComparisonOp(Maxwell::ComparisonOp op) noexcept { |