diff options
author | Brian Paul <[email protected]> | 2016-02-09 14:44:54 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-02-09 17:48:26 -0700 |
commit | cac54d7987ce1b878d41160f6429fb38e85a603c (patch) | |
tree | 328455b7cb990b40ab6f16c34756d81282b936c4 | |
parent | 5e4de781fadea9e138e722c53a2e72eeb1d41a5a (diff) |
st/mesa: clarify some texture target code in st_cb_drawpix.c
Use st->internal_target instead of PIPE_TEXTURE_2D when choosing the
texture format. Probably no real difference, but let's be consistent.
Simplify a test when determining whether we need normalized texcoords.
Add a new assertion.
Reviewed-by: Roland Scheidegger <[email protected]>
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawpixels.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 7096bd277ba..fd58886a782 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -358,8 +358,8 @@ make_texture(struct st_context *st, GLenum intFormat = internal_format(ctx, format, type); pipeFormat = st_choose_format(st, intFormat, format, type, - PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW, - FALSE); + st->internal_target, 0, + PIPE_BIND_SAMPLER_VIEW, FALSE); assert(pipeFormat != PIPE_FORMAT_NONE); } @@ -556,7 +556,9 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, struct cso_context *cso = st->cso_context; GLfloat x0, y0, x1, y1; GLsizei maxSize; - boolean normalized = sv[0]->texture->target != PIPE_TEXTURE_RECT; + boolean normalized = sv[0]->texture->target == PIPE_TEXTURE_2D; + + assert(sv[0]->texture->target == st->internal_target); /* limit checks */ /* XXX if DrawPixels image is larger than max texture size, break |