mirror of
https://github.com/brl/mutter.git
synced 2025-04-26 03:39:39 +00:00
arbfp: assume GL_TEXTURE_2D target for NULL texture
During arbfp codegen we weren't checking for NULL textures and so we would crash when trying to query a NULL texture's GL texture target. Since NULL texture targets result in ctx->default_gl_texture_2d_tex being bound we can assume that a NULL texture corresponds to a GL_TEXTURE_2D target. Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
parent
cdbb188a7c
commit
dd5208b0ba
@ -390,7 +390,10 @@ setup_arg (CoglPipeline *pipeline,
|
|||||||
arg->name = "texel%d";
|
arg->name = "texel%d";
|
||||||
arg->texture_unit = _cogl_pipeline_layer_get_unit_index (layer);
|
arg->texture_unit = _cogl_pipeline_layer_get_unit_index (layer);
|
||||||
texture = _cogl_pipeline_layer_get_texture (layer);
|
texture = _cogl_pipeline_layer_get_texture (layer);
|
||||||
cogl_texture_get_gl_texture (texture, NULL, &gl_target);
|
if (texture)
|
||||||
|
cogl_texture_get_gl_texture (texture, NULL, &gl_target);
|
||||||
|
else
|
||||||
|
gl_target = GL_TEXTURE_2D;
|
||||||
setup_texture_source (shader_state, arg->texture_unit, gl_target);
|
setup_texture_source (shader_state, arg->texture_unit, gl_target);
|
||||||
break;
|
break;
|
||||||
case COGL_PIPELINE_COMBINE_SOURCE_CONSTANT:
|
case COGL_PIPELINE_COMBINE_SOURCE_CONSTANT:
|
||||||
@ -423,7 +426,10 @@ setup_arg (CoglPipeline *pipeline,
|
|||||||
arg->name = "texture[%d]";
|
arg->name = "texture[%d]";
|
||||||
arg->texture_unit = src - GL_TEXTURE0;
|
arg->texture_unit = src - GL_TEXTURE0;
|
||||||
texture = _cogl_pipeline_layer_get_texture (layer);
|
texture = _cogl_pipeline_layer_get_texture (layer);
|
||||||
cogl_texture_get_gl_texture (texture, NULL, &gl_target);
|
if (texture)
|
||||||
|
cogl_texture_get_gl_texture (texture, NULL, &gl_target);
|
||||||
|
else
|
||||||
|
gl_target = GL_TEXTURE_2D;
|
||||||
setup_texture_source (shader_state, arg->texture_unit, gl_target);
|
setup_texture_source (shader_state, arg->texture_unit, gl_target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user