Add Memory::alloc_static_zeroed to allocate memory that's filled with zeroes.
This is generally faster than `malloc` followed by `memset` / loop-set to 0.
This commit is contained in:
@ -340,8 +340,7 @@ void ShaderGLES3::_compile_specialization(Version::Specialization &spec, uint32_
|
||||
iloglen = 4096; // buggy driver (Adreno 220+)
|
||||
}
|
||||
|
||||
char *ilogmem = (char *)Memory::alloc_static(iloglen + 1);
|
||||
memset(ilogmem, 0, iloglen + 1);
|
||||
char *ilogmem = (char *)Memory::alloc_static_zeroed(iloglen + 1);
|
||||
glGetShaderInfoLog(spec.vert_id, iloglen, &iloglen, ilogmem);
|
||||
|
||||
String err_string = name + ": Vertex shader compilation failed:\n";
|
||||
@ -388,8 +387,7 @@ void ShaderGLES3::_compile_specialization(Version::Specialization &spec, uint32_
|
||||
iloglen = 4096; // buggy driver (Adreno 220+)
|
||||
}
|
||||
|
||||
char *ilogmem = (char *)Memory::alloc_static(iloglen + 1);
|
||||
memset(ilogmem, 0, iloglen + 1);
|
||||
char *ilogmem = (char *)Memory::alloc_static_zeroed(iloglen + 1);
|
||||
glGetShaderInfoLog(spec.frag_id, iloglen, &iloglen, ilogmem);
|
||||
|
||||
String err_string = name + ": Fragment shader compilation failed:\n";
|
||||
|
||||
Reference in New Issue
Block a user