Skip to content

Commit fd05f5d

Browse files
committed
Add the GLSL_EXT_opacity_micromap_ray_query_mode extension
1 parent 16306e1 commit fd05f5d

1 file changed

Lines changed: 99 additions & 0 deletions

File tree

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
Name
2+
3+
EXT_opacity_micromap_ray_query_mode
4+
5+
Name Strings
6+
7+
GL_EXT_opacity_micromap_ray_query_mode
8+
9+
Contact
10+
Wooyoung Kim (wooykim 'at' qti.qualcomm.com), Qualcomm
11+
12+
Contributors
13+
14+
Wooyoung Kim, Qualcomm
15+
Fred Saucedo, Qualcomm
16+
17+
Status
18+
19+
Draft
20+
21+
Version
22+
23+
Last Modified Date: 2026-01-08
24+
Revision: 1
25+
26+
Dependencies
27+
28+
This extension can be applied to OpenGL GLSL versions 4.60
29+
(#version 460) and higher.
30+
31+
This extension is written against revision 8 of the OpenGL Shading Language
32+
version 4.60, dated August 14, 2023.
33+
34+
This extension interacts with revision 43 of the GL_KHR_vulkan_glsl
35+
extension, dated October 25, 2017.
36+
37+
This extension requires GL_EXT_ray_query as well as GL_EXT_opacity_micromap.
38+
39+
Overview
40+
41+
This extension document modifies GLSL to add a new built-in variable for opacity micromaps.
42+
43+
Mapping to SPIR-V
44+
-----------------
45+
46+
If a shader re-declares the built-in constant gl_EnableOpacityMicromapEXT
47+
with a specialization constant layout qualifier, the generated SPIRV must
48+
contain the "SPV_KHR_opacity_micromap" OpExtension string.
49+
50+
For informational purposes (non-normative), the following is an
51+
expected way for an implementation to map the GLSL built-in constant
52+
gl_EnableOpacityMicromapEXT to SPIR-V constructs:
53+
54+
gl_EnableOpacityMicromapEXT -> OpacityMicromapIdKHR
55+
56+
57+
If it has a specialization constant layout qualifier with 2 as its location
58+
59+
layout(constant_id = 2) gl_EnableOpacityMicromapEXT;
60+
61+
->
62+
63+
OpExecutionModeId %main OpacityMicromapIdKHR %7
64+
...
65+
OpDecorate %7 SpecId 2
66+
...
67+
%7 = OpSpecConstantFalse
68+
69+
70+
Modifications to the OpenGL Shading Language Specification, Version 4.60
71+
72+
Including the following line in a shader can be used to control the
73+
language features described in this extension:
74+
75+
#extension GL_EXT_opacity_micromap_ray_query_mode : <behavior>
76+
77+
where <behavior> is as specified in section 3.3.
78+
New preprocessor #defines are added:
79+
80+
#define GL_EXT_opacity_micromap_ray_query_mode 1
81+
82+
83+
Modify 7.3. Built-In Constants, add the following at the end
84+
85+
In addition, the following built-in constant is declared in all shaders.
86+
87+
const bool gl_EnableOpacityMicromapEXT = false;
88+
89+
To use opacity micromaps with ray query, declare the built-in constant to be a
90+
specialization constant and set it to true using the API or other tools.
91+
92+
Issues
93+
94+
95+
Revision History
96+
97+
Rev. Date Author Changes
98+
---- ----------- ------ -------------------------------------------
99+
1 2026-01-08 Wooyoung Kim Initial revision

0 commit comments

Comments
 (0)