-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish GLSL_ARM_shader_core_builtins
Change-Id: I33988b29010e274d0e5d906a17f3fed60b952486 Signed-off-by: Kevin Petit <kevin.petit@arm.com>
- Loading branch information
Showing
2 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
Name | ||
|
||
ARM_shader_core_builtins | ||
|
||
Name Strings | ||
|
||
GL_ARM_shader_core_builtins | ||
|
||
Contact | ||
|
||
Kevin Petit (kevin.petit 'at' arm.com), Arm | ||
|
||
Contributors | ||
|
||
Kevin Petit, Arm | ||
Christopher Gautier, Arm | ||
|
||
Status | ||
|
||
Complete | ||
|
||
Version | ||
|
||
Last Modified Date: 2022-07-20 | ||
Revision: 1 | ||
|
||
Number | ||
|
||
N/A | ||
|
||
Dependencies | ||
|
||
This extension can be applied to OpenGL GLSL versions 1.40 | ||
(#version 140) and higher. | ||
|
||
This extension can be applied to OpenGL ES ESSL versions 3.0 | ||
(#version 300) and higher. | ||
|
||
This extension is written against revision 7 of the OpenGL Shading Language | ||
version 4.50, dated May 9, 2017. | ||
|
||
This extension interacts with revision 36 of the GL_KHR_vulkan_glsl | ||
extension, dated February 13, 2017. | ||
|
||
Overview | ||
|
||
This extension adds builtin variables that enable shaders to query | ||
information about the cores and warps they are running on. | ||
|
||
Mapping to SPIR-V | ||
----------------- | ||
|
||
For informational purposes (non-specification), the following is an | ||
expected way for an implementation to map GLSL constructs to SPIR-V | ||
constructs: | ||
|
||
gl_CoreIDARM -> CoreIDARM decorated OpVariable | ||
gl_CoreCountARM -> CoreCountARM decorated OpVariable | ||
gl_CoreMaxIDARM -> CoreMaxIDARM decorated OpVariable | ||
gl_WarpIDARM -> WarpIDARM decorated OpVariable | ||
gl_WarpMaxIDARM -> WarpMaxIDARM decorated OpVariable | ||
|
||
Modifications to The OpenGL Shading Language Specification, Version 4.50 | ||
(Revision 7) | ||
|
||
Including the following line in a shader can be used to control the | ||
language features described in this extension: | ||
|
||
#extension GL_ARM_shader_core_builtins : <behavior> | ||
|
||
where <behavior> is as specified in section 3.3. | ||
|
||
New preprocessor #defines are added to the OpenGL Shading Language: | ||
|
||
#define GL_ARM_shader_core_builtins 1 | ||
|
||
Modify Section 7.1, Built-in Languages Variable, p. 122 | ||
|
||
(Add to the list of built-in variables for the compute, vertex, | ||
geometry, tessellation control, tessellation evaluation, fragment, | ||
ray generation, intersection, any-hit, closest-hit, miss, and callable | ||
shading languages) | ||
|
||
highp in uint gl_CoreIDARM; | ||
highp in uint gl_CoreCountARM; | ||
highp in uint gl_CoreMaxIDARM; | ||
highp in uint gl_WarpIDARM; | ||
highp in uint gl_WarpMaxIDARM; | ||
|
||
The variable gl_CoreIDARM holds the ID of the shader core the executing | ||
invocation is running on. | ||
This variable is in the range 0 to gl_CoreMaxIDARM. | ||
|
||
The variable gl_CoreCountARM holds the number of shader cores on the device. | ||
|
||
The variable gl_CoreMaxIDARM holds the max ID of any shader core on the | ||
device. | ||
|
||
The variable gl_WarpIDARM holds the warp ID of the executing invocation. | ||
This variable is in the range 0 to gl_MaxWarpIDARM. | ||
|
||
The variable gl_WarpMaxIDARM holds the max ID that can be assigned to a | ||
warp on the core the executing invocation is running on. | ||
|
||
Issues | ||
|
||
None. | ||
|
||
Revision History | ||
|
||
Rev. Date Author Changes | ||
---- ---------- -------- ----------------------------------------- | ||
1 2022-07-20 Kevin Petit Internal revisions. |