Get hardware-accelerated CopyTexSubImage working well enough to run

Brian's gearbox demo.
This commit is contained in:
Keith Whitwell 2006-01-28 23:28:14 +00:00
parent 9839e272cf
commit 4c5acef241
2 changed files with 23 additions and 1 deletions

View file

@ -65,6 +65,10 @@ void intelInitTextureFuncs(struct dd_function_table * functions)
functions->TexImage2D = intelTexImage2D;
functions->TexSubImage1D = intelTexSubImage1D;
functions->TexSubImage2D = intelTexSubImage2D;
functions->CopyTexImage1D = intelCopyTexImage1D;
functions->CopyTexImage2D = intelCopyTexImage2D;
functions->CopyTexSubImage1D = intelCopyTexSubImage1D;
functions->CopyTexSubImage2D = intelCopyTexSubImage2D;
functions->NewTextureObject = intelNewTextureObject;
functions->NewTextureImage = intelNewTextureImage;
functions->DeleteTexture = _mesa_delete_texture_object;

View file

@ -45,6 +45,9 @@
static struct intel_region *get_teximage_source( struct intel_context *intel,
GLenum internalFormat )
{
DBG("%s %s\n", __FUNCTION__,
_mesa_lookup_enum_by_nr(internalFormat));
switch (internalFormat) {
case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT16_ARB:
@ -67,6 +70,21 @@ static struct intel_region *get_teximage_source( struct intel_context *intel,
}
}
static GLboolean check_copytex_fragment_ops( const GLcontext *ctx )
{
return !(ctx->Color.AlphaEnabled ||
/* ctx->Depth.Test || */
ctx->Fog.Enabled ||
/* ctx->Scissor.Enabled || */
ctx->Stencil.Enabled ||
!ctx->Color.ColorMask[0] ||
!ctx->Color.ColorMask[1] ||
!ctx->Color.ColorMask[2] ||
!ctx->Color.ColorMask[3] ||
ctx->Color.ColorLogicOpEnabled ||
ctx->Texture._EnabledUnits);
}
static GLboolean do_copy_texsubimage( struct intel_context *intel,
struct intel_texture_image *intelImage,
@ -82,7 +100,7 @@ static GLboolean do_copy_texsubimage( struct intel_context *intel,
if (!intelImage->mt)
return GL_FALSE;
if (!intel_check_color_per_fragment_ops( ctx ))
if (!check_copytex_fragment_ops( ctx ))
return GL_FALSE;