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