diff options
author | Samuel Pitoiset <[email protected]> | 2017-05-23 23:45:48 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-05-29 10:11:41 +0200 |
commit | 3ca5da270449d1f5baa8325a401d3cd100de987a (patch) | |
tree | ad994f47a19811bf84ce25d64752cc67adfe0a22 /src/mesa | |
parent | 1f75915e1a661b0080cf23fa2ea9a55417701f59 (diff) |
mesa: add bind_image_texture() helper
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/shaderimage.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c index ad9fdb0e9bc..19011d80b9e 100644 --- a/src/mesa/main/shaderimage.c +++ b/src/mesa/main/shaderimage.c @@ -586,13 +586,27 @@ set_image_binding(struct gl_image_unit *u, struct gl_texture_object *texObj, _mesa_reference_texobj(&u->TexObj, texObj); } +static void +bind_image_texture(struct gl_context *ctx, struct gl_texture_object *texObj, + GLuint unit, GLint level, GLboolean layered, GLint layer, + GLenum access, GLenum format) +{ + struct gl_image_unit *u; + + u = &ctx->ImageUnits[unit]; + + FLUSH_VERTICES(ctx, 0); + ctx->NewDriverState |= ctx->DriverFlags.NewImageUnits; + + set_image_binding(u, texObj, level, layered, layer, access, format); +} + void GLAPIENTRY _mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) { struct gl_texture_object *texObj = NULL; - struct gl_image_unit *u; GET_CURRENT_CONTEXT(ctx); @@ -600,11 +614,6 @@ _mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level, format)) return; - u = &ctx->ImageUnits[unit]; - - FLUSH_VERTICES(ctx, 0); - ctx->NewDriverState |= ctx->DriverFlags.NewImageUnits; - if (texture) { texObj = _mesa_lookup_texture(ctx, texture); @@ -631,7 +640,7 @@ _mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level, } } - set_image_binding(u, texObj, level, layered, layer, access, format); + bind_image_texture(ctx, texObj, unit, level, layered, layer, access, format); } void GLAPIENTRY |