Cleanup: Proper printing of a string
Print it as a "%s" so that possible percentage symbols in the error message does not cause issues. Use proper assert (assert(true) is a no-op). Also use `empty()` instead of `length()`. Reviewed with Clement in real life.
This commit is contained in:
parent
402845744f
commit
3a88f151c4
|
@ -283,10 +283,10 @@ GPUShader *GPU_shader_create_from_info(const GPUShaderCreateInfo *_info)
|
|||
|
||||
GPU_debug_group_begin(GPU_DEBUG_SHADER_COMPILATION_GROUP);
|
||||
|
||||
std::string error = info.check_error();
|
||||
if (error.length()) {
|
||||
printf(error.c_str());
|
||||
BLI_assert(true);
|
||||
const std::string error = info.check_error();
|
||||
if (!error.empty()) {
|
||||
printf("%s\n", error.c_str());
|
||||
BLI_assert(false);
|
||||
}
|
||||
|
||||
Shader *shader = GPUBackend::get()->shader_alloc(info.name_.c_str());
|
||||
|
|
Loading…
Reference in New Issue