Added transform feedback shader generation.
BUG=angle:495
Change-Id: I41a0177fd3eb43c9f4ab9e54faeadac3eb483c2c
Reviewed-on: https://chromium-review.googlesource.com/185035
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/validationES.cpp b/src/libGLESv2/validationES.cpp
index 05ef0d6..741770b 100644
--- a/src/libGLESv2/validationES.cpp
+++ b/src/libGLESv2/validationES.cpp
@@ -217,6 +217,28 @@
}
}
+bool ValidProgram(const Context *context, GLuint id)
+{
+ // ES3 spec (section 2.11.1) -- "Commands that accept shader or program object names will generate the
+ // error INVALID_VALUE if the provided name is not the name of either a shader or program object and
+ // INVALID_OPERATION if the provided name identifies an object that is not the expected type."
+
+ if (context->getProgram(id) != NULL)
+ {
+ return true;
+ }
+ else if (context->getShader(id) != NULL)
+ {
+ // ID is the wrong type
+ return gl::error(GL_INVALID_OPERATION, false);
+ }
+ else
+ {
+ // No shader/program object has this ID
+ return gl::error(GL_INVALID_VALUE, false);
+ }
+}
+
bool ValidateRenderbufferStorageParameters(const gl::Context *context, GLenum target, GLsizei samples,
GLenum internalformat, GLsizei width, GLsizei height,
bool angleExtension)