15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    EXT_texture_shadow_lod
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_EXT_texture_shadow_lod
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Billy Clack, NVIDIA Corporation (bclack 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Ashwin Lele, NVIDIA Corporation 
165bd8deadSopenharmony_ci    Daniel Koch, NVIDIA Corporation 
175bd8deadSopenharmony_ci    Graeme Leese, Broadcom Corporation
185bd8deadSopenharmony_ci    Pyarelal Knowles, NVIDIA Corporation 
195bd8deadSopenharmony_ci    Sagar Ghuge, Intel Corporation
205bd8deadSopenharmony_ci    Mark Janes, Intel Corporation
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciStatus
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    Complete.
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciVersion
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    Last Modified Date: June 3, 2019
295bd8deadSopenharmony_ci    Revision:   2
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ciNumber
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    OpenGL Extension #539
345bd8deadSopenharmony_ci    OpenGL ES Extension #320
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ciDependencies
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci    OpenGL 2.0 or OpenGL ES 3.0 is required.
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    This extension is written against the OpenGL Shading Language
415bd8deadSopenharmony_ci    Specification, version 4.60.5 dated July 14, 2018.
425bd8deadSopenharmony_ci    
435bd8deadSopenharmony_ci    The same shading language modifications should also be applied to the
445bd8deadSopenharmony_ci    OpenGL ES Shading Language Specification, version 3.20.4 under the
455bd8deadSopenharmony_ci    corresponding sections.
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    This extension interacts with ARB_texture_cube_map_array and OpenGL 4.0.
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    This extension interacts with OES_texture_cube_map_array and OpenGL ES 3.2.
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci    This extension interacts with EXT_texture_cube_map_array and OpenGL ES 3.2.
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    This extension requires EXT_gpu_shader4 or equivalent functionality.
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ciOverview
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    This extension adds support for various shadow sampler types with texture
585bd8deadSopenharmony_ci    functions having interactions with the LOD of texture lookups.  Modern
595bd8deadSopenharmony_ci    shading languages support LOD queries for shadow sampler types, but until
605bd8deadSopenharmony_ci    now the OpenGL Shading Language Specification has excluded multiple texture
615bd8deadSopenharmony_ci    function overloads involving LOD calculations with various shadow samplers.
625bd8deadSopenharmony_ci    Shading languages for other APIs do support the equivalent LOD-based
635bd8deadSopenharmony_ci    texture sampling functions for these types which has made porting between
645bd8deadSopenharmony_ci    those shading languages to GLSL cumbersome and has required the usage of
655bd8deadSopenharmony_ci    sub-optimal workarounds.
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ciNew Procedures and Functions
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    None
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ciNew Tokens
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    None
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ciModification to the OpenGL Shading Language Specification, Version 4.60.5
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci    Including the following line in a shader can be used to control
785bd8deadSopenharmony_ci    the language features described in this extension:
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci      #extension GL_EXT_texture_shadow_lod : <behavior>
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci    where <behavior> is specified in section 3.3.
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ci    New preprocessor #defines are added to the OpenGL Shading Language:
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci      #define GL_EXT_texture_shadow_lod         1
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    Add to section 8.9.2 "Texel Lookup Functions" (p. 170):
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    (Add variants of the texture lookup functions with supplied bias p. 170)
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ci    float texture(sampler2DArrayShadow sampler, vec4 P [, float bias])
945bd8deadSopenharmony_ci    float texture(samplerCubeArrayShadow sampler, vec4 P, float compare [, float bias])
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci
975bd8deadSopenharmony_ci    (Add variant of the texture lookup function with supplied offset and optional supplied bias p. 170)
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci    float textureOffset(sampler2DArrayShadow sampler, vec4 P, ivec2 offset [, float bias])
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci    (Add new functions to the set of allowed texture LOD lookup functions p. 170)
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci    float textureLod(sampler2DArrayShadow sampler, vec4 P, float lod)
1055bd8deadSopenharmony_ci    float textureLod(samplerCubeShadow sampler, vec4 P, float lod)
1065bd8deadSopenharmony_ci    float textureLod(samplerCubeArrayShadow sampler, vec4 P, float compare, float lod)
1075bd8deadSopenharmony_ci    float textureLodOffset(sampler2DArrayShadow sampler, vec4 P, float lod, ivec2 offset)
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ciDependencies on ARB_texture_cube_map_array and OpenGL 4.0
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci    If neither ARB_texture_cube_map_array nor OpenGL 4.0 are supported for
1125bd8deadSopenharmony_ci    OpenGL contexts, ignore references to samplerCubeArrayShadow.
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ciDependencies on OES_texture_cube_map_array, EXT_texture_cube_map_array and OpenGL ES 3.2
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci    If neither OES_texture_cube_map_array, EXT_texture_cube_map_array, nor OpenGL ES 3.2 are supported for
1175bd8deadSopenharmony_ci    OpenGL ES contexts, ignore references to samplerCubeArrayShadow.
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ciIssues
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    (1)  Are there any other texture function and sampler combinations that are
1225bd8deadSopenharmony_ci         missing from the specifications that might be valid combinations?
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci         RESOLVED: Yes, as of GLSL 4.60.5 and ESSL 3.20.4, there are other
1255bd8deadSopenharmony_ci         missing texture functions and sampler combinations that might be valid
1265bd8deadSopenharmony_ci         but this extension does not add support for.
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci         There is no support for Cube samplers and textureOffset family of
1295bd8deadSopenharmony_ci         functions, and no support for Array samplers with textureProj family
1305bd8deadSopenharmony_ci         of functions.  This extension does not add support for these functions
1315bd8deadSopenharmony_ci         since they are 1) not related to shadow samplers and thus outside the
1325bd8deadSopenharmony_ci         scope of this extension, 2) not yet clear if these combinations should
1335bd8deadSopenharmony_ci         be supported at all, and 3) if support should be added then each
1345bd8deadSopenharmony_ci         family of missing functions is deserving of its own extension.
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci         textureGrad() is missing support for samplerCubeArrayShadow in both
1375bd8deadSopenharmony_ci         the GLSL and ESSL specifications, and is also missing support for
1385bd8deadSopenharmony_ci         gsampler2DArray variants only in the ESSL specification.  The
1395bd8deadSopenharmony_ci         samplerCubeArrayShadow variant is not included in this extension
1405bd8deadSopenharmony_ci         because not all vendors can easily support the additional parameter
1415bd8deadSopenharmony_ci         beyond the gradients.  The missing gsampler2DArray variants in ESSL
1425bd8deadSopenharmony_ci         are not added because they are unrelated to shadow types and thus
1435bd8deadSopenharmony_ci         outside the scope of this extension.
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci    (2)  The GLSL specification already contains a definition for
1465bd8deadSopenharmony_ci         textureOffset() with sampler2DArrayShadow; does this mean only the optional
1475bd8deadSopenharmony_ci         bias variant of this function is needed?
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci         RESOLVED:  Yes for GLSL, but the ESSL specification does
1505bd8deadSopenharmony_ci         not have either the non-bias or bias variants of this function so both
1515bd8deadSopenharmony_ci         variants should be defined according to this extension.
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ciRevision History
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci    Revision 2
1565bd8deadSopenharmony_ci    - Minor correction on contributor name.
1575bd8deadSopenharmony_ci
1585bd8deadSopenharmony_ci    Revision 1
1595bd8deadSopenharmony_ci    - Initial version.
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci
162