Skip to content

Commit 5e01691

Browse files
committed
Apply reviews
1 parent f821530 commit 5e01691

File tree

3 files changed

+69
-42
lines changed

3 files changed

+69
-42
lines changed

include/nbl/video/SPhysicalDeviceFeatures.h

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,6 @@ struct SPhysicalDeviceFeatures
321321
bool shaderImageInt64Atomics = false;
322322
bool sparseImageInt64Atomics = false;
323323

324-
// [DO NOT EXPOSE] always enable if we can
325-
/* TexelBufferAlignmentFeaturesEXT *//* VK_EXT_texel_buffer_alignment */
326-
//bool texelBufferAlignment;
327-
328324
// [DO NOT EXPOSE] ever because of our disdain for XForm feedback
329325
/* TransformFeedbackFeaturesEXT *//* VK_EXT_transform_feedback */
330326
//bool transformFeedback;
@@ -537,74 +533,73 @@ struct SPhysicalDeviceFeatures
537533
// [TODO] Promoted to VK1.1 core, haven't updated API to match
538534
/* VK_KHR_descriptor_update_template */
539535

540-
// [TODO] Always enable, expose as limit
536+
// Enabled by Default, Moved to Limits
537+
/* TexelBufferAlignmentFeaturesEXT *//* VK_EXT_texel_buffer_alignment */
538+
539+
// Enabled by Default, Moved to Limits
541540
/* VK_NV_sample_mask_override_coverage */
542541

543-
// [TODO] Always enable, have it contribute to shaderSubgroup reporting & report as limit
544-
/* VK_NV_shader_subgroup_partitioned */
542+
// Enabled by Default, Moved to Limits
543+
/* VK_NV_shader_subgroup_partitioned */ // [TODO] have it contribute to shaderSubgroup reporting
545544

546-
// [TODO] Always enable, expose as limit
545+
// Enabled by Default, Moved to Limits
547546
/* VK_AMD_gcn_shader */
548547

549-
// [TODO] Always enable, expose as limit (Note: Promoted to VK_KHR_shader_float16_int8)
548+
// Enabled by Default, Moved to Limits
550549
/* VK_AMD_gpu_shader_half_float */
551550

552-
// [TODO] Always enable, expose as limit (Note: Promoted to VK_AMD_gpu_shader_int16)
551+
// Enabled by Default, Moved to Limits
553552
/* VK_AMD_gpu_shader_int16 */
554553

555-
// [TODO] Always enable, have it contribute to shaderSubgroup reporting
554+
// Enabled by Default, Moved to Limits
556555
/* VK_AMD_shader_ballot */
557-
558-
// [TODO] Always enable, expose as limit
556+
557+
// Enabled by Default, Moved to Limits
559558
/* VK_AMD_shader_image_load_store_lod */
560559

561-
// [TODO] Enable when available, report as limit
560+
// Enabled by Default, Moved to Limits
562561
/* VK_AMD_shader_trinary_minmax */
563562

564-
// [TODO] needs to figure out how extending our LOAD_OP enum would affect the GL backend
565-
/* VK_EXT_load_store_op_none */
566-
567-
// [TODO] Always enable, expose as limit
563+
// Enabled by Default, Moved to Limits
568564
/* VK_EXT_post_depth_coverage */
569565

570-
// [TODO] Always enable, expose as limit
566+
// Enabled by Default, Moved to Limits
571567
/* VK_EXT_shader_stencil_export */
572568

573-
// [TODO] Always enable, expose as limit
569+
// Enabled by Default, Moved to Limits
574570
/* VK_GOOGLE_decorate_string */
575571

576-
// [TODO] Always enable, expose as limit
572+
// Enabled by Default, Moved to Limits
577573
/* VK_KHR_external_fence_fd */
578574

579-
// [TODO] Always enable, expose as limit
575+
// Enabled by Default, Moved to Limits
580576
/* VK_KHR_external_fence_win32 */
581577

582-
// [TODO] Always enable, expose as limit
578+
// Enabled by Default, Moved to Limits
583579
/* VK_KHR_external_memory_fd */
584580

585-
// [TODO] Always enable, expose as limit
581+
// Enabled by Default, Moved to Limits
586582
/* VK_KHR_external_memory_win32 */
587583

588-
// [TODO] Always enable, expose as limit
584+
// Enabled by Default, Moved to Limits
589585
/* VK_KHR_external_semaphore_fd */
590586

591-
// [TODO] Always enable, expose as limit
587+
// Enabled by Default, Moved to Limits
592588
/* VK_KHR_external_semaphore_win32 */
593589

594-
// [TODO] Always enable, expose as limit
590+
// Enabled by Default, Moved to Limits
595591
/* VK_KHR_shader_non_semantic_info */
596592

597-
// [TODO] Always enable, expose as limit
593+
// Enabled by Default, Moved to Limits
598594
/* ShaderSMBuiltinsFeaturesNV *//* VK_NV_shader_sm_builtins */
599-
//bool shaderSMBuiltins;
600595

601-
// [TODO] Always enable, expose as limit
596+
// Enabled by Default, Moved to Limits
602597
/* VK_KHR_fragment_shader_barycentric */
603598

604-
// [TODO] Always enable, expose as limit
599+
// Enabled by Default, Moved to Limits
605600
/* VK_NV_geometry_shader_passthrough */
606601

607-
// [TODO] Always enable, expose as limit
602+
// Enabled by Default, Moved to Limits
608603
/* VK_NV_viewport_swizzle */
609604

610605
// [TODO] this one isn't in the headers
@@ -642,6 +637,9 @@ struct SPhysicalDeviceFeatures
642637
/* ShaderImageFootprintFeaturesNV *//* VK_NV_shader_image_footprint */
643638
//bool imageFootprint;
644639

640+
// [TODO LATER] needs to figure out how extending our LOAD_OP enum would affect the GL backend
641+
/* VK_EXT_load_store_op_none */
642+
645643
// [TODO LATER] Won't expose for now, API changes necessary
646644
/* VK_AMD_texture_gather_bias_lod */
647645

include/nbl/video/SPhysicalDeviceLimits.h

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ struct SPhysicalDeviceLimits
8888
uint32_t bufferViewAlignment = 0u;
8989
uint32_t minUBOAlignment = 0u;
9090
uint32_t minSSBOAlignment = 0u;
91-
int32_t minTexelOffset = 0u;
91+
int32_t minTexelOffset = 0;
9292
uint32_t maxTexelOffset = 0u;
93-
int32_t minTexelGatherOffset = 0u;
93+
int32_t minTexelGatherOffset = 0;
9494
uint32_t maxTexelGatherOffset = 0u;
9595
float minInterpolationOffset = 0.0f;
9696
float maxInterpolationOffset = 0.0f;
@@ -137,7 +137,7 @@ struct SPhysicalDeviceLimits
137137

138138
/* Vulkan 1.1 Core */
139139
uint32_t subgroupSize = 0u;
140-
core::bitflag<asset::IShader::E_SHADER_STAGE> subgroupOpsShaderStages = asset::IShader::E_SHADER_STAGE(0u);
140+
core::bitflag<asset::IShader::E_SHADER_STAGE> subgroupOpsShaderStages = asset::IShader::ESS_UNKNOWN;
141141
bool shaderSubgroupBasic = false;
142142
bool shaderSubgroupVote = false;
143143
bool shaderSubgroupArithmetic = false;
@@ -343,7 +343,7 @@ struct SPhysicalDeviceLimits
343343
uint32_t maxRayHitAttributeSize = 0u;
344344

345345
/* CooperativeMatrixPropertiesNV *//* VK_NV_cooperative_matrix */
346-
core::bitflag<asset::IShader::E_SHADER_STAGE> cooperativeMatrixSupportedStages = asset::IShader::E_SHADER_STAGE(0u);
346+
core::bitflag<asset::IShader::E_SHADER_STAGE> cooperativeMatrixSupportedStages = asset::IShader::ESS_UNKNOWN;
347347

348348
// [TODO LATER] not in header (previous comment: too much effort)
349349
// GLHint: Report false for both on GL
@@ -554,18 +554,43 @@ struct SPhysicalDeviceLimits
554554
//! uint32_t maxVertexInputBindingStride;
555555

556556
/* Always enabled, reported as limits */
557-
bool shaderOutputViewportIndex = false; // ALIAS: VK_EXT_shader_viewport_index_layer
558-
bool shaderOutputLayer = false; // ALIAS: VK_EXT_shader_viewport_index_layer
557+
bool shaderOutputViewportIndex = false; // ALIAS: VK_EXT_shader_viewport_index_layer
558+
bool shaderOutputLayer = false; // ALIAS: VK_EXT_shader_viewport_index_layer
559559

560560
/* ShaderIntegerFunctions2FeaturesINTEL *//* VK_INTEL_shader_integer_functions2 */
561-
bool shaderIntegerFunctions2 = false;
561+
bool shaderIntegerFunctions2 = false;
562562

563563
/* ShaderClockFeaturesKHR *//* VK_KHR_shader_clock */
564-
bool shaderSubgroupClock = false;
564+
bool shaderSubgroupClock = false;
565565

566566
/* ShaderImageFootprintFeaturesNV *//* VK_NV_shader_image_footprint */
567-
bool imageFootprint = false;
568-
567+
bool imageFootprint = false;
568+
569+
/* TexelBufferAlignmentFeaturesEXT *//* VK_EXT_texel_buffer_alignment */
570+
bool texelBufferAlignment = false;
571+
572+
// [TODO] implement the enable by default and expose behaviour for ones below once API changes
573+
574+
/* ShaderSMBuiltinsFeaturesNV *//* VK_NV_shader_sm_builtins */
575+
bool shaderSMBuiltins = false;
576+
577+
bool shaderSubgroupPartitioned = false; /* VK_NV_shader_subgroup_partitioned */
578+
bool gcnShader = false; /* VK_AMD_gcn_shader */
579+
bool gpuShaderHalfFloat = false; /* VK_AMD_gpu_shader_half_float */
580+
bool gpuShaderInt16 = false; /* VK_AMD_gpu_shader_int16 */
581+
bool shaderBallot = false; /* VK_AMD_shader_ballot */
582+
bool shaderImageLoadStoreLod = false; /* VK_AMD_shader_image_load_store_lod */
583+
bool shaderTrinaryMinmax = false; /* VK_AMD_shader_trinary_minmax */
584+
bool postDepthCoverage = false; /* VK_EXT_post_depth_coverage */
585+
bool shaderStencilExport = false; /* VK_EXT_shader_stencil_export */
586+
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 */
590+
bool shaderNonSemanticInfo = false; /* VK_KHR_shader_non_semantic_info */
591+
bool fragmentShaderBarycentric = false; /* VK_KHR_fragment_shader_barycentric */
592+
bool geometryShaderPassthrough = false; /* VK_NV_geometry_shader_passthrough */
593+
bool viewportSwizzle = false; /* VK_NV_viewport_swizzle */
569594

570595
/* Nabla */
571596
uint32_t computeUnits = 0u;

src/nbl/video/CVulkanPhysicalDevice.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,27 +1352,31 @@ class CVulkanPhysicalDevice final : public IPhysicalDevice
13521352
{
13531353
texelBufferAlignmentFeatures.texelBufferAlignment = true;
13541354
addFeatureToChain(&texelBufferAlignmentFeatures);
1355+
selectedFeatures.push_back(VK_EXT_TEXEL_BUFFER_ALIGNMENT_EXTENSION_NAME);
13551356
}
13561357

13571358
VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL intelShaderIntegerFunctions2 = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_FUNCTIONS_2_FEATURES_INTEL };
13581359
if (m_availableFeatureSet.find(VK_INTEL_SHADER_INTEGER_FUNCTIONS_2_EXTENSION_NAME) != m_availableFeatureSet.end())
13591360
{
13601361
intelShaderIntegerFunctions2.shaderIntegerFunctions2 = true;
13611362
addFeatureToChain(&intelShaderIntegerFunctions2);
1363+
selectedFeatures.push_back(VK_INTEL_SHADER_INTEGER_FUNCTIONS_2_EXTENSION_NAME);
13621364
}
13631365

13641366
VkPhysicalDeviceShaderClockFeaturesKHR shaderClockFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CLOCK_FEATURES_KHR };
13651367
if (m_availableFeatureSet.find(VK_KHR_SHADER_CLOCK_EXTENSION_NAME) != m_availableFeatureSet.end())
13661368
{
13671369
shaderClockFeatures.shaderSubgroupClock = true;
13681370
addFeatureToChain(&shaderClockFeatures);
1371+
selectedFeatures.push_back(VK_KHR_SHADER_CLOCK_EXTENSION_NAME);
13691372
}
13701373

13711374
VkPhysicalDeviceShaderImageFootprintFeaturesNV shaderImageFootprintFeatures = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV };
13721375
if (m_availableFeatureSet.find(VK_NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME) != m_availableFeatureSet.end())
13731376
{
13741377
shaderImageFootprintFeatures.imageFootprint = true;
13751378
addFeatureToChain(&shaderImageFootprintFeatures);
1379+
selectedFeatures.push_back(VK_NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME);
13761380
}
13771381
}
13781382

0 commit comments

Comments
 (0)