Cleanup: GPUTexture: Move debug messages outside of creation function

# Conflicts:
#	source/blender/gpu/intern/gpu_framebuffer.cc
This commit is contained in:
Clément Foucault
2020-09-05 02:55:22 +02:00
parent ab95cdaba9
commit 8e4c0efbe3
4 changed files with 3 additions and 2 deletions

View File

@@ -184,7 +184,7 @@ static void updateGLSLShader(OCIO_GLSLShader *shader,
NULL,
NULL,
NULL,
__func__);
"OCIOShader");
if (shader->shader) {
shader->dither_loc = GPU_shader_get_uniform(shader->shader, "dither");

View File

@@ -247,6 +247,7 @@ static GPUTexture **get_image_gpu_texture_ptr(Image *ima,
static GPUTexture *image_gpu_texture_error_create(eGPUTextureTarget textarget)
{
fprintf(stderr, "GPUTexture: Blender Texture Not Loaded!\n");
switch (textarget) {
case TEXTARGET_2D_ARRAY:
return GPU_texture_create_error(2, true);

View File

@@ -1917,6 +1917,7 @@ GPUTexture *BKE_movieclip_get_gpu_texture(MovieClip *clip, MovieClipUser *cuser)
/* check if we have a valid image buffer */
ImBuf *ibuf = BKE_movieclip_get_ibuf(clip, cuser);
if (ibuf == NULL) {
fprintf(stderr, "GPUTexture: Blender Texture Not Loaded!\n");
*tex = GPU_texture_create_error(2, false);
return *tex;
}

View File

@@ -325,7 +325,6 @@ GPUTexture *GPU_texture_create_error(int dimension, bool is_array)
type = (dimension == 2) ? (is_array ? GPU_TEXTURE_2D_ARRAY : GPU_TEXTURE_2D) : type;
type = (dimension == 1) ? (is_array ? GPU_TEXTURE_1D_ARRAY : GPU_TEXTURE_1D) : type;
fprintf(stderr, "GPUTexture: Blender Texture Not Loaded!");
return gpu_texture_create("invalid_tex", w, h, d, type, 1, GPU_RGBA8, pixel);
}