mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 15:30:14 +01:00
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 <sroland@vmware.com>
This commit is contained in:
parent
5e4de781fa
commit
cac54d7987
1 changed files with 5 additions and 3 deletions
|
|
@ -358,8 +358,8 @@ make_texture(struct st_context *st,
|
||||||
GLenum intFormat = internal_format(ctx, format, type);
|
GLenum intFormat = internal_format(ctx, format, type);
|
||||||
|
|
||||||
pipeFormat = st_choose_format(st, intFormat, format, type,
|
pipeFormat = st_choose_format(st, intFormat, format, type,
|
||||||
PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW,
|
st->internal_target, 0,
|
||||||
FALSE);
|
PIPE_BIND_SAMPLER_VIEW, FALSE);
|
||||||
assert(pipeFormat != PIPE_FORMAT_NONE);
|
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;
|
struct cso_context *cso = st->cso_context;
|
||||||
GLfloat x0, y0, x1, y1;
|
GLfloat x0, y0, x1, y1;
|
||||||
GLsizei maxSize;
|
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 */
|
/* limit checks */
|
||||||
/* XXX if DrawPixels image is larger than max texture size, break
|
/* XXX if DrawPixels image is larger than max texture size, break
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue