mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Cleanup.
This commit is contained in:
@@ -748,7 +748,7 @@ uint16_t weldVertices(WeldedVertex* _output, const bgfx::VertexDecl& _decl, cons
|
||||
{
|
||||
float pos[4];
|
||||
vertexUnpack(pos, bgfx::Attrib::Position, _decl, _data, ii);
|
||||
uint32_t hashValue = bx::hashMurmur2A(pos, 3*sizeof(float) ) & hashMask;
|
||||
uint32_t hashValue = bx::hash<bx::HashMurmur2A>(pos, 3*sizeof(float) ) & hashMask;
|
||||
|
||||
uint16_t offset = hashTable[hashValue];
|
||||
for (; UINT16_MAX != offset; offset = next[offset])
|
||||
|
||||
@@ -29,7 +29,7 @@ struct CmdContext
|
||||
|
||||
void add(const char* _name, ConsoleFn _fn, void* _userData)
|
||||
{
|
||||
uint32_t cmd = bx::hashMurmur2A(_name, (uint32_t)bx::strLen(_name) );
|
||||
uint32_t cmd = bx::hash<bx::HashMurmur2A>(_name, (uint32_t)bx::strLen(_name) );
|
||||
BX_CHECK(m_lookup.end() == m_lookup.find(cmd), "Command \"%s\" already exist.", _name);
|
||||
Func fn = { _fn, _userData };
|
||||
m_lookup.insert(stl::make_pair(cmd, fn) );
|
||||
@@ -47,7 +47,7 @@ struct CmdContext
|
||||
if (argc > 0)
|
||||
{
|
||||
int err = -1;
|
||||
uint32_t cmd = bx::hashMurmur2A(argv[0], (uint32_t)bx::strLen(argv[0]) );
|
||||
uint32_t cmd = bx::hash<bx::HashMurmur2A>(argv[0], (uint32_t)bx::strLen(argv[0]) );
|
||||
CmdLookup::iterator it = m_lookup.find(cmd);
|
||||
if (it != m_lookup.end() )
|
||||
{
|
||||
|
||||
10
src/bgfx_p.h
10
src/bgfx_p.h
@@ -1285,7 +1285,7 @@ namespace bgfx
|
||||
|
||||
const UniformRegInfo* find(const char* _name) const
|
||||
{
|
||||
uint16_t handle = m_uniforms.find(bx::hashMurmur2A(_name) );
|
||||
uint16_t handle = m_uniforms.find(bx::hash<bx::HashMurmur2A>(_name) );
|
||||
if (kInvalidHandle != handle)
|
||||
{
|
||||
return &m_info[handle];
|
||||
@@ -1297,7 +1297,7 @@ namespace bgfx
|
||||
const UniformRegInfo& add(UniformHandle _handle, const char* _name, const void* _data)
|
||||
{
|
||||
BX_CHECK(isValid(_handle), "Uniform handle is invalid (name: %s)!", _name);
|
||||
const uint32_t key = bx::hashMurmur2A(_name);
|
||||
const uint32_t key = bx::hash<bx::HashMurmur2A>(_name);
|
||||
m_uniforms.removeByKey(key);
|
||||
m_uniforms.insert(key, _handle.idx);
|
||||
|
||||
@@ -3123,7 +3123,7 @@ namespace bgfx
|
||||
return invalid;
|
||||
}
|
||||
|
||||
const uint32_t shaderHash = bx::hashMurmur2A(_mem->data, _mem->size);
|
||||
const uint32_t shaderHash = bx::hash<bx::HashMurmur2A>(_mem->data, _mem->size);
|
||||
const uint16_t idx = m_shaderHashMap.find(shaderHash);
|
||||
if (kInvalidHandle != idx)
|
||||
{
|
||||
@@ -3749,7 +3749,7 @@ namespace bgfx
|
||||
|
||||
_num = bx::uint16_max(1, _num);
|
||||
|
||||
uint16_t idx = m_uniformHashMap.find(bx::hashMurmur2A(_name) );
|
||||
uint16_t idx = m_uniformHashMap.find(bx::hash<bx::HashMurmur2A>(_name) );
|
||||
if (kInvalidHandle != idx)
|
||||
{
|
||||
UniformHandle handle = { idx };
|
||||
@@ -3794,7 +3794,7 @@ namespace bgfx
|
||||
uniform.m_type = _type;
|
||||
uniform.m_num = _num;
|
||||
|
||||
bool ok = m_uniformHashMap.insert(bx::hashMurmur2A(_name), handle.idx);
|
||||
bool ok = m_uniformHashMap.insert(bx::hash<bx::HashMurmur2A>(_name), handle.idx);
|
||||
BX_CHECK(ok, "Uniform already exists (name: %s)!", _name); BX_UNUSED(ok);
|
||||
|
||||
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateUniform);
|
||||
|
||||
@@ -4431,7 +4431,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
||||
}
|
||||
else if (BGFX_CHUNK_MAGIC_VSH == magic)
|
||||
{
|
||||
m_hash = bx::hashMurmur2A(code, shaderSize);
|
||||
m_hash = bx::hash<bx::HashMurmur2A>(code, shaderSize);
|
||||
m_code = copy(code, shaderSize);
|
||||
|
||||
DX_CHECK(s_renderD3D11->m_device->CreateVertexShader(code, shaderSize, NULL, &m_vertexShader) );
|
||||
|
||||
@@ -5225,7 +5225,7 @@ data.NumQualityLevels = 0;
|
||||
currentBindHash = 0;
|
||||
}
|
||||
|
||||
uint32_t bindHash = bx::hashMurmur2A(renderBind.m_bind, sizeof(renderBind.m_bind) );
|
||||
uint32_t bindHash = bx::hash<bx::HashMurmur2A>(renderBind.m_bind, sizeof(renderBind.m_bind) );
|
||||
if (currentBindHash != bindHash)
|
||||
{
|
||||
currentBindHash = bindHash;
|
||||
@@ -5456,7 +5456,7 @@ data.NumQualityLevels = 0;
|
||||
);
|
||||
|
||||
uint16_t scissor = draw.m_scissor;
|
||||
uint32_t bindHash = bx::hashMurmur2A(renderBind.m_bind, sizeof(renderBind.m_bind) );
|
||||
uint32_t bindHash = bx::hash<bx::HashMurmur2A>(renderBind.m_bind, sizeof(renderBind.m_bind) );
|
||||
if (currentBindHash != bindHash
|
||||
|| 0 != changedStencil
|
||||
|| (hasFactor && blendFactor != draw.m_rgba)
|
||||
|
||||
@@ -1043,7 +1043,7 @@ namespace bgfx { namespace gl
|
||||
glGetError(); // ignore error if glGetString returns NULL.
|
||||
if (NULL != str)
|
||||
{
|
||||
return bx::hashMurmur2A(str, (uint32_t)bx::strLen(str) );
|
||||
return bx::hash<bx::HashMurmur2A>(str, (uint32_t)bx::strLen(str) );
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -5531,7 +5531,7 @@ namespace bgfx { namespace gl
|
||||
void ShaderGL::create(Memory* _mem)
|
||||
{
|
||||
bx::MemoryReader reader(_mem->data, _mem->size);
|
||||
m_hash = bx::hashMurmur2A(_mem->data, _mem->size);
|
||||
m_hash = bx::hash<bx::HashMurmur2A>(_mem->data, _mem->size);
|
||||
|
||||
uint32_t magic;
|
||||
bx::read(&reader, magic);
|
||||
|
||||
@@ -3869,7 +3869,7 @@ BX_UNUSED(currentSamplerStateIdx);
|
||||
currentBindHash = 0;
|
||||
}
|
||||
|
||||
// uint32_t bindHash = bx::hashMurmur2A(renderBind.m_bind, sizeof(renderBind.m_bind) );
|
||||
// uint32_t bindHash = bx::hash<bx::HashMurmur2A>(renderBind.m_bind, sizeof(renderBind.m_bind) );
|
||||
// if (currentBindHash != bindHash)
|
||||
// {
|
||||
// currentBindHash = bindHash;
|
||||
@@ -4095,7 +4095,7 @@ BX_UNUSED(currentSamplerStateIdx);
|
||||
);
|
||||
|
||||
uint16_t scissor = draw.m_scissor;
|
||||
uint32_t bindHash = bx::hashMurmur2A(renderBind.m_bind, sizeof(renderBind.m_bind) );
|
||||
uint32_t bindHash = bx::hash<bx::HashMurmur2A>(renderBind.m_bind, sizeof(renderBind.m_bind) );
|
||||
if (currentBindHash != bindHash
|
||||
|| 0 != changedStencil
|
||||
|| (hasFactor && blendFactor != draw.m_rgba)
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace bgfx
|
||||
{
|
||||
bx::debugPrintf("vertexdecl %08x (%08x), stride %d\n"
|
||||
, _decl.m_hash
|
||||
, bx::hashMurmur2A(_decl.m_attributes)
|
||||
, bx::hash<bx::HashMurmur2A>(_decl.m_attributes)
|
||||
, _decl.m_stride
|
||||
);
|
||||
|
||||
@@ -812,7 +812,7 @@ namespace bgfx
|
||||
{
|
||||
float pos[4];
|
||||
vertexUnpack(pos, Attrib::Position, _decl, _data, ii);
|
||||
uint32_t hashValue = bx::hashMurmur2A(pos, 3*sizeof(float) ) & hashMask;
|
||||
uint32_t hashValue = bx::hash<bx::HashMurmur2A>(pos, 3*sizeof(float) ) & hashMask;
|
||||
|
||||
uint16_t offset = hashTable[hashValue];
|
||||
for (; UINT16_MAX != offset; offset = next[offset])
|
||||
|
||||
Reference in New Issue
Block a user