Skip to content

Commit 29b7ecb

Browse files
committed
Apply changes
1 parent 474757f commit 29b7ecb

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

include/nbl/builtin/glsl/subgroup/basic_portability.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
#define nbl_glsl_MinSubgroupSizeLog2 2
1818
#define nbl_glsl_MinSubgroupSize (0x1<<nbl_glsl_MinSubgroupSizeLog2)
1919

20-
#ifdef NBL_IMPL_GL_NV_shader_thread_group
20+
#ifdef NBL_GLSL_IMPL_GL_NV_shader_thread_group
2121
#define nbl_glsl_MaxSubgroupSizeLog2 5
22-
#elif defined(NBL_IMPL_GL_AMD_gcn_shader)||defined(NBL_IMPL_GL_ARB_shader_ballot)
22+
#elif defined(NBL_GLSL_IMPL_GL_AMD_gcn_shader)||defined(NBL_GLSL_IMPL_GL_ARB_shader_ballot)
2323
#define nbl_glsl_MaxSubgroupSizeLog2 6
2424
#else
2525
#define nbl_glsl_MaxSubgroupSizeLog2 7

include/nbl/video/SPhysicalDeviceLimits.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,9 @@ struct SPhysicalDeviceLimits
584584
bool postDepthCoverage = false; /* VK_EXT_post_depth_coverage */
585585
bool shaderStencilExport = false; /* VK_EXT_shader_stencil_export */
586586
bool decorateString = false; /* VK_GOOGLE_decorate_string */
587-
bool externalFence = false; /* VK_KHR_external_fence_fd */ /* VK_KHR_external_fence_win32 */
588-
bool externalMemory = false; /* VK_KHR_external_memory_fd */ /* VK_KHR_external_memory_win32 */
589-
bool externalSemaphore = false; /* VK_KHR_external_semaphore_fd */ /* VK_KHR_external_semaphore_win32 */
587+
bool externalFence = false; /* VK_KHR_external_fence_fd */ /* VK_KHR_external_fence_win32 */ // [TODO] requires instance extensions, add them
588+
bool externalMemory = false; /* VK_KHR_external_memory_fd */ /* VK_KHR_external_memory_win32 */ // [TODO] requires instance extensions, add them
589+
bool externalSemaphore = false; /* VK_KHR_external_semaphore_fd */ /* VK_KHR_external_semaphore_win32 */ // [TODO] requires instance extensions, add them
590590
bool shaderNonSemanticInfo = false; /* VK_KHR_shader_non_semantic_info */
591591
bool fragmentShaderBarycentric = false; /* VK_KHR_fragment_shader_barycentric */
592592
bool geometryShaderPassthrough = false; /* VK_NV_geometry_shader_passthrough */

src/nbl/video/COpenGLShader.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,36 @@ using namespace nbl::video;
1111
// TODO: deduce the following in COpenGLPhysicalDevice from the OpenGL extension presence, and then add the defines as standardy from IPhysicalDevice : addCommonGLSLDefines() instead
1212
// The subgroup stuff is a bit hard cause we made up "extra" extensions such as `NBL_GL_KHR_shader_subgroup_ballot_inverse_ballot_bit_count` (probably best to expose as extra features)
1313
const char* COpenGLShader::k_openGL2VulkanExtensionMap = R"(
14-
#ifdef NBL_IMPL_GL_AMD_gpu_shader_half_float
14+
#ifdef NBL_GLSL_IMPL_GL_AMD_gpu_shader_half_float
1515
#define NBL_GL_EXT_shader_explicit_arithmetic_types_float16
1616
#endif
1717
18-
#ifdef NBL_IMPL_GL_NV_gpu_shader5
18+
#ifdef NBL_GLSL_IMPL_GL_NV_gpu_shader5
1919
#define NBL_GL_EXT_shader_explicit_arithmetic_types_float16
2020
#define NBL_GL_EXT_nonuniform_qualifier
2121
#define NBL_GL_KHR_shader_subgroup_vote_subgroup_any_all_equal_bool
2222
#endif
2323
24-
#ifdef NBL_IMPL_GL_AMD_gpu_shader_int16
24+
#ifdef NBL_GLSL_IMPL_GL_AMD_gpu_shader_int16
2525
#define NBL_GL_EXT_shader_explicit_arithmetic_types_int16
2626
#endif
2727
28-
#ifdef NBL_IMPL_GL_AMD_shader_explicit_vertex_parameter
28+
#ifdef NBL_GLSL_IMPL_GL_AMD_shader_explicit_vertex_parameter
2929
#define NBL_GL_AMD_shader_explicit_vertex_parameter
3030
#endif
31-
#ifdef NBL_IMPL_GL_NV_fragment_shader_barycentric
31+
#ifdef NBL_GLSL_IMPL_GL_NV_fragment_shader_barycentric
3232
#define NBL_GL_NV_fragment_shader_barycentric
3333
#endif
3434
35-
#ifdef NBL_IMPL_GL_NV_shader_thread_group
35+
#ifdef NBL_GLSL_IMPL_GL_NV_shader_thread_group
3636
#define NBL_GL_KHR_shader_subgroup_ballot_subgroup_mask
3737
#define NBL_GL_KHR_shader_subgroup_basic_subgroup_size
3838
#define NBL_GL_KHR_shader_subgroup_basic_subgroup_invocation_id
3939
#define NBL_GL_KHR_shader_subgroup_ballot_subgroup_ballot
4040
#define NBL_GL_KHR_shader_subgroup_ballot_inverse_ballot_bit_count
4141
#endif
4242
43-
#if defined(NBL_IMPL_GL_ARB_shader_ballot) && defined(NBL_IMPL_GL_ARB_shader_int64)
43+
#if defined(NBL_GLSL_IMPL_GL_ARB_shader_ballot) && defined(NBL_GLSL_IMPL_GL_ARB_shader_int64)
4444
#define NBL_GL_KHR_shader_subgroup_ballot_subgroup_mask
4545
#define NBL_GL_KHR_shader_subgroup_basic_subgroup_size
4646
#define NBL_GL_KHR_shader_subgroup_basic_subgroup_invocation_id
@@ -49,16 +49,16 @@ const char* COpenGLShader::k_openGL2VulkanExtensionMap = R"(
4949
#define NBL_GL_KHR_shader_subgroup_ballot_inverse_ballot_bit_count
5050
#endif
5151
52-
#if defined(NBL_IMPL_GL_AMD_gcn_shader) && (defined(NBL_IMPL_GL_AMD_gpu_shader_int64) || defined(NBL_IMPL_GL_NV_gpu_shader5))
52+
#if defined(NBL_GLSL_IMPL_GL_AMD_gcn_shader) && (defined(NBL_GLSL_IMPL_GL_AMD_gpu_shader_int64) || defined(NBL_GLSL_IMPL_GL_NV_gpu_shader5))
5353
#define NBL_GL_KHR_shader_subgroup_basic_subgroup_size
5454
#define NBL_GL_KHR_shader_subgroup_vote_subgroup_any_all_equal_bool
5555
#endif
5656
57-
#ifdef NBL_IMPL_GL_NV_shader_thread_shuffle
57+
#ifdef NBL_GLSL_IMPL_GL_NV_shader_thread_shuffle
5858
#define NBL_GL_KHR_shader_subgroup_ballot_subgroup_broadcast_first
5959
#endif
6060
61-
#ifdef NBL_IMPL_GL_ARB_shader_group_vote
61+
#ifdef NBL_GLSL_IMPL_GL_ARB_shader_group_vote
6262
#define NBL_GL_KHR_shader_subgroup_vote_subgroup_any_all_equal_bool
6363
#endif
6464
@@ -81,20 +81,20 @@ const char* COpenGLShader::k_openGL2VulkanExtensionMap = R"(
8181
#endif
8282
8383
// the natural extensions
84-
#ifdef NBL_IMPL_GL_KHR_shader_subgroup_basic
84+
#ifdef NBL_GLSL_IMPL_GL_KHR_shader_subgroup_basic
8585
#define NBL_GL_KHR_shader_subgroup_basic
8686
#define NBL_GL_KHR_shader_subgroup_basic_subgroup_size
8787
#define NBL_GL_KHR_shader_subgroup_basic_subgroup_invocation_id
8888
#define NBL_GL_KHR_shader_subgroup_basic_subgroup_elect
8989
#endif
9090
91-
#ifdef NBL_IMPL_GL_KHR_shader_subgroup_vote
91+
#ifdef NBL_GLSL_IMPL_GL_KHR_shader_subgroup_vote
9292
#define NBL_GL_KHR_shader_subgroup_vote
9393
#define NBL_GL_KHR_shader_subgroup_vote_subgroup_any_all_equal_bool
9494
#define NBL_GL_KHR_shader_subgroup_vote_subgroup_all_equal_T
9595
#endif
9696
97-
#ifdef NBL_IMPL_GL_KHR_shader_subgroup_ballot
97+
#ifdef NBL_GLSL_IMPL_GL_KHR_shader_subgroup_ballot
9898
#define NBL_GL_KHR_shader_subgroup_ballot
9999
#define NBL_GL_KHR_shader_subgroup_ballot_bit_count
100100
#define NBL_GL_KHR_shader_subgroup_ballot_subgroup_mask
@@ -106,23 +106,23 @@ const char* COpenGLShader::k_openGL2VulkanExtensionMap = R"(
106106
#endif
107107
108108
// TODO: do a SPIR-V Cross contribution to do all the fallbacks (later)
109-
#ifdef NBL_IMPL_GL_KHR_shader_subgroup_shuffle
109+
#ifdef NBL_GLSL_IMPL_GL_KHR_shader_subgroup_shuffle
110110
#define NBL_GL_KHR_shader_subgroup_shuffle
111111
#endif
112112
113-
#ifdef NBL_IMPL_GL_KHR_shader_subgroup_shuffle_relative
113+
#ifdef NBL_GLSL_IMPL_GL_KHR_shader_subgroup_shuffle_relative
114114
#define NBL_GL_KHR_shader_subgroup_shuffle_relative
115115
#endif
116116
117-
#ifdef NBL_IMPL_GL_KHR_shader_subgroup_arithmetic
117+
#ifdef NBL_GLSL_IMPL_GL_KHR_shader_subgroup_arithmetic
118118
#define NBL_GL_KHR_shader_subgroup_arithmetic
119119
#endif
120120
121-
#ifdef NBL_IMPL_GL_KHR_shader_subgroup_clustered
121+
#ifdef NBL_GLSL_IMPL_GL_KHR_shader_subgroup_clustered
122122
#define NBL_GL_KHR_shader_subgroup_clustered
123123
#endif
124124
125-
#ifdef NBL_IMPL_GL_KHR_shader_subgroup_quad
125+
#ifdef NBL_GLSL_IMPL_GL_KHR_shader_subgroup_quad
126126
#define NBL_GL_KHR_shader_subgroup_quad
127127
#endif
128128
)";

src/nbl/video/IOpenGL_PhysicalDeviceBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ class IOpenGL_PhysicalDeviceBase : public IOpenGLPhysicalDeviceBase
13541354
auto nativeGLExtension = COpenGLFeatureMap::m_GLSLExtensions[j];
13551355
if (m_glfeatures.isFeatureAvailable(nativeGLExtension))
13561356
{
1357-
define = "NBL_IMPL_";
1357+
define = "NBL_GLSL_IMPL_";
13581358
define += COpenGLFeatureMap::OpenGLFeatureStrings[nativeGLExtension];
13591359
addGLSLDefineToPool(pool,define.c_str());
13601360
}

src/nbl/video/IPhysicalDevice.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ void IPhysicalDevice::addCommonGLSLDefines(std::ostringstream& pool, const bool
284284
addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_RAY_RECURSION_DEPTH",m_properties.limits.maxRayRecursionDepth);
285285
addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_SHADER_GROUP_STRIDE",m_properties.limits.maxShaderGroupStride);
286286
addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_SHADER_GROUP_BASE_ALIGNMENT",m_properties.limits.shaderGroupBaseAlignment);
287-
addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_SIZE",m_properties.limits.shaderGroupHandleCaptureReplaySize);
287+
// addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_SHADER_GROUP_HANDLE_CAPTURE_REPLAY_SIZE",m_properties.limits.shaderGroupHandleCaptureReplaySize); // [DO NOT EXPOSE] for capture tools
288288
addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_RAY_DISPATCH_INVOCATION_COUNT",m_properties.limits.maxRayDispatchInvocationCount);
289289
addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_SHADER_GROUP_HANDLE_ALIGNMENT",m_properties.limits.shaderGroupHandleAlignment);
290290
addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_MAX_RAY_HIT_ATTRIBUTE_SIZE",m_properties.limits.maxRayHitAttributeSize);
@@ -307,9 +307,9 @@ void IPhysicalDevice::addCommonGLSLDefines(std::ostringstream& pool, const bool
307307
if (m_properties.limits.postDepthCoverage) addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_POST_DEPTH_COVERAGE");
308308
if (m_properties.limits.shaderStencilExport) addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_SHADER_STENCIL_EXPORT");
309309
if (m_properties.limits.decorateString) addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_DECORATE_STRING");
310-
if (m_properties.limits.externalFence) addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_EXTERNAL_FENCE");
311-
if (m_properties.limits.externalMemory) addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_EXTERNAL_MEMORY");
312-
// if (m_properties.limits.externalSemaphore) addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_EXTERNAL_SEMAPHORE"); // not directly related to any shader stuff
310+
// if (m_properties.limits.externalFence) addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_EXTERNAL_FENCE"); // [TODO] requires instance extensions, add them
311+
// if (m_properties.limits.externalMemory) addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_EXTERNAL_MEMORY"); // [TODO] requires instance extensions, add them
312+
// if (m_properties.limits.externalSemaphore) addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_EXTERNAL_SEMAPHORE"); // [TODO] requires instance extensions, add them
313313
if (m_properties.limits.shaderNonSemanticInfo) addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_SHADER_NON_SEMANTIC_INFO");
314314
if (m_properties.limits.fragmentShaderBarycentric) addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_FRAGMENT_SHADER_BARYCENTRIC");
315315
if (m_properties.limits.geometryShaderPassthrough) addGLSLDefineToPool(pool,"NBL_GLSL_LIMIT_GEOMETRY_SHADER_PASSTHROUGH");
@@ -452,7 +452,7 @@ void IPhysicalDevice::addCommonGLSLDefines(std::ostringstream& pool, const bool
452452
if (m_features.shaderImageInt64Atomics) addGLSLDefineToPool(pool, "NBL_GLSL_FEATURE_SHADER_IMAGE_INT64_ATOMICS");
453453
if (m_features.sparseImageInt64Atomics) addGLSLDefineToPool(pool, "NBL_GLSL_FEATURE_SPARSE_IMAGE_INT64_ATOMICS");
454454
if (m_features.accelerationStructure) addGLSLDefineToPool(pool, "NBL_GLSL_FEATURE_ACCELERATION_STRUCTURE");
455-
// if (m_features.accelerationStructureCaptureReplay) addGLSLDefineToPool(pool, "NBL_GLSL_FEATURE_ACCELERATION_STRUCTURE_CAPTURE_REPLAY"); // shader doesn't need to know about
455+
// if (m_features.accelerationStructureCaptureReplay) addGLSLDefineToPool(pool, "NBL_GLSL_FEATURE_ACCELERATION_STRUCTURE_CAPTURE_REPLAY"); // [DO NOT EXPOSE] for capture tools
456456
if (m_features.accelerationStructureIndirectBuild) addGLSLDefineToPool(pool, "NBL_GLSL_FEATURE_ACCELERATION_STRUCTURE_INDIRECT_BUILD");
457457
if (m_features.accelerationStructureHostCommands) addGLSLDefineToPool(pool, "NBL_GLSL_FEATURE_ACCELERATION_STRUCTURE_HOST_COMMANDS");
458458
// if (m_features.descriptorBindingAccelerationStructureUpdateAfterBind) addGLSLDefineToPool(pool, "NBL_GLSL_FEATURE_DESCRIPTOR_BINDING_ACCELERATION_STRUCTURE_UPDATE_AFTER_BIND"); // shader doesn't need to know about

0 commit comments

Comments
 (0)