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:
@@ -283,10 +283,10 @@ GPUShader *GPU_shader_create_from_info(const GPUShaderCreateInfo *_info)
|
|||||||
|
|
||||||
GPU_debug_group_begin(GPU_DEBUG_SHADER_COMPILATION_GROUP);
|
GPU_debug_group_begin(GPU_DEBUG_SHADER_COMPILATION_GROUP);
|
||||||
|
|
||||||
std::string error = info.check_error();
|
const std::string error = info.check_error();
|
||||||
if (error.length()) {
|
if (!error.empty()) {
|
||||||
printf(error.c_str());
|
printf("%s\n", error.c_str());
|
||||||
BLI_assert(true);
|
BLI_assert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Shader *shader = GPUBackend::get()->shader_alloc(info.name_.c_str());
|
Shader *shader = GPUBackend::get()->shader_alloc(info.name_.c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user