OPCODE_MATRIX_POP,
OPCODE_TEXTUREPARAMETER_F,
OPCODE_TEXTUREPARAMETER_I,
+ OPCODE_TEXTURE_SUB_IMAGE2D,
+ OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D,
/* The following three are meta instructions */
OPCODE_ERROR, /* raise compiled-in error */
case OPCODE_WINDOW_RECTANGLES:
free(get_pointer(&n[3]));
break;
+ case OPCODE_TEXTURE_SUB_IMAGE2D:
+ case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D:
+ free(get_pointer(&n[10]));
+ break;
case OPCODE_CONTINUE:
n = (Node *) get_pointer(&n[1]);
free(block);
save_TextureParameterivEXT(texture, target, pname, fparam);
}
+static void GLAPIENTRY
+save_TextureSubImage2DEXT(GLuint texture, GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type, const GLvoid * pixels)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_TEXTURE_SUB_IMAGE2D, 9 + POINTER_DWORDS);
+ if (n) {
+ n[1].ui = texture;
+ n[2].e = target;
+ n[3].i = level;
+ n[4].i = xoffset;
+ n[5].i = yoffset;
+ n[6].i = (GLint) width;
+ n[7].i = (GLint) height;
+ n[8].e = format;
+ n[9].e = type;
+ save_pointer(&n[10],
+ unpack_image(ctx, 2, width, height, 1, format, type,
+ pixels, &ctx->Unpack));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_TextureSubImage2DEXT(ctx->Exec, (texture, target, level, xoffset, yoffset,
+ width, height, format, type, pixels));
+ }
+}
+
+static void GLAPIENTRY
+save_CompressedTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset,
+ GLint yoffset, GLsizei width, GLsizei height,
+ GLenum format, GLsizei imageSize,
+ const GLvoid * data)
+{
+ Node *n;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+ n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D,
+ 9 + POINTER_DWORDS);
+ if (n) {
+ n[1].ui = texture;
+ n[2].e = target;
+ n[3].i = level;
+ n[4].i = xoffset;
+ n[5].i = yoffset;
+ n[6].i = (GLint) width;
+ n[7].i = (GLint) height;
+ n[8].e = format;
+ n[9].i = imageSize;
+ save_pointer(&n[10],
+ copy_data(data, imageSize, "glCompressedTextureSubImage2DEXT"));
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_CompressedTextureSubImage2DEXT(ctx->Exec,
+ (texture, target, level, xoffset, yoffset,
+ width, height, format, imageSize, data));
+ }
+}
+
/**
* Save an error-generating command into display list.
CALL_TextureParameterivEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].e, params));
}
break;
+ case OPCODE_TEXTURE_SUB_IMAGE2D:
+ {
+ const struct gl_pixelstore_attrib save = ctx->Unpack;
+ ctx->Unpack = ctx->DefaultPacking;
+ CALL_TextureSubImage2DEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].i,
+ n[4].i, n[5].i, n[6].e,
+ n[7].i, n[8].e, n[9].e,
+ get_pointer(&n[10])));
+ ctx->Unpack = save;
+ }
+ break;
+ case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D:
+ CALL_CompressedTextureSubImage2DEXT(ctx->Exec,
+ (n[1].ui, n[2].e, n[3].i, n[4].i,
+ n[5].i, n[6].i, n[7].i, n[8].e,
+ n[9].i, get_pointer(&n[10])));
+ break;
case OPCODE_CONTINUE:
n = (Node *) get_pointer(&n[1]);
SET_TextureParameterivEXT(table, save_TextureParameterivEXT);
SET_TextureParameterfEXT(table, save_TextureParameterfEXT);
SET_TextureParameterfvEXT(table, save_TextureParameterfvEXT);
+ SET_TextureSubImage2DEXT(table, save_TextureSubImage2DEXT);
+ SET_CompressedTextureSubImage2DEXT(table, save_CompressedTextureSubImage2DEXT);
}