Add helper methods for FBO attachment validation.
Subsequent refactoring will eliminate duplicate code.
BUG=angle:571
Change-Id: I086320beb5c432c326d29d047931575e6f2a1d64
Reviewed-on: https://chromium-review.googlesource.com/205603
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
diff --git a/src/libGLESv2/validationES.cpp b/src/libGLESv2/validationES.cpp
index ec2a6b6..f334ea1 100644
--- a/src/libGLESv2/validationES.cpp
+++ b/src/libGLESv2/validationES.cpp
@@ -1433,4 +1433,22 @@
return (primcount > 0);
}
+bool ValidateFramebufferTexture2D(const gl::Context *context, GLenum target, GLenum attachment,
+ GLenum textarget, GLuint texture, GLint level)
+{
+ if (context->getClientVersion() < 3 &&
+ !ValidateES2FramebufferTextureParameters(context, target, attachment, textarget, texture, level))
+ {
+ return false;
+ }
+
+ if (context->getClientVersion() >= 3 &&
+ !ValidateES3FramebufferTextureParameters(context, target, attachment, textarget, texture, level, 0, false))
+ {
+ return false;
+ }
+
+ return true;
+}
+
}