shader: share runtime value checks

This commit is contained in:
nmzik
2026-09-05 13:16:54 +04:00
parent a379304362
commit ebe0979563
5 changed files with 159 additions and 77 deletions
@@ -19,10 +19,13 @@ struct SrtRuntime {
SrtMemoryReader read_specialization_memory = nullptr;
};
enum class RuntimeValueType { Any, Integer };
// Collects reachable ReadConst values. Immediate offsets receive compact flat-buffer slots;
// dynamic offsets remain explicit and are never assigned a fake slot.
void BuildSrtPlan(Program& program);
bool ValidateRuntimeValue(const ResourcePlan& program, Value value);
bool ValidateRuntimeValue(const ResourcePlan& program, Value value,
RuntimeValueType type = RuntimeValueType::Any);
bool EvaluateUniformValues(const ResourcePlan& program, std::span<const Value> values,
const SrtRuntime& runtime, std::span<uint32_t> results);