18 #ifndef INCLUDED_SHADERDEFINES 19 #define INCLUDED_SHADERDEFINES 27 #include <unordered_map> 41 template<
typename value_t>
65 std::map<CStrIntern, value_t>
GetMap()
const;
101 using Item = std::pair<CStrIntern, value_t>;
125 using InternedItems_t = std::unordered_map<SItems, std::shared_ptr<SItems>, SItemsHash>;
158 int GetInt(
const char* name)
const;
174 void Add(
const char* name,
const CVector4D& value);
179 CVector4D GetVector(
const char* name)
const;
207 void Add(
const char* name);
214 #endif // INCLUDED_SHADERDEFINES std::map< CStrIntern, value_t > GetMap() const
Return a copy of the current name/value mapping.
Definition: ShaderDefines.cpp:143
bool operator==(const CShaderParams &b) const
Fast equality comparison.
Definition: ShaderDefines.h:85
std::pair< CStrIntern, value_t > Item
Definition: ShaderDefines.h:101
Definition: ShaderDefines.h:192
Definition: ShaderDefines.h:194
Uniform values that need to be evaluated in the renderer.
Definition: ShaderDefines.h:202
size_t hash
Definition: ShaderDefines.h:106
static CShaderParams s_Empty
Definition: ShaderDefines.h:137
Definition: Vector4D.h:30
Definition: ShaderDefines.h:98
Interned 8-bit strings.
Definition: CStrIntern.h:37
std::unordered_map< SItems, std::shared_ptr< SItems >, SItemsHash > InternedItems_t
Definition: ShaderDefines.h:125
CShaderParams()
Create an empty map of defines.
Definition: ShaderDefines.cpp:82
std::size_t operator()(const SItems &items) const
Definition: ShaderDefines.h:115
std::pair< int, CStrIntern > RenderQuery
Definition: ShaderDefines.h:205
Definition: ShaderDefines.h:193
static CShaderParams CreateEmpty()
Definition: ShaderDefines.cpp:93
IShaderProgram is a container for multiple shaders of different types.
Definition: IShaderProgram.h:80
RENDER_QUERIES
Definition: ShaderDefines.h:190
SItems * m_Items
Definition: ShaderDefines.h:122
bool operator!=(const CShaderParams &b) const
Fast inequality comparison.
Definition: ShaderDefines.h:93
Represents a mapping of name strings to value strings, for use with #if and #ifdef and similar condit...
Definition: ShaderDefines.h:146
Represents a mapping of name strings to value, for use with CShaderDefines (values are strings) and C...
Definition: ShaderDefines.h:42
size_t GetSize() const
Definition: ShaderDefines.h:208
void SetMany(const CShaderParams ¶ms)
Add all the names and values from another set of parameters.
Definition: ShaderDefines.cpp:127
void RecalcHash()
Definition: ShaderDefines.cpp:158
static SItems * GetInterned(const SItems &items)
Returns a pointer to an SItems equal to items.
Definition: ShaderDefines.cpp:64
Definition: ShaderDefines.h:113
static bool NameLess(const Item &a, const Item &b)
Definition: ShaderDefines.cpp:58
size_t GetHash() const
Return a hash of the current mapping.
Definition: ShaderDefines.cpp:152
std::vector< Item > items
Definition: ShaderDefines.h:104
void Set(CStrIntern name, const value_t &value)
Add a name and associated value to the map of parameters.
Definition: ShaderDefines.cpp:101
RenderQuery GetItem(size_t i) const
Definition: ShaderDefines.h:209
static InternedItems_t s_InternedItems
Definition: ShaderDefines.h:126
std::vector< RenderQuery > m_Items
Definition: ShaderDefines.h:211
Definition: IDeviceCommandContext.h:40
bool operator<(const CShaderParams &b) const
Compare with some arbitrary total order.
Definition: ShaderDefines.h:77