Commit 82af620e by jchen10 Committed by Commit Bot

ParallelCompile: Add entry points.

Add the extension text, entry points and validations. BUG=chromium:849576 TEST=angle_end2end_tests Change-Id: I4c06ee30e4f4fe9bb1c1fecada747b9c78fed0ea Reviewed-on: https://chromium-review.googlesource.com/1103789Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
parent 943a38a5
Name
KHR_parallel_shader_compile
Name Strings
GL_KHR_parallel_shader_compile
Contact
Geoff Lang, (geofflang 'at' google.com)
Contributors
Timothy Lottes, AMD
Graham Sellers, AMD
Eric Werness, NVIDIA
Geoff Lang, Google
Daniel Koch, NVIDIA
Notice
Copyright (c) 2015 The Khronos Group Inc. Copyright terms at
http://www.khronos.org/registry/speccopyright.html
Status
Complete
Version
Last Modified Date: 2017-04-24
Revision: 2
Number
ARB Extension #192
OpenGL ES Extension #288
Dependencies
This extension is written against OpenGL 4.5 (CoreProfile) dated
May 28 2015.
OpenGL ES 2.0 is required (for mobile).
Overview
Compiling GLSL into implementation-specific code can be a time consuming
process, so a GL implementation may wish to perform the compilation in a
separate CPU thread. This extension provides a mechanism for the application
to provide a hint to limit the number of threads it wants to be used to
compile shaders, as well as a query to determine if the compilation process
is complete.
New Procedures and Functions
void MaxShaderCompilerThreadsKHR(uint count);
New Tokens
Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
GetInteger64v, GetFloatv, and GetDoublev:
MAX_SHADER_COMPILER_THREADS_KHR 0x91B0
Accepted as part of the <pname> parameter to GetShaderiv and
accepted as part of the <pname> parameter to GetProgramiv:
COMPLETION_STATUS_KHR 0x91B1
IP Status
None.
Additions to Chapter 7 "Programs and Shaders",
Append to the end of 7.1 "Shader Objects",
Applications may use the following to hint to the driver the maximum
number background threads it would like to be used in the process of
compiling shaders or linking programs,
void MaxShaderCompilerThreadsKHR(uint count);
where <count> is the number of background threads. A <count> of zero
specifies a request for no parallel compiling or linking and a <count> of
0xFFFFFFFF requests an implementation-specific maximum.
An implementation may combine the maximum compiler thread request from
multiple contexts in a share group in an implementation-specific way.
An application can query the current MaxShaderCompilerThreadsKHR <count>
by calling GetIntegerv with <pname> set to MAX_SHADER_COMPILER_THREADS_KHR,
which returns the value of the current state (Table 23.51).
Add to 7.13 "Shader, Program, and Program Pipeline Queries" under the
descriptions for "pname" for "GetShaderiv",
If <pname> is COMPLETION_STATUS_KHR, TRUE is returned if the shader
compilation has completed, FALSE otherwise.
Add to 7.13 "Shader, Program, and Program Pipeline Queries" under the
descriptions for "pname" for "GetProgramiv",
If <pname> is COMPLETION_STATUS_KHR, TRUE is returned if the program
linking has completed, FALSE otherwise.
New State
Add to Table 23.51: Hints
Get Value Type Get Command Initial Value Description Sec
------------------------------- ---- ------------ ------------- -------------------- ----
MAX_SHADER_COMPILER_THREADS_KHR Z+ GetIntegerv 0xFFFFFFFF Max compile threads 7.13
Add to Table 23.32: Program Object State
Get Value Type Get Command Initial Value Description Sec
---------------------- ---- ------------ ------------- -------------------- ----
COMPLETION_STATUS_KHR B GetProgramiv TRUE Program linking has 7.13
completed
Add to Table 23.30: Shader Object State
Get Value Type Get Command Initial Value Description Sec
--------------------- ---- ------------ ------------- -------------------- ----
COMPLETION_STATUS_KHR B GetShaderiv TRUE Shader compilation 7.13
has completed
Interactions with OpenGL ES
If implemented in OpenGL ES ignore all references to GetDoublev.
If the supported ES version is less than 3.0, ignore all references to
GetInteger64v.
Issues
1) Where should the hint state be stored?
UNRESOLVED: Each context has its own value which may be specified and
queried, but an implementation may choose to combine the hints from multiple
contexts in an implementation-specific manner. There isn't really any
precedent for per-share group state.
2) Can we make the requirements more strict?
RESOLVED: We could, but making sure all of the error behavior is correct and
fully specified would likely take more time than we have. This spec allows
an application to clearly request its intent even if there aren't guarantees
that the implementation will exactly obey the request.
3) Does glGetIntegerv(MAX_SHADER_COMPILER_THREADS_KHR) just return the
value set by MaxShaderCompilerThreadsKHR? Or, if the state is 0xFFFFFFFF
("do something implementation specific"), does it return the number of
threads the implementation has actually chosen to use?
RESOLVED: As with other state queries, this returns the value that was last
set, or if no value was set by the application it returns the default state
value (0xFFFFFFFF).
Revision History
Rev Date Author Changes
--- ---------- -------- ---------------------------------------------
1 2017-03-23 glang Cast as KHR based on v6 of
ARB_parallel_shader_compile.
2 2017-04-24 dgkoch Spec clarifications, add issue 3.
...@@ -194,6 +194,7 @@ typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTCONTEXTANGLE)(GLeglContext ctx, G ...@@ -194,6 +194,7 @@ typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTCONTEXTANGLE)(GLeglContext ctx, G
typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESCONTEXTANGLE)(GLeglContext ctx, GLuint array); typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESCONTEXTANGLE)(GLeglContext ctx, GLuint array);
typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESCONTEXTANGLE)(GLeglContext ctx, GLenum target, GLenum access); typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESCONTEXTANGLE)(GLeglContext ctx, GLenum target, GLenum access);
typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTCONTEXTANGLE)(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTCONTEXTANGLE)(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
typedef void (GL_APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRCONTEXTANGLE)(GLeglContext ctx, GLuint count);
typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRCONTEXTANGLE)(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei length, const GLchar *label); typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRCONTEXTANGLE)(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRCONTEXTANGLE)(GLeglContext ctx, const void *ptr, GLsizei length, const GLchar *label); typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRCONTEXTANGLE)(GLeglContext ctx, const void *ptr, GLsizei length, const GLchar *label);
typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRCONTEXTANGLE)(GLeglContext ctx); typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRCONTEXTANGLE)(GLeglContext ctx);
...@@ -495,6 +496,7 @@ GL_APICALL GLboolean GL_APIENTRY glIsQueryEXTContextANGLE(GLeglContext ctx, GLui ...@@ -495,6 +496,7 @@ GL_APICALL GLboolean GL_APIENTRY glIsQueryEXTContextANGLE(GLeglContext ctx, GLui
GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOESContextANGLE(GLeglContext ctx, GLuint array); GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOESContextANGLE(GLeglContext ctx, GLuint array);
GL_APICALL void *GL_APIENTRY glMapBufferOESContextANGLE(GLeglContext ctx, GLenum target, GLenum access); GL_APICALL void *GL_APIENTRY glMapBufferOESContextANGLE(GLeglContext ctx, GLenum target, GLenum access);
GL_APICALL void *GL_APIENTRY glMapBufferRangeEXTContextANGLE(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); GL_APICALL void *GL_APIENTRY glMapBufferRangeEXTContextANGLE(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
GL_APICALL void GL_APIENTRY glMaxShaderCompilerThreadsKHRContextANGLE(GLeglContext ctx, GLuint count);
GL_APICALL void GL_APIENTRY glObjectLabelKHRContextANGLE(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei length, const GLchar *label); GL_APICALL void GL_APIENTRY glObjectLabelKHRContextANGLE(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
GL_APICALL void GL_APIENTRY glObjectPtrLabelKHRContextANGLE(GLeglContext ctx, const void *ptr, GLsizei length, const GLchar *label); GL_APICALL void GL_APIENTRY glObjectPtrLabelKHRContextANGLE(GLeglContext ctx, const void *ptr, GLsizei length, const GLchar *label);
GL_APICALL void GL_APIENTRY glPopDebugGroupKHRContextANGLE(GLeglContext ctx); GL_APICALL void GL_APIENTRY glPopDebugGroupKHRContextANGLE(GLeglContext ctx);
......
...@@ -68,6 +68,7 @@ supported_extensions = sorted(angle_extensions + gles1_extensions + [ ...@@ -68,6 +68,7 @@ supported_extensions = sorted(angle_extensions + gles1_extensions + [
"GL_OES_get_program_binary", "GL_OES_get_program_binary",
"GL_OES_mapbuffer", "GL_OES_mapbuffer",
"GL_OES_vertex_array_object", "GL_OES_vertex_array_object",
"GL_KHR_parallel_shader_compile",
]) ])
# The EGL_ANGLE_explicit_context extension is generated differently from other extensions. # The EGL_ANGLE_explicit_context extension is generated differently from other extensions.
...@@ -886,4 +887,4 @@ source_includes = """ ...@@ -886,4 +887,4 @@ source_includes = """
#include "common/event_tracer.h" #include "common/event_tracer.h"
""" """
write_export_files("\n".join([item for item in libgles_ep_defs]), source_includes, "\n".join([item for item in libgles_ep_exports])) write_export_files("\n".join([item for item in libgles_ep_defs]), source_includes, "\n".join([item for item in libgles_ep_exports]))
\ No newline at end of file
...@@ -247,7 +247,8 @@ Extensions::Extensions() ...@@ -247,7 +247,8 @@ Extensions::Extensions()
textureCubeMap(false), textureCubeMap(false),
pointSprite(false), pointSprite(false),
explicitContextGles1(false), explicitContextGles1(false),
explicitContext(false) explicitContext(false),
parallelShaderCompile(false)
{ {
} }
...@@ -851,6 +852,7 @@ const ExtensionInfoMap &GetExtensionInfoMap() ...@@ -851,6 +852,7 @@ const ExtensionInfoMap &GetExtensionInfoMap()
map["GL_EXT_geometry_shader"] = enableableExtension(&Extensions::geometryShader); map["GL_EXT_geometry_shader"] = enableableExtension(&Extensions::geometryShader);
map["GL_ANGLE_explicit_context_gles1"] = enableableExtension(&Extensions::explicitContextGles1); map["GL_ANGLE_explicit_context_gles1"] = enableableExtension(&Extensions::explicitContextGles1);
map["GL_ANGLE_explicit_context"] = enableableExtension(&Extensions::explicitContext); map["GL_ANGLE_explicit_context"] = enableableExtension(&Extensions::explicitContext);
map["GL_KHR_parallel_shader_compile"] = enableableExtension(&Extensions::parallelShaderCompile);
// GLES1 extensinos // GLES1 extensinos
map["GL_OES_point_size_array"] = enableableExtension(&Extensions::pointSizeArray); map["GL_OES_point_size_array"] = enableableExtension(&Extensions::pointSizeArray);
map["GL_OES_texture_cube_map"] = enableableExtension(&Extensions::textureCubeMap); map["GL_OES_texture_cube_map"] = enableableExtension(&Extensions::textureCubeMap);
......
...@@ -421,6 +421,9 @@ struct Extensions ...@@ -421,6 +421,9 @@ struct Extensions
bool explicitContextGles1; bool explicitContextGles1;
// GL_ANGLE_explicit_context // GL_ANGLE_explicit_context
bool explicitContext; bool explicitContext;
// GL_KHR_parallel_shader_compile
bool parallelShaderCompile;
}; };
struct ExtensionInfo struct ExtensionInfo
......
...@@ -1737,6 +1737,11 @@ void Context::getIntegervImpl(GLenum pname, GLint *params) ...@@ -1737,6 +1737,11 @@ void Context::getIntegervImpl(GLenum pname, GLint *params)
GL_VERTEX_ATTRIB_ARRAY_TYPE, params); GL_VERTEX_ATTRIB_ARRAY_TYPE, params);
break; break;
// GL_KHR_parallel_shader_compile
case GL_MAX_SHADER_COMPILER_THREADS_KHR:
*params = mGLState.getMaxShaderCompilerThreads();
break;
default: default:
handleError(mGLState.getIntegerv(this, pname, params)); handleError(mGLState.getIntegerv(this, pname, params));
break; break;
...@@ -3050,12 +3055,16 @@ Extensions Context::generateSupportedExtensions() const ...@@ -3050,12 +3055,16 @@ Extensions Context::generateSupportedExtensions() const
{ {
Extensions supportedExtensions = mImplementation->getNativeExtensions(); Extensions supportedExtensions = mImplementation->getNativeExtensions();
// Explicitly enable GL_KHR_parallel_shader_compile
supportedExtensions.parallelShaderCompile = true;
if (getClientVersion() < ES_2_0) if (getClientVersion() < ES_2_0)
{ {
// Default extensions for GLES1 // Default extensions for GLES1
supportedExtensions.pointSizeArray = true; supportedExtensions.pointSizeArray = true;
supportedExtensions.textureCubeMap = true; supportedExtensions.textureCubeMap = true;
supportedExtensions.pointSprite = true; supportedExtensions.pointSprite = true;
supportedExtensions.parallelShaderCompile = false;
} }
if (getClientVersion() < ES_3_0) if (getClientVersion() < ES_3_0)
...@@ -6988,6 +6997,13 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu ...@@ -6988,6 +6997,13 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu
return true; return true;
} }
if (getExtensions().parallelShaderCompile && pname == GL_MAX_SHADER_COMPILER_THREADS_KHR)
{
*type = GL_INT;
*numParams = 1;
return true;
}
// Check for ES3.0+ parameter names which are also exposed as ES2 extensions // Check for ES3.0+ parameter names which are also exposed as ES2 extensions
switch (pname) switch (pname)
{ {
...@@ -7475,4 +7491,9 @@ GLenum Context::getConvertedRenderbufferFormat(GLenum internalformat) const ...@@ -7475,4 +7491,9 @@ GLenum Context::getConvertedRenderbufferFormat(GLenum internalformat) const
: internalformat; : internalformat;
} }
void Context::maxShaderCompilerThreads(GLuint count)
{
mGLState.setMaxShaderCompilerThreads(count);
}
} // namespace gl } // namespace gl
...@@ -1469,6 +1469,9 @@ class Context final : public egl::LabeledObject, angle::NonCopyable ...@@ -1469,6 +1469,9 @@ class Context final : public egl::LabeledObject, angle::NonCopyable
static int TexCoordArrayIndex(unsigned int unit); static int TexCoordArrayIndex(unsigned int unit);
AttributesMask getVertexArraysAttributeMask() const; AttributesMask getVertexArraysAttributeMask() const;
// GL_KHR_parallel_shader_compile
void maxShaderCompilerThreads(GLuint count);
private: private:
void initialize(); void initialize();
......
...@@ -110,7 +110,8 @@ State::State(bool debug, ...@@ -110,7 +110,8 @@ State::State(bool debug,
mSampleAlphaToOne(false), mSampleAlphaToOne(false),
mFramebufferSRGB(true), mFramebufferSRGB(true),
mRobustResourceInit(robustResourceInit), mRobustResourceInit(robustResourceInit),
mProgramBinaryCacheEnabled(programBinaryCacheEnabled) mProgramBinaryCacheEnabled(programBinaryCacheEnabled),
mMaxShaderCompilerThreads(std::numeric_limits<GLuint>::max())
{ {
} }
...@@ -1854,6 +1855,16 @@ bool State::getFramebufferSRGB() const ...@@ -1854,6 +1855,16 @@ bool State::getFramebufferSRGB() const
return mFramebufferSRGB; return mFramebufferSRGB;
} }
void State::setMaxShaderCompilerThreads(GLuint count)
{
mMaxShaderCompilerThreads = count;
}
GLuint State::getMaxShaderCompilerThreads() const
{
return mMaxShaderCompilerThreads;
}
void State::getBooleanv(GLenum pname, GLboolean *params) void State::getBooleanv(GLenum pname, GLboolean *params)
{ {
switch (pname) switch (pname)
......
...@@ -336,6 +336,10 @@ class State : public angle::ObserverInterface, angle::NonCopyable ...@@ -336,6 +336,10 @@ class State : public angle::ObserverInterface, angle::NonCopyable
void setFramebufferSRGB(bool sRGB); void setFramebufferSRGB(bool sRGB);
bool getFramebufferSRGB() const; bool getFramebufferSRGB() const;
// GL_KHR_parallel_shader_compile
void setMaxShaderCompilerThreads(GLuint count);
GLuint getMaxShaderCompilerThreads() const;
// State query functions // State query functions
void getBooleanv(GLenum pname, GLboolean *params); void getBooleanv(GLenum pname, GLboolean *params);
void getFloatv(GLenum pname, GLfloat *params); void getFloatv(GLenum pname, GLfloat *params);
...@@ -611,6 +615,9 @@ class State : public angle::ObserverInterface, angle::NonCopyable ...@@ -611,6 +615,9 @@ class State : public angle::ObserverInterface, angle::NonCopyable
// GL_ANGLE_program_cache_control // GL_ANGLE_program_cache_control
const bool mProgramBinaryCacheEnabled; const bool mProgramBinaryCacheEnabled;
// GL_KHR_parallel_shader_compile
GLuint mMaxShaderCompilerThreads;
// GLES1 emulation: state specific to GLES1 // GLES1 emulation: state specific to GLES1
GLES1State mGLES1State; GLES1State mGLES1State;
......
...@@ -388,6 +388,7 @@ enum class EntryPoint ...@@ -388,6 +388,7 @@ enum class EntryPoint
MatrixLoadIdentityCHROMIUM, MatrixLoadIdentityCHROMIUM,
MatrixLoadfCHROMIUM, MatrixLoadfCHROMIUM,
MatrixMode, MatrixMode,
MaxShaderCompilerThreadsKHR,
MemoryBarrier, MemoryBarrier,
MemoryBarrierByRegion, MemoryBarrierByRegion,
MultMatrixf, MultMatrixf,
......
...@@ -6638,4 +6638,14 @@ bool ValidateTexStorage3DEXT(Context *context, ...@@ -6638,4 +6638,14 @@ bool ValidateTexStorage3DEXT(Context *context,
depth); depth);
} }
bool ValidateMaxShaderCompilerThreadsKHR(Context *context, GLuint count)
{
if (!context->getExtensions().parallelShaderCompile)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), ExtensionNotEnabled);
return false;
}
return true;
}
} // namespace gl } // namespace gl
...@@ -717,6 +717,7 @@ bool ValidateTexStorage3DEXT(Context *context, ...@@ -717,6 +717,7 @@ bool ValidateTexStorage3DEXT(Context *context,
GLsizei width, GLsizei width,
GLsizei height, GLsizei height,
GLsizei depth); GLsizei depth);
bool ValidateMaxShaderCompilerThreadsKHR(Context *context, GLuint count);
} // namespace gl } // namespace gl
......
...@@ -3407,6 +3407,23 @@ void GL_APIENTRY PushDebugGroupKHR(GLenum source, GLuint id, GLsizei length, con ...@@ -3407,6 +3407,23 @@ void GL_APIENTRY PushDebugGroupKHR(GLenum source, GLuint id, GLsizei length, con
} }
} }
// GL_KHR_parallel_shader_compile
void GL_APIENTRY MaxShaderCompilerThreadsKHR(GLuint count)
{
EVENT("(GLuint count = %u)", count);
Context *context = GetValidGlobalContext();
if (context)
{
context->gatherParams<EntryPoint::MaxShaderCompilerThreadsKHR>(count);
if (context->skipValidation() || ValidateMaxShaderCompilerThreadsKHR(context, count))
{
context->maxShaderCompilerThreads(count);
}
}
}
// GL_NV_fence // GL_NV_fence
void GL_APIENTRY DeleteFencesNV(GLsizei n, const GLuint *fences) void GL_APIENTRY DeleteFencesNV(GLsizei n, const GLuint *fences)
{ {
...@@ -10810,6 +10827,23 @@ void GL_APIENTRY MatrixModeContextANGLE(GLeglContext ctx, GLenum mode) ...@@ -10810,6 +10827,23 @@ void GL_APIENTRY MatrixModeContextANGLE(GLeglContext ctx, GLenum mode)
} }
} }
void GL_APIENTRY MaxShaderCompilerThreadsKHRContextANGLE(GLeglContext ctx, GLuint count)
{
EVENT("(GLuint count = %u)", count);
Context *context = static_cast<gl::Context *>(ctx);
if (context)
{
ASSERT(context == GetValidGlobalContext());
context->gatherParams<EntryPoint::MaxShaderCompilerThreadsKHR>(count);
if (context->skipValidation() || ValidateMaxShaderCompilerThreadsKHR(context, count))
{
context->maxShaderCompilerThreads(count);
}
}
}
void GL_APIENTRY MemoryBarrierContextANGLE(GLeglContext ctx, GLbitfield barriers) void GL_APIENTRY MemoryBarrierContextANGLE(GLeglContext ctx, GLbitfield barriers)
{ {
EVENT("(GLbitfield barriers = 0x%X)", barriers); EVENT("(GLbitfield barriers = 0x%X)", barriers);
......
...@@ -690,6 +690,9 @@ ANGLE_EXPORT void GL_APIENTRY PushDebugGroupKHR(GLenum source, ...@@ -690,6 +690,9 @@ ANGLE_EXPORT void GL_APIENTRY PushDebugGroupKHR(GLenum source,
GLsizei length, GLsizei length,
const GLchar *message); const GLchar *message);
// GL_KHR_parallel_shader_compile
ANGLE_EXPORT void GL_APIENTRY MaxShaderCompilerThreadsKHR(GLuint count);
// GL_NV_fence // GL_NV_fence
ANGLE_EXPORT void GL_APIENTRY DeleteFencesNV(GLsizei n, const GLuint *fences); ANGLE_EXPORT void GL_APIENTRY DeleteFencesNV(GLsizei n, const GLuint *fences);
ANGLE_EXPORT void GL_APIENTRY FinishFenceNV(GLuint fence); ANGLE_EXPORT void GL_APIENTRY FinishFenceNV(GLuint fence);
...@@ -1846,6 +1849,8 @@ ANGLE_EXPORT void GL_APIENTRY MatrixIndexPointerOESContextANGLE(GLeglContext ctx ...@@ -1846,6 +1849,8 @@ ANGLE_EXPORT void GL_APIENTRY MatrixIndexPointerOESContextANGLE(GLeglContext ctx
GLsizei stride, GLsizei stride,
const void *pointer); const void *pointer);
ANGLE_EXPORT void GL_APIENTRY MatrixModeContextANGLE(GLeglContext ctx, GLenum mode); ANGLE_EXPORT void GL_APIENTRY MatrixModeContextANGLE(GLeglContext ctx, GLenum mode);
ANGLE_EXPORT void GL_APIENTRY MaxShaderCompilerThreadsKHRContextANGLE(GLeglContext ctx,
GLuint count);
ANGLE_EXPORT void GL_APIENTRY MemoryBarrierContextANGLE(GLeglContext ctx, GLbitfield barriers); ANGLE_EXPORT void GL_APIENTRY MemoryBarrierContextANGLE(GLeglContext ctx, GLbitfield barriers);
ANGLE_EXPORT void GL_APIENTRY MemoryBarrierByRegionContextANGLE(GLeglContext ctx, ANGLE_EXPORT void GL_APIENTRY MemoryBarrierByRegionContextANGLE(GLeglContext ctx,
GLbitfield barriers); GLbitfield barriers);
......
...@@ -3647,6 +3647,12 @@ void GL_APIENTRY glPushDebugGroupKHR(GLenum source, ...@@ -3647,6 +3647,12 @@ void GL_APIENTRY glPushDebugGroupKHR(GLenum source,
return gl::PushDebugGroupKHR(source, id, length, message); return gl::PushDebugGroupKHR(source, id, length, message);
} }
// GL_KHR_parallel_shader_compile
void GL_APIENTRY glMaxShaderCompilerThreadsKHR(GLuint count)
{
return gl::MaxShaderCompilerThreadsKHR(count);
}
// GL_NV_fence // GL_NV_fence
void GL_APIENTRY glDeleteFencesNV(GLsizei n, const GLuint *fences) void GL_APIENTRY glDeleteFencesNV(GLsizei n, const GLuint *fences)
{ {
...@@ -6137,6 +6143,11 @@ void GL_APIENTRY glMatrixModeContextANGLE(GLeglContext ctx, GLenum mode) ...@@ -6137,6 +6143,11 @@ void GL_APIENTRY glMatrixModeContextANGLE(GLeglContext ctx, GLenum mode)
return gl::MatrixModeContextANGLE(ctx, mode); return gl::MatrixModeContextANGLE(ctx, mode);
} }
void GL_APIENTRY glMaxShaderCompilerThreadsKHRContextANGLE(GLeglContext ctx, GLuint count)
{
return gl::MaxShaderCompilerThreadsKHRContextANGLE(ctx, count);
}
void GL_APIENTRY glMemoryBarrierContextANGLE(GLeglContext ctx, GLbitfield barriers) void GL_APIENTRY glMemoryBarrierContextANGLE(GLeglContext ctx, GLbitfield barriers)
{ {
return gl::MemoryBarrierContextANGLE(ctx, barriers); return gl::MemoryBarrierContextANGLE(ctx, barriers);
......
...@@ -526,6 +526,10 @@ ...@@ -526,6 +526,10 @@
"glFramebufferTextureMultiviewSideBySideANGLE" "glFramebufferTextureMultiviewSideBySideANGLE"
], ],
"GL_KHR_parallel_shader_compile": [
"glMaxShaderCompilerThreadsKHR"
],
"GLES3 core": [ "GLES3 core": [
"glReadBuffer", "glReadBuffer",
"glDrawRangeElements", "glDrawRangeElements",
......
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
'<(angle_path)/src/tests/gl_tests/ProvokingVertexTest.cpp', '<(angle_path)/src/tests/gl_tests/ProvokingVertexTest.cpp',
'<(angle_path)/src/tests/gl_tests/ObjectAllocationTest.cpp', '<(angle_path)/src/tests/gl_tests/ObjectAllocationTest.cpp',
'<(angle_path)/src/tests/gl_tests/OcclusionQueriesTest.cpp', '<(angle_path)/src/tests/gl_tests/OcclusionQueriesTest.cpp',
'<(angle_path)/src/tests/gl_tests/ParallelShaderCompileTest.cpp',
'<(angle_path)/src/tests/gl_tests/ProgramBinaryTest.cpp', '<(angle_path)/src/tests/gl_tests/ProgramBinaryTest.cpp',
'<(angle_path)/src/tests/gl_tests/ProgramInterfaceTest.cpp', '<(angle_path)/src/tests/gl_tests/ProgramInterfaceTest.cpp',
'<(angle_path)/src/tests/gl_tests/ProgramParameterTest.cpp', '<(angle_path)/src/tests/gl_tests/ProgramParameterTest.cpp',
......
//
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// ParallelShaderCompileTest.cpp : Tests of the GL_KHR_parallel_shader_compile extension.
#include "test_utils/ANGLETest.h"
using namespace angle;
namespace
{
class ParallelShaderCompileTest : public ANGLETest
{
protected:
ParallelShaderCompileTest()
{
setWindowWidth(128);
setWindowHeight(128);
setConfigRedBits(8);
setConfigGreenBits(8);
setConfigBlueBits(8);
setConfigAlphaBits(8);
}
void SetUp() override { ANGLETest::SetUp(); }
void TearDown() override { ANGLETest::TearDown(); }
bool ensureParallelShaderCompileExtensionAvailable()
{
if (extensionRequestable("GL_KHR_parallel_shader_compile"))
{
glRequestExtensionANGLE("GL_KHR_parallel_shader_compile");
}
if (!extensionEnabled("GL_KHR_parallel_shader_compile"))
{
return false;
}
return true;
}
};
// Test basic functionality of GL_KHR_parallel_shader_compile
TEST_P(ParallelShaderCompileTest, Basic)
{
ANGLE_SKIP_TEST_IF(!ensureParallelShaderCompileExtensionAvailable());
GLint count = 0;
glMaxShaderCompilerThreadsKHR(8);
EXPECT_GL_NO_ERROR();
glGetIntegerv(GL_MAX_SHADER_COMPILER_THREADS_KHR, &count);
EXPECT_GL_NO_ERROR();
EXPECT_EQ(8, count);
}
ANGLE_INSTANTIATE_TEST(ParallelShaderCompileTest,
ES2_D3D9(),
ES2_D3D11(),
ES2_D3D11_FL9_3(),
ES2_OPENGL(),
ES2_OPENGLES(),
ES2_VULKAN());
} // namespace
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