18#ifndef INCLUDED_SHADERDEFINES
19#define INCLUDED_SHADERDEFINES
28#include <unordered_map>
44template<
typename value_t>
68 std::map<CStrIntern, value_t>
GetMap()
const;
104 using Item = std::pair<CStrIntern, value_t>;
164 int GetInt(
const char* name)
const;
213 void Add(
const char* name);
RENDER_QUERIES
Definition: ShaderDefines.h:197
@ RQUERY_TIME
Definition: ShaderDefines.h:198
@ RQUERY_WATER_TEX
Definition: ShaderDefines.h:199
@ RQUERY_SKY_CUBE
Definition: ShaderDefines.h:200
Represents a mapping of name strings to value strings, for use with #if and #ifdef and similar condit...
Definition: ShaderDefines.h:153
int GetInt(const char *name) const
Return the value for the given name as an integer, or 0 if not defined.
Definition: ShaderDefines.cpp:187
void Add(CStrIntern name, CStrIntern value)
Add a name and associated value to the map of defines.
Definition: ShaderDefines.cpp:182
Represents a mapping of name strings to value, for use with CShaderDefines (values are strings) and C...
Definition: ShaderDefines.h:46
void Set(CStrIntern name, const value_t &value)
Add a name and associated value to the map of parameters.
Definition: ShaderDefines.cpp:113
size_t GetHash() const
Return a hash of the current mapping.
Definition: ShaderDefines.cpp:164
std::unordered_map< SItems, std::shared_ptr< SItems >, SItemsHash > InternedItems_t
Definition: ShaderDefines.h:131
bool operator<(const CShaderParams &b) const
Compare with some arbitrary total order.
Definition: ShaderDefines.h:80
bool operator==(const CShaderParams &b) const
Fast equality comparison.
Definition: ShaderDefines.h:88
static InternedItems_t s_InternedItems
Definition: ShaderDefines.h:132
static SItems * GetInterned(const SItems &items)
Returns a pointer to an SItems equal to items.
Definition: ShaderDefines.cpp:76
static CShaderParams s_Empty
Definition: ShaderDefines.h:143
bool operator!=(const CShaderParams &b) const
Fast inequality comparison.
Definition: ShaderDefines.h:96
SItems * m_Items
Definition: ShaderDefines.h:128
std::map< CStrIntern, value_t > GetMap() const
Return a copy of the current name/value mapping.
Definition: ShaderDefines.cpp:155
static CShaderParams CreateEmpty()
Definition: ShaderDefines.cpp:105
CShaderParams()
Create an empty map of defines.
Definition: ShaderDefines.cpp:94
void SetMany(const CShaderParams ¶ms)
Add all the names and values from another set of parameters.
Definition: ShaderDefines.cpp:139
Uniform values that need to be evaluated in the renderer.
Definition: ShaderDefines.h:209
std::vector< RenderQuery > m_Items
Definition: ShaderDefines.h:217
RenderQuery GetItem(size_t i) const
Definition: ShaderDefines.h:215
std::pair< int, CStrIntern > RenderQuery
Definition: ShaderDefines.h:211
void Add(const char *name)
Definition: ShaderDefines.cpp:238
size_t GetSize() const
Definition: ShaderDefines.h:214
Interned 8-bit strings.
Definition: CStrIntern.h:42
Definition: Vector4D.h:30
Definition: IDeviceCommandContext.h:46
IShaderProgram is a container for multiple shaders of different types.
Definition: IShaderProgram.h:85
Definition: Canvas2D.h:30
Definition: ShaderDefines.h:120
std::size_t operator()(const SItems &items) const
Definition: ShaderDefines.h:121
Definition: ShaderDefines.h:102
void RecalcHash()
Definition: ShaderDefines.cpp:170
static bool NameLess(const Item &a, const Item &b)
Definition: ShaderDefines.cpp:70
ItemsContainers items
Definition: ShaderDefines.h:110
std::pair< CStrIntern, value_t > Item
Definition: ShaderDefines.h:104
size_t hash
Definition: ShaderDefines.h:112