Commit ed87c16a by Mohan Maiya Committed by Commit Bot

Vulkan: Add GL_EXT_separate_shader_objects support

All the functionality needed for this extension has already been implemented as part of core GLES31. Hook into that along with changes to validation layer to allow non-GLES31 contexts to call into these APIs as long as the extension is exposed. Bug: angleproject:3570 Test: ProgramPipelineTest.GenerateProgramPipelineObjectEXT* Change-Id: I92a61a47517c5cb9573874b2add6a744c9edb755 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2539121 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com>
parent cc4ae6da
...@@ -345,6 +345,9 @@ void RendererVk::ensureCapsInitialized() const ...@@ -345,6 +345,9 @@ void RendererVk::ensureCapsInitialized() const
// Implemented in the translator // Implemented in the translator
mNativeExtensions.shaderNonConstGlobalInitializersEXT = true; mNativeExtensions.shaderNonConstGlobalInitializersEXT = true;
// Implemented in the front end
mNativeExtensions.separateShaderObjects = true;
// Vulkan has no restrictions of the format of cubemaps, so if the proper formats are supported, // Vulkan has no restrictions of the format of cubemaps, so if the proper formats are supported,
// creating a cube of any of these formats should be implicitly supported. // creating a cube of any of these formats should be implicitly supported.
mNativeExtensions.depthTextureCubeMapOES = mNativeExtensions.depthTextureCubeMapOES =
......
...@@ -2014,17 +2014,11 @@ bool ValidateGetProgramBinary(const Context *context, ...@@ -2014,17 +2014,11 @@ bool ValidateGetProgramBinary(const Context *context,
return ValidateGetProgramBinaryBase(context, program, bufSize, length, binaryFormat, binary); return ValidateGetProgramBinaryBase(context, program, bufSize, length, binaryFormat, binary);
} }
bool ValidateProgramParameteri(const Context *context, bool ValidateProgramParameteriBase(const Context *context,
ShaderProgramID program, ShaderProgramID program,
GLenum pname, GLenum pname,
GLint value) GLint value)
{ {
if (context->getClientMajorVersion() < 3)
{
context->validationError(GL_INVALID_OPERATION, kES3Required);
return false;
}
if (GetValidProgram(context, program) == nullptr) if (GetValidProgram(context, program) == nullptr)
{ {
return false; return false;
...@@ -2062,6 +2056,20 @@ bool ValidateProgramParameteri(const Context *context, ...@@ -2062,6 +2056,20 @@ bool ValidateProgramParameteri(const Context *context,
return true; return true;
} }
bool ValidateProgramParameteri(const Context *context,
ShaderProgramID program,
GLenum pname,
GLint value)
{
if (context->getClientMajorVersion() < 3)
{
context->validationError(GL_INVALID_OPERATION, kES3Required);
return false;
}
return ValidateProgramParameteriBase(context, program, pname, value);
}
bool ValidateBlitFramebuffer(const Context *context, bool ValidateBlitFramebuffer(const Context *context,
GLint srcX0, GLint srcX0,
GLint srcY0, GLint srcY0,
......
...@@ -31,6 +31,11 @@ bool ValidateES3TexImageParametersBase(const Context *context, ...@@ -31,6 +31,11 @@ bool ValidateES3TexImageParametersBase(const Context *context,
GLenum type, GLenum type,
GLsizei imageSize, GLsizei imageSize,
const void *pixels); const void *pixels);
bool ValidateProgramParameteriBase(const Context *context,
ShaderProgramID program,
GLenum pname,
GLint value);
} // namespace gl } // namespace gl
#endif // LIBANGLE_VALIDATION_ES3_H_ #endif // LIBANGLE_VALIDATION_ES3_H_
...@@ -49,6 +49,24 @@ TEST_P(ProgramPipelineTest, GenerateProgramPipelineObject) ...@@ -49,6 +49,24 @@ TEST_P(ProgramPipelineTest, GenerateProgramPipelineObject)
} }
} }
// Verify that program pipeline errors out without GL_EXT_separate_shader_objects extension.
TEST_P(ProgramPipelineTest, GenerateProgramPipelineObjectEXT)
{
GLuint pipeline;
glGenProgramPipelinesEXT(1, &pipeline);
if (!IsGLExtensionEnabled("GL_EXT_separate_shader_objects"))
{
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
}
else
{
EXPECT_GL_NO_ERROR();
glDeleteProgramPipelinesEXT(1, &pipeline);
EXPECT_GL_NO_ERROR();
}
}
class ProgramPipelineTest31 : public ProgramPipelineTest class ProgramPipelineTest31 : public ProgramPipelineTest
{ {
protected: protected:
......
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