summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-02-07 16:27:41 +0000
committerBrian Paul <[email protected]>2001-02-07 16:27:41 +0000
commita1f1586bcb9fcd4a30930fd14b73323642ce85c5 (patch)
tree4635aa139c2eb7af61664b9e171c235ab284e152 /src/mesa
parentb8e1c70ec104f51f9a8e763bd8c582d3ff5c1d8d (diff)
added some code for proxy texture tests
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/teximage.c46
1 files changed, 41 insertions, 5 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 28a69ff259d..edb08e3d32f 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1,4 +1,4 @@
-/* $Id: teximage.c,v 1.73 2001/02/07 03:27:41 brianp Exp $ */
+/* $Id: teximage.c,v 1.74 2001/02/07 16:27:41 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1244,6 +1244,12 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat,
format, type, 1,
postConvWidth, 1, 1, border);
if (!error) {
+ struct gl_texture_unit *texUnit;
+ struct gl_texture_image *texImage;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ init_teximage_fields(ctx, texImage, postConvWidth, 1, 1,
+ border, internalFormat);
ASSERT(ctx->Driver.TestProxyTexImage);
error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
internalFormat, format, type,
@@ -1346,6 +1352,12 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat,
format, type, 2,
postConvWidth, postConvHeight, 1, border);
if (!error) {
+ struct gl_texture_unit *texUnit;
+ struct gl_texture_image *texImage;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ init_teximage_fields(ctx, texImage, postConvWidth, postConvHeight, 1,
+ border, internalFormat);
ASSERT(ctx->Driver.TestProxyTexImage);
error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
internalFormat, format, type,
@@ -1443,6 +1455,12 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat,
GLenum error = texture_error_check(ctx, target, level, internalFormat,
format, type, 3, width, height, depth, border);
if (!error) {
+ struct gl_texture_unit *texUnit;
+ struct gl_texture_image *texImage;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ init_teximage_fields(ctx, texImage, width, height, 1,
+ border, internalFormat);
ASSERT(ctx->Driver.TestProxyTexImage);
error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
internalFormat, format, type,
@@ -1938,6 +1956,12 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
GLenum error = texture_error_check(ctx, target, level, internalFormat,
GL_NONE, GL_NONE, 1, width, 1, 1, border);
if (!error) {
+ struct gl_texture_unit *texUnit;
+ struct gl_texture_image *texImage;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ init_teximage_fields(ctx, texImage, width, 1, 1,
+ border, internalFormat);
ASSERT(ctx->Driver.TestProxyTexImage);
error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
internalFormat, GL_NONE, GL_NONE,
@@ -2031,6 +2055,12 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level,
GLenum error = texture_error_check(ctx, target, level, internalFormat,
GL_NONE, GL_NONE, 2, width, height, 1, border);
if (!error) {
+ struct gl_texture_unit *texUnit;
+ struct gl_texture_image *texImage;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ init_teximage_fields(ctx, texImage, width, height, 1,
+ border, internalFormat);
ASSERT(ctx->Driver.TestProxyTexImage);
error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
internalFormat, GL_NONE, GL_NONE,
@@ -2122,6 +2152,12 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
GLenum error = texture_error_check(ctx, target, level, internalFormat,
GL_NONE, GL_NONE, 1, width, height, depth, border);
if (!error) {
+ struct gl_texture_unit *texUnit;
+ struct gl_texture_image *texImage;
+ texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
+ texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
+ init_teximage_fields(ctx, texImage, width, height, depth,
+ border, internalFormat);
ASSERT(ctx->Driver.TestProxyTexImage);
error = !(*ctx->Driver.TestProxyTexImage)(ctx, target, level,
internalFormat, GL_NONE, GL_NONE,
@@ -2146,10 +2182,10 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
GLsizei width, GLenum format,
GLsizei imageSize, const GLvoid *data)
{
- GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
+ GET_CURRENT_CONTEXT(ctx);
if (subtexture_error_check(ctx, 1, target, level, xoffset, 0, 0,
width, 1, 1, format, GL_NONE)) {
@@ -2179,10 +2215,10 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
GLenum format, GLsizei imageSize,
const GLvoid *data)
{
- GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
+ GET_CURRENT_CONTEXT(ctx);
if (subtexture_error_check(ctx, 2, target, level, xoffset, yoffset, 0,
width, height, 1, format, GL_NONE)) {
@@ -2212,10 +2248,10 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
GLsizei height, GLsizei depth, GLenum format,
GLsizei imageSize, const GLvoid *data)
{
- GET_CURRENT_CONTEXT(ctx);
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
+ GET_CURRENT_CONTEXT(ctx);
if (subtexture_error_check(ctx, 3, target, level, xoffset, yoffset, zoffset,
width, height, depth, format, GL_NONE)) {
@@ -2243,10 +2279,10 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
void
_mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img)
{
- GET_CURRENT_CONTEXT(ctx);
const struct gl_texture_unit *texUnit;
const struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);