mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 07:38:02 -05:00
shader_ir: Turn classes into data structures
This commit is contained in:
@ -29,12 +29,11 @@ using ProgramCode = std::vector<u64>;
|
||||
|
||||
constexpr u32 MAX_PROGRAM_LENGTH = 0x1000;
|
||||
|
||||
class ConstBuffer {
|
||||
public:
|
||||
explicit ConstBuffer(u32 max_offset, bool is_indirect)
|
||||
struct ConstBuffer {
|
||||
constexpr explicit ConstBuffer(u32 max_offset, bool is_indirect)
|
||||
: max_offset{max_offset}, is_indirect{is_indirect} {}
|
||||
|
||||
ConstBuffer() = default;
|
||||
constexpr ConstBuffer() = default;
|
||||
|
||||
void MarkAsUsed(u64 offset) {
|
||||
max_offset = std::max(max_offset, static_cast<u32>(offset));
|
||||
@ -57,8 +56,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
u32 max_offset{};
|
||||
bool is_indirect{};
|
||||
u32 max_offset = 0;
|
||||
bool is_indirect = false;
|
||||
};
|
||||
|
||||
struct GlobalMemoryUsage {
|
||||
@ -332,12 +331,13 @@ private:
|
||||
std::optional<u32> buffer = std::nullopt);
|
||||
|
||||
/// Accesses a texture sampler
|
||||
const Sampler* GetSampler(const Tegra::Shader::Sampler& sampler,
|
||||
std::optional<SamplerInfo> sampler_info = std::nullopt);
|
||||
std::optional<Sampler> GetSampler(const Tegra::Shader::Sampler& sampler,
|
||||
std::optional<SamplerInfo> sampler_info = std::nullopt);
|
||||
|
||||
/// Accesses a texture sampler for a bindless texture.
|
||||
const Sampler* GetBindlessSampler(Tegra::Shader::Register reg, Node& index_var,
|
||||
std::optional<SamplerInfo> sampler_info = std::nullopt);
|
||||
std::optional<Sampler> GetBindlessSampler(
|
||||
Tegra::Shader::Register reg, Node& index_var,
|
||||
std::optional<SamplerInfo> sampler_info = std::nullopt);
|
||||
|
||||
/// Accesses an image.
|
||||
Image& GetImage(Tegra::Shader::Image image, Tegra::Shader::ImageType type);
|
||||
|
Reference in New Issue
Block a user