shader_recompiler: Implement guest barycentrics (#3245)

* shader_recompiler: Implement guest barycentrics

* Review comments and some cleanup
This commit is contained in:
TheTurtle
2025-07-15 18:49:12 +03:00
committed by GitHub
parent 87f6cce7b1
commit 4407ebdd9b
17 changed files with 314 additions and 229 deletions

View File

@@ -1,5 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <span>
@@ -135,6 +136,16 @@ struct PushData {
static_assert(sizeof(PushData) <= 128,
"PushData size is greater than minimum size guaranteed by Vulkan spec");
enum class Qualifier : u8 {
None,
Smooth,
NoPerspective,
PerVertex,
Flat,
Centroid,
Sample,
};
/**
* Contains general information generated by the shader recompiler for an input program.
*/
@@ -194,7 +205,11 @@ struct Info {
PersistentSrtInfo srt_info;
std::vector<u32> flattened_ud_buf;
std::array<IR::Interpolation, 32> interp_qualifiers{};
struct Interpolation {
Qualifier primary;
Qualifier auxiliary;
};
std::array<Interpolation, IR::NumParams> fs_interpolation{};
IR::ScalarReg tess_consts_ptr_base = IR::ScalarReg::Max;
s32 tess_consts_dword_offset = -1;
@@ -209,8 +224,6 @@ struct Info {
bool has_discard{};
bool has_image_gather{};
bool has_image_query{};
bool has_perspective_interp{};
bool has_linear_interp{};
bool uses_buffer_atomic_float_min_max{};
bool uses_image_atomic_float_min_max{};
bool uses_lane_id{};