mirror of https://github.com/axmolengine/axmol.git
* fixed #18538: TrianglesCommand hashing technique doesn't take padding into account * sizeof fix
This commit is contained in:
parent
2d9fc6703c
commit
f77f724caa
|
@ -94,12 +94,17 @@ void TrianglesCommand::generateMaterialID()
|
|||
// if they don't have the same glProgramState, they might still have the same
|
||||
// uniforms/values and glProgram, but it would be too expensive to check the uniforms.
|
||||
struct {
|
||||
void* glProgramState;
|
||||
GLuint textureId;
|
||||
GLenum blendSrc;
|
||||
GLenum blendDst;
|
||||
void* glProgramState;
|
||||
} hashMe;
|
||||
|
||||
// NOTE: Initialize hashMe struct to make the value of padding bytes be filled with zero.
|
||||
// It's important since XXH32 below will also consider the padding bytes which probably
|
||||
// are set to random values by different compilers.
|
||||
memset(&hashMe, 0, sizeof(hashMe));
|
||||
|
||||
hashMe.textureId = _textureID;
|
||||
hashMe.blendSrc = _blendType.src;
|
||||
hashMe.blendDst = _blendType.dst;
|
||||
|
|
Loading…
Reference in New Issue