15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_parallel_shader_compile
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_parallel_shader_compile
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Timothy Lottes (timothy.lottes 'at' amd.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Timothy Lottes, AMD
165bd8deadSopenharmony_ci    Graham Sellers, AMD
175bd8deadSopenharmony_ci    Eric Werness, NVIDIA
185bd8deadSopenharmony_ci    Daniel Koch, NVIDIA
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ciNotice
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ci    Copyright (c) 2015 The Khronos Group Inc. Copyright terms at
235bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ciSpecification Update Policy
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
285bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
295bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
305bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
315bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
325bd8deadSopenharmony_ci    described in more detail at
335bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ciStatus
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    Complete. Approved by the ARB on June 26, 2015.
385bd8deadSopenharmony_ci    Ratified by the Khronos Board of Promoters on August 7, 2015.
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ciVersion
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ci    Last Modified Date: 2017-04-24
435bd8deadSopenharmony_ci    Revision: 7
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ciNumber
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    ARB Extension #179
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ciDependencies
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci    This extension is written against OpenGL 4.5 (CoreProfile) dated
525bd8deadSopenharmony_ci    May 28 2015.
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ciOverview
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci    Compiling GLSL into implementation-specific code can be a time consuming
575bd8deadSopenharmony_ci    process, so a GL implementation may wish to perform the compilation in a
585bd8deadSopenharmony_ci    separate CPU thread. This extension provides a mechanism for the application
595bd8deadSopenharmony_ci    to provide a hint to limit the number of threads it wants to be used to
605bd8deadSopenharmony_ci    compile shaders, as well as a query to determine if the compilation process
615bd8deadSopenharmony_ci    is complete.
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ciNew Procedures and Functions
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci    void MaxShaderCompilerThreadsARB(uint count);
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ciNew Tokens
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
705bd8deadSopenharmony_ci    GetInteger64v, GetFloatv, and GetDoublev:
715bd8deadSopenharmony_ci
725bd8deadSopenharmony_ci        MAX_SHADER_COMPILER_THREADS_ARB   0x91B0
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci    Accepted as part of the <pname> parameter to GetShaderiv and
755bd8deadSopenharmony_ci    accepted as part of the <pname> parameter to GetProgramiv:
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci        COMPLETION_STATUS_ARB             0x91B1
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ciIP Status
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci    None.
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ciAdditions to Chapter 7 "Programs and Shaders",
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci    Append to the end of 7.1 "Shader Objects",
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ci        Applications may use the following to hint to the driver the maximum
885bd8deadSopenharmony_ci    number background threads it would like to be used in the process of
895bd8deadSopenharmony_ci    compiling shaders or linking programs,
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci        void MaxShaderCompilerThreadsARB(uint count);
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ci    where <count> is the number of background threads. A <count> of zero
945bd8deadSopenharmony_ci    specifies a request for no parallel compiling or linking and a <count> of
955bd8deadSopenharmony_ci    0xFFFFFFFF requests an implementation-specific maximum.
965bd8deadSopenharmony_ci
975bd8deadSopenharmony_ci    An implementation may combine the maximum compiler thread request from
985bd8deadSopenharmony_ci    multiple contexts in a share group in an implementation-specific way.
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci    An application can query the current MaxShaderCompilerThreadsARB <count>
1015bd8deadSopenharmony_ci    by calling GetIntegerv with <pname> set to MAX_SHADER_COMPILER_THREADS_ARB,
1025bd8deadSopenharmony_ci    which returns the value of the current state (Table 23.51).
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci    Add to 7.13 "Shader, Program, and Program Pipeline Queries" under the
1065bd8deadSopenharmony_ci    descriptions for "pname" for "GetShaderiv",
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci        If <pname> is COMPLETION_STATUS_ARB, TRUE is returned if the shader
1095bd8deadSopenharmony_ci        compilation has completed, FALSE otherwise.
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci    Add to 7.13 "Shader, Program, and Program Pipeline Queries" under the
1125bd8deadSopenharmony_ci    descriptions for "pname" for "GetProgramiv",
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ci        If <pname> is COMPLETION_STATUS_ARB, TRUE is returned if the program
1155bd8deadSopenharmony_ci        linking has completed, FALSE otherwise.
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ciNew State
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci    Add to Table 23.51: Hints
1205bd8deadSopenharmony_ci    Get Value                        Type  Get Command   Initial Value  Description           Sec
1215bd8deadSopenharmony_ci    -------------------------------  ----  ------------  -------------  --------------------  ----
1225bd8deadSopenharmony_ci    MAX_SHADER_COMPILER_THREADS_ARB  Z+    GetIntegerv   0xFFFFFFFF     Max compile threads   7.13
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    Add to Table 23.32: Program Object State
1255bd8deadSopenharmony_ci    Get Value               Type  Get Command   Initial Value  Description           Sec
1265bd8deadSopenharmony_ci    ---------------------   ----  ------------  -------------  --------------------  ----
1275bd8deadSopenharmony_ci    COMPLETION_STATUS_ARB   B     GetProgramiv  TRUE           Program linking has   7.13
1285bd8deadSopenharmony_ci                                                               completed
1295bd8deadSopenharmony_ci
1305bd8deadSopenharmony_ci    Add to Table 23.30: Shader Object State
1315bd8deadSopenharmony_ci    Get Value               Type  Get Command   Initial Value  Description           Sec
1325bd8deadSopenharmony_ci    ---------------------   ----  ------------  -------------  --------------------  ----
1335bd8deadSopenharmony_ci    COMPLETION_STATUS_ARB   B     GetShaderiv   TRUE           Shader compilation    7.13
1345bd8deadSopenharmony_ci                                                               has completed
1355bd8deadSopenharmony_ciIssues
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci    1) Where should the hint state be stored?
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci    UNRESOLVED: Each context has its own value which may be specified and
1405bd8deadSopenharmony_ci    queried, but an implementation may choose to combine the hints from multiple
1415bd8deadSopenharmony_ci    contexts in an implmentation-specific manner. There isn't really any
1425bd8deadSopenharmony_ci    precedent for per-share group state.
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    2) Can we make the requirements more strict?
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci    RESOLVED: We could, but making sure all of the error behavior is correct and
1475bd8deadSopenharmony_ci    fully specified would likely take more time than we have. This spec allows
1485bd8deadSopenharmony_ci    an application to clearly request its intent even if there aren't guarantees
1495bd8deadSopenharmony_ci    that the implementation will exactly obey the request.
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci    3) Does glGetIntegerv(MAX_SHADER_COMPILER_THREADS_ARB) just return the
1525bd8deadSopenharmony_ci    value set by MaxShaderCompilerThreadsARB? Or, if the state is 0xFFFFFFFF
1535bd8deadSopenharmony_ci    ("do something implementation specific"), does it return the number of
1545bd8deadSopenharmony_ci    threads the implementation has actually chosen to use?
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci    RESOLVED: As with other state queries, this returns the value that was last
1575bd8deadSopenharmony_ci    set, or if no value was set by the application it returns the default state
1585bd8deadSopenharmony_ci    value (0xFFFFFFFF).
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ciRevision History
1615bd8deadSopenharmony_ci
1625bd8deadSopenharmony_ci    Rev  Date        Author    Changes
1635bd8deadSopenharmony_ci    ---  ----------  --------  ---------------------------------------------
1645bd8deadSopenharmony_ci      1  2015-03-22  tlottes   Initial revision
1655bd8deadSopenharmony_ci      2  2015-03-23  tlottes   Added way to get MAX_SHADER_COMPILER_THREADS
1665bd8deadSopenharmony_ci      3  2015-04-20  tlottes   Updated tokens and functions
1675bd8deadSopenharmony_ci      4  2015-06-18  tlottes   Added New State, noted per context, issues
1685bd8deadSopenharmony_ci      5  2016-06-23  ewerness  Clarify the spec is a hint, other language fixes
1695bd8deadSopenharmony_ci      6  2015-09-01  pdaniell  Fix the functions that can be used to query
1705bd8deadSopenharmony_ci                               MAX_SHADER_COMPILER_THREADS_ARB.
1715bd8deadSopenharmony_ci      7  2017-04-24  dgkoch    Spec clarifications, add issue 3.
172