Browse Source
Revert "[vk] Correct polygon draw topology mapping for line and point modes (#2834)"
Revert "[vk] Correct polygon draw topology mapping for line and point modes (#2834)"
This reverts commit 6ba25b6cc0.
eds-true-adreno-fixes
committed by
Caio Oliveira
No known key found for this signature in database
GPG Key ID: AAAE6C7FD4186B0C
8 changed files with 49 additions and 296 deletions
-
76src/video_core/buffer_cache/buffer_cache.h
-
46src/video_core/polygon_mode_utils.h
-
3src/video_core/renderer_vulkan/fixed_pipeline_state.cpp
-
68src/video_core/renderer_vulkan/line_loop_utils.h
-
44src/video_core/renderer_vulkan/maxwell_to_vk.cpp
-
52src/video_core/renderer_vulkan/maxwell_to_vk.h
-
34src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
-
22src/video_core/renderer_vulkan/vk_rasterizer.cpp
@ -1,46 +0,0 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project |
|||
// SPDX-License-Identifier: GPL-3.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include "video_core/engines/maxwell_3d.h" |
|||
|
|||
namespace VideoCore { |
|||
|
|||
inline Tegra::Engines::Maxwell3D::Regs::PolygonMode EffectivePolygonMode( |
|||
const Tegra::Engines::Maxwell3D::Regs& regs) { |
|||
using Maxwell = Tegra::Engines::Maxwell3D::Regs; |
|||
|
|||
const bool cull_enabled = regs.gl_cull_test_enabled != 0; |
|||
const auto cull_face = regs.gl_cull_face; |
|||
const bool cull_front = cull_enabled && (cull_face == Maxwell::CullFace::Front || |
|||
cull_face == Maxwell::CullFace::FrontAndBack); |
|||
const bool cull_back = cull_enabled && (cull_face == Maxwell::CullFace::Back || |
|||
cull_face == Maxwell::CullFace::FrontAndBack); |
|||
|
|||
const bool render_front = !cull_front; |
|||
const bool render_back = !cull_back; |
|||
|
|||
const auto front_mode = regs.polygon_mode_front; |
|||
const auto back_mode = regs.polygon_mode_back; |
|||
|
|||
if (render_front && render_back && front_mode != back_mode) { |
|||
if (front_mode == Maxwell::PolygonMode::Line || back_mode == Maxwell::PolygonMode::Line) { |
|||
return Maxwell::PolygonMode::Line; |
|||
} |
|||
if (front_mode == Maxwell::PolygonMode::Point || back_mode == Maxwell::PolygonMode::Point) { |
|||
return Maxwell::PolygonMode::Point; |
|||
} |
|||
} |
|||
|
|||
if (render_front) { |
|||
return front_mode; |
|||
} |
|||
if (render_back) { |
|||
return back_mode; |
|||
} |
|||
return front_mode; |
|||
} |
|||
|
|||
} // namespace VideoCore |
|||
|
|||
@ -1,68 +0,0 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project |
|||
// SPDX-License-Identifier: GPL-3.0-or-later |
|||
|
|||
#pragma once |
|||
|
|||
#include <algorithm> |
|||
#include <cstring> |
|||
#include <span> |
|||
|
|||
#include "common/assert.h" |
|||
#include "common/common_types.h" |
|||
|
|||
namespace Vulkan::LineLoop { |
|||
|
|||
inline void CopyWithClosureRaw(std::span<u8> dst, std::span<const u8> src, size_t element_size) { |
|||
ASSERT_MSG(dst.size() == src.size() + element_size, "Invalid line loop copy sizes"); |
|||
if (src.empty()) { |
|||
if (!dst.empty()) { |
|||
std::fill(dst.begin(), dst.end(), u8{0}); |
|||
} |
|||
return; |
|||
} |
|||
std::memcpy(dst.data(), src.data(), src.size()); |
|||
std::memcpy(dst.data() + src.size(), src.data(), element_size); |
|||
} |
|||
|
|||
inline void GenerateSequentialWithClosureRaw(std::span<u8> dst, size_t element_size, |
|||
u64 start_value = 0) { |
|||
if (dst.empty()) { |
|||
return; |
|||
} |
|||
const size_t last = dst.size() - element_size; |
|||
size_t offset = 0; |
|||
u64 value = start_value; |
|||
while (offset < last) { |
|||
std::memcpy(dst.data() + offset, &value, element_size); |
|||
offset += element_size; |
|||
++value; |
|||
} |
|||
std::memcpy(dst.data() + offset, &start_value, element_size); |
|||
} |
|||
|
|||
template <typename T> |
|||
inline void CopyWithClosure(std::span<T> dst, std::span<const T> src) { |
|||
ASSERT_MSG(dst.size() == src.size() + 1, "Invalid destination size for line loop copy"); |
|||
if (src.empty()) { |
|||
if (!dst.empty()) { |
|||
dst.front() = {}; |
|||
} |
|||
return; |
|||
} |
|||
std::copy(src.begin(), src.end(), dst.begin()); |
|||
dst.back() = src.front(); |
|||
} |
|||
|
|||
template <typename T> |
|||
inline void GenerateSequentialWithClosure(std::span<T> dst, T start_value = {}) { |
|||
if (dst.empty()) { |
|||
return; |
|||
} |
|||
const size_t last = dst.size() - 1; |
|||
for (size_t i = 0; i < last; ++i) { |
|||
dst[i] = static_cast<T>(start_value + static_cast<T>(i)); |
|||
} |
|||
dst.back() = start_value; |
|||
} |
|||
|
|||
} // namespace Vulkan::LineLoop |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue