meta: De-static setup_texture_coords().
This will be used in multiple files soon. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
1308d21fbf
commit
3a7f3d843a
|
@ -2465,16 +2465,16 @@ _mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target,
|
||||||
* \param height height of the texture image
|
* \param height height of the texture image
|
||||||
* \param coords0/1/2/3 returns the computed texcoords
|
* \param coords0/1/2/3 returns the computed texcoords
|
||||||
*/
|
*/
|
||||||
static void
|
void
|
||||||
setup_texture_coords(GLenum faceTarget,
|
_mesa_meta_setup_texture_coords(GLenum faceTarget,
|
||||||
GLint slice,
|
GLint slice,
|
||||||
GLint width,
|
GLint width,
|
||||||
GLint height,
|
GLint height,
|
||||||
GLint depth,
|
GLint depth,
|
||||||
GLfloat coords0[4],
|
GLfloat coords0[4],
|
||||||
GLfloat coords1[4],
|
GLfloat coords1[4],
|
||||||
GLfloat coords2[4],
|
GLfloat coords2[4],
|
||||||
GLfloat coords3[4])
|
GLfloat coords3[4])
|
||||||
{
|
{
|
||||||
static const GLfloat st[4][2] = {
|
static const GLfloat st[4][2] = {
|
||||||
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f}
|
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f}
|
||||||
|
@ -2618,7 +2618,7 @@ setup_texture_coords(GLenum faceTarget,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0 && "unexpected target in meta setup_texture_coords()");
|
assert(!"unexpected target in _mesa_meta_setup_texture_coords()");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2808,13 +2808,13 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
|
||||||
memset(verts, 0, sizeof(verts));
|
memset(verts, 0, sizeof(verts));
|
||||||
|
|
||||||
/* Setup texture coordinates */
|
/* Setup texture coordinates */
|
||||||
setup_texture_coords(faceTarget,
|
_mesa_meta_setup_texture_coords(faceTarget,
|
||||||
slice,
|
slice,
|
||||||
0, 0, 1, /* width, height never used here */
|
0, 0, 1, /* width, height never used here */
|
||||||
verts[0].tex,
|
verts[0].tex,
|
||||||
verts[1].tex,
|
verts[1].tex,
|
||||||
verts[2].tex,
|
verts[2].tex,
|
||||||
verts[3].tex);
|
verts[3].tex);
|
||||||
|
|
||||||
/* setup vertex positions */
|
/* setup vertex positions */
|
||||||
verts[0].x = -1.0F;
|
verts[0].x = -1.0F;
|
||||||
|
@ -3219,11 +3219,11 @@ decompress_texture_image(struct gl_context *ctx,
|
||||||
/* Silence valgrind warnings about reading uninitialized stack. */
|
/* Silence valgrind warnings about reading uninitialized stack. */
|
||||||
memset(verts, 0, sizeof(verts));
|
memset(verts, 0, sizeof(verts));
|
||||||
|
|
||||||
setup_texture_coords(faceTarget, slice, width, height, depth,
|
_mesa_meta_setup_texture_coords(faceTarget, slice, width, height, depth,
|
||||||
verts[0].tex,
|
verts[0].tex,
|
||||||
verts[1].tex,
|
verts[1].tex,
|
||||||
verts[2].tex,
|
verts[2].tex,
|
||||||
verts[3].tex);
|
verts[3].tex);
|
||||||
|
|
||||||
/* setup vertex positions */
|
/* setup vertex positions */
|
||||||
verts[0].x = -1.0F;
|
verts[0].x = -1.0F;
|
||||||
|
|
|
@ -448,6 +448,17 @@ GLboolean
|
||||||
_mesa_meta_alloc_texture(struct temp_texture *tex,
|
_mesa_meta_alloc_texture(struct temp_texture *tex,
|
||||||
GLsizei width, GLsizei height, GLenum intFormat);
|
GLsizei width, GLsizei height, GLenum intFormat);
|
||||||
|
|
||||||
|
void
|
||||||
|
_mesa_meta_setup_texture_coords(GLenum faceTarget,
|
||||||
|
GLint slice,
|
||||||
|
GLint width,
|
||||||
|
GLint height,
|
||||||
|
GLint depth,
|
||||||
|
GLfloat coords0[4],
|
||||||
|
GLfloat coords1[4],
|
||||||
|
GLfloat coords2[4],
|
||||||
|
GLfloat coords3[4]);
|
||||||
|
|
||||||
struct temp_texture *
|
struct temp_texture *
|
||||||
_mesa_meta_get_temp_texture(struct gl_context *ctx);
|
_mesa_meta_get_temp_texture(struct gl_context *ctx);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue