Commit 90958e35 by Cody Northrop Committed by Commit Bot

Implement ValidateFramebufferTexture3DOES

Bug: angleproject:3188 Test: KHR-GLES2.texture_3d.framebuffer_texture.negative Change-Id: I9a27c713bd7ea18b9f7d9943c6c180f92856c643 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1743079 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 221a1b5d
......@@ -335,6 +335,7 @@ MSG kInvalidVertexPointerStride = "Invalid stride for built-in vertex attribute.
MSG kInvalidVertexPointerType = "Invalid type for built-in vertex attribute.";
MSG kInvalidWidth = "Invalid width.";
MSG kInvalidWrapModeTexture = "Invalid wrap mode for texture type.";
MSG kInvalidZOffset = "zoffset is larger than MAX_3D_TEXTURE_SIZE-1";
MSG kLengthZero = "Length must not be zero.";
MSG kLevelNotZero = "Texture level must be zero.";
MSG kLightParameterOutOfRange = "Light parameter out of range.";
......
......@@ -6415,8 +6415,65 @@ bool ValidateFramebufferTexture3DOES(Context *context,
GLint level,
GLint zoffset)
{
UNIMPLEMENTED();
return false;
// We don't call into a base ValidateFramebufferTexture3D here because
// it doesn't exist for OpenGL ES. This function is replaced by
// FramebufferTextureLayer in ES 3.x, which has broader support.
if (!context->getExtensions().texture3DOES)
{
context->validationError(GL_INVALID_OPERATION, kExtensionNotEnabled);
return false;
}
// Attachments are required to be bound to level 0 without ES3 or the
// GL_OES_fbo_render_mipmap extension
if (context->getClientMajorVersion() < 3 && !context->getExtensions().fboRenderMipmap &&
level != 0)
{
context->validationError(GL_INVALID_VALUE, kInvalidFramebufferTextureLevel);
return false;
}
if (!ValidateFramebufferTextureBase(context, target, attachment, texture, level))
{
return false;
}
if (texture != 0)
{
gl::Texture *tex = context->getTexture(texture);
ASSERT(tex);
const gl::Caps &caps = context->getCaps();
switch (textargetPacked)
{
case TextureTarget::_3D:
{
if (level > gl::log2(caps.max3DTextureSize))
{
context->validationError(GL_INVALID_VALUE, kInvalidMipLevel);
return false;
}
if (static_cast<size_t>(zoffset) >= caps.max3DTextureSize)
{
context->validationError(GL_INVALID_VALUE, kInvalidZOffset);
return false;
}
if (tex->getType() != TextureType::_3D)
{
context->validationError(GL_INVALID_OPERATION, kInvalidTextureType);
return false;
}
}
break;
default:
context->validationError(GL_INVALID_OPERATION, kInvalidTextureTarget);
return false;
}
}
return true;
}
bool ValidateGenBuffers(Context *context, GLint n, GLuint *)
......
......@@ -39,7 +39,7 @@
3457 VULKAN : KHR-GLES2.core.internalformat.texture2d.depth_stencil_unsigned_int_24_8_depth_stencil = FAIL
// 3d texture framebuffer tests
3188 VULKAN : KHR-GLES2.texture_3d.framebuffer_* = SKIP
3188 VULKAN : KHR-GLES2.texture_3d.framebuffer_texture.rgba8 = SKIP
// Unclear what is happening here, failing to validate a 2D texture format
3190 VULKAN : KHR-GLES2.texture_3d.copy_sub_image.rgba8 = SKIP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment