Mesa (master): st/mesa: fix assert to be simpler

Dave Airlie airlied at kemper.freedesktop.org
Tue Jun 20 23:39:32 UTC 2017


Module: Mesa
Branch: master
Commit: 72c8c684582095fffb45457ab6bcc73742a871c4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=72c8c684582095fffb45457ab6bcc73742a871c4

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Jun 20 15:50:37 2017 +1000

st/mesa: fix assert to be simpler

I just noticed a warning with a non-debug build, but really
this could all be one line, and I'm not even 100% the assert
makes sense here.

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/mesa/state_tracker/st_texture.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index 9de3b9a2e9..58636286ee 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -508,8 +508,6 @@ static GLuint64
 st_create_texture_handle_from_unit(struct st_context *st,
                                    struct gl_program *prog, GLuint texUnit)
 {
-   struct gl_context *ctx = st->ctx;
-   struct gl_texture_object *texObj;
    struct pipe_context *pipe = st->pipe;
    struct pipe_sampler_view *view;
    struct pipe_sampler_state sampler;
@@ -519,8 +517,7 @@ st_create_texture_handle_from_unit(struct st_context *st,
 
    st_convert_sampler_from_unit(st, &sampler, texUnit);
 
-   texObj = ctx->Texture.Unit[texUnit]._Current;
-   assert(texObj);
+   assert(st->ctx->Texture.Unit[texUnit]._Current);
 
    return pipe->create_texture_handle(pipe, view, &sampler);
 }




More information about the mesa-commit mailing list