shader: share nested pointer-table image and sampler selection

Co-authored-by: fxpw <fxpw@outlook.com>
This commit is contained in:
nmzik
2026-10-14 16:40:15 +02:00
parent 3a925efddf
commit 487bbf95fd
7 changed files with 484 additions and 27 deletions
@@ -181,10 +181,15 @@ RawSignedStorageFormat(const ImageResource& image, Prospero::BufferFormat format
}
struct SamplerResource {
static constexpr uint32_t NoIndirectSampler = UINT32_MAX;
uint32_t source = 0;
uint32_t first_use_pc = 0;
// Native filtering/border variants share the original sampler's runtime descriptor.
uint32_t snapshot_index = 0;
uint32_t indirect_root = NoIndirectSampler;
uint32_t indirect_mapping_offset = 0;
uint32_t indirect_search_iterations = 0;
std::vector<uint32_t> indirect_resources;
bool force_point_filtering = false;
bool depth_compare = false;
@@ -520,6 +525,12 @@ struct ShaderInfo {
struct DescriptorSource {
struct IndirectDescriptor {
struct PointerTable {
uint32_t maximum = 0;
uint32_t offset = 0;
bool operator==(const PointerTable&) const = default;
};
struct SelectorRead {
struct CountedRows {
uint32_t source = UINT32_MAX;
@@ -542,6 +553,7 @@ struct DescriptorSource {
bool operator==(const SelectorRead& other) const = default;
};
std::optional<SelectorRead> selector;
std::optional<PointerTable> pointer_table;
uint32_t table_source = 0;
uint32_t table_offset = 0;
uint32_t table_immediate = 0;