Shader: Replace indices-based option keys by CRC32

This commit is contained in:
Jérôme Leclercq
2022-03-06 19:13:38 +01:00
parent 505d996c88
commit a7acf32886
18 changed files with 92 additions and 152 deletions

View File

@@ -38,11 +38,9 @@ namespace Nz
inline void UpdateConfig(Config& config, const std::vector<RenderPipelineInfo::VertexBufferData>& vertexBuffers);
inline void UpdateConfigCallback(ConfigCallback callback);
static constexpr std::size_t MaximumOptionValue = 32;
struct Config
{
std::array<ShaderAst::ConstantValue, MaximumOptionValue> optionValues;
std::unordered_map<UInt32, ShaderAst::ConstantValue> optionValues;
};
struct ConfigEqual
@@ -57,7 +55,7 @@ namespace Nz
struct Option
{
std::size_t index;
UInt32 hash;
};
private: