shader/node: Unpack bindless texture encoding

Bindless textures were using u64 to pack the buffer and offset from
where they come from. Drop this in favor of separated entries in the
struct.

Remove the usage of std::set in favor of std::list (it's not std::vector
to avoid reference invalidations) for samplers and images.
This commit is contained in:
ReinUsesLisp
2019-10-28 02:31:05 -03:00
parent 2ec5b55ee3
commit a993df1ee2
8 changed files with 118 additions and 144 deletions

View File

@ -5,6 +5,7 @@
#pragma once
#include <array>
#include <list>
#include <map>
#include <optional>
#include <set>
@ -95,11 +96,11 @@ public:
return used_cbufs;
}
const std::set<Sampler>& GetSamplers() const {
const std::list<Sampler>& GetSamplers() const {
return used_samplers;
}
const std::map<u64, Image>& GetImages() const {
const std::list<Image>& GetImages() const {
return used_images;
}
@ -316,9 +317,6 @@ private:
/// Access a bindless image sampler.
Image& GetBindlessImage(Tegra::Shader::Register reg, Tegra::Shader::ImageType type);
/// Tries to access an existing image, updating it's state as needed
Image* TryUseExistingImage(u64 offset, Tegra::Shader::ImageType type);
/// Extracts a sequence of bits from a node
Node BitfieldExtract(Node value, u32 offset, u32 bits);
@ -402,8 +400,8 @@ private:
std::set<Tegra::Shader::Attribute::Index> used_input_attributes;
std::set<Tegra::Shader::Attribute::Index> used_output_attributes;
std::map<u32, ConstBuffer> used_cbufs;
std::set<Sampler> used_samplers;
std::map<u64, Image> used_images;
std::list<Sampler> used_samplers;
std::list<Image> used_images;
std::array<bool, Tegra::Engines::Maxwell3D::Regs::NumClipDistances> used_clip_distances{};
std::map<GlobalMemoryBase, GlobalMemoryUsage> used_global_memory;
bool uses_layer{};