opengles emulator: 2.0: handle texture=0 on glFramebufferTexture2D

texture=0 has a special meaning - detach texture. Therefore we should pass
it on as 0 rather than look for the global name in the name space.

Change-Id: If7d0174a7fd07fc13a75430312b605497653f01b
This commit is contained in:
Yochai Shefi Simchon
2011-07-27 15:14:56 +03:00
committed by David 'Digit' Turner
parent a182a1a7e4
commit 70d6f3e2b9

View File

@@ -612,10 +612,18 @@ GL_APICALL void GL_APIENTRY glFramebufferTexture2D(GLenum target, GLenum attach
GLESv2Validate::framebufferAttachment(attachment)),GL_INVALID_ENUM); GLESv2Validate::framebufferAttachment(attachment)),GL_INVALID_ENUM);
SET_ERROR_IF(level != 0, GL_INVALID_VALUE); SET_ERROR_IF(level != 0, GL_INVALID_VALUE);
if(ctx->shareGroup().Ptr()) { if(texture == 0)
{
// Special case - detach texture
ctx->dispatcher().glFramebufferTexture2DEXT(target,attachment,textarget,0,level);
}
else
{
if(ctx->shareGroup().Ptr()) {
ObjectLocalName texname = TextureLocalName(textarget,texture); ObjectLocalName texname = TextureLocalName(textarget,texture);
GLuint globalTextureName = ctx->shareGroup()->getGlobalName(TEXTURE,texname); GLuint globalTextureName = ctx->shareGroup()->getGlobalName(TEXTURE,texname);
ctx->dispatcher().glFramebufferTexture2DEXT(target,attachment,textarget,globalTextureName,level); ctx->dispatcher().glFramebufferTexture2DEXT(target,attachment,textarget,globalTextureName,level);
}
} }
} }