Skip to content

Commit d6217f7

Browse files
committed
PhysicalDevice feature and limits cleanup
- set more stuff in vulkanphysdev that was missed - exposed maxImageDimensionsXX and removed maxTextureSize
1 parent d1b2445 commit d6217f7

File tree

4 files changed

+171
-168
lines changed

4 files changed

+171
-168
lines changed

include/nbl/video/IPhysicalDevice.h

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ class IPhysicalDevice : public core::Interface, public core::Unmovable
7373
//
7474
struct SLimits
7575
{
76-
//uint32_t maxImageDimension1D;
77-
//uint32_t maxImageDimension2D;
78-
//uint32_t maxImageDimension3D;
79-
//uint32_t maxImageDimensionCube;
76+
/* Vulkan Core 1.0 */
77+
uint32_t maxImageDimension1D;
78+
uint32_t maxImageDimension2D;
79+
uint32_t maxImageDimension3D;
80+
uint32_t maxImageDimensionCube;
8081
uint32_t maxImageArrayLayers;
8182
uint32_t maxBufferViewSizeTexels;
8283
uint32_t maxUBOSize;
@@ -179,14 +180,22 @@ class IPhysicalDevice : public core::Interface, public core::Unmovable
179180
//VkDeviceSize optimalBufferCopyOffsetAlignment;
180181
//VkDeviceSize optimalBufferCopyRowPitchAlignment;
181182
uint64_t nonCoherentAtomSize;
182-
183-
//--> VkPhysicalDeviceSubgroupProperties
183+
184+
/* SubgroupProperties */
184185
uint32_t subgroupSize;
185186
core::bitflag<asset::IShader::E_SHADER_STAGE> subgroupOpsShaderStages;
186187
//VkSubgroupFeatureFlags supportedOperations; -> in SFeatures as booleans instead of flags
187-
//VkBool32 quadOperationsInAllStages;
188+
bool shaderSubgroupBasic = false;
189+
bool shaderSubgroupVote = false;
190+
bool shaderSubgroupArithmetic = false;
191+
bool shaderSubgroupBallot = false;
192+
bool shaderSubgroupShuffle = false;
193+
bool shaderSubgroupShuffleRelative = false;
194+
bool shaderSubgroupClustered = false;
195+
bool shaderSubgroupQuad = false;
196+
bool shaderSubgroupQuadAllStages = false; //quadOperationsInAllStages;
188197

189-
//--> VkPhysicalDeviceAccelerationStructurePropertiesKHR
198+
/* AccelerationStructurePropertiesKHR */
190199
uint64_t maxGeometryCount;
191200
uint64_t maxInstanceCount;
192201
uint64_t maxPrimitiveCount;
@@ -195,8 +204,8 @@ class IPhysicalDevice : public core::Interface, public core::Unmovable
195204
uint32_t maxDescriptorSetAccelerationStructures;
196205
uint32_t maxDescriptorSetUpdateAfterBindAccelerationStructures;
197206
uint32_t minAccelerationStructureScratchOffsetAlignment;
198-
199-
//--> VkPhysicalDeviceRayTracingPipelinePropertiesKHR
207+
208+
/* RayTracingPipelinePropertiesKHR */
200209
uint32_t shaderGroupHandleSize;
201210
uint32_t maxRayRecursionDepth;
202211
uint32_t maxShaderGroupStride;
@@ -205,10 +214,9 @@ class IPhysicalDevice : public core::Interface, public core::Unmovable
205214
uint32_t maxRayDispatchInvocationCount;
206215
uint32_t shaderGroupHandleAlignment;
207216
uint32_t maxRayHitAttributeSize;
208-
209-
//--> Nabla:
217+
218+
/* Nabla */
210219
uint32_t maxBufferSize;
211-
uint64_t maxTextureSize; // TODO: Use maxImageDimensions1D/2D/3D/Cube instead for gl and get rid of this
212220
uint32_t maxOptimallyResidentWorkgroupInvocations = 0u; // its 1D because multidimensional workgroups are an illusion
213221
uint32_t maxResidentInvocations = 0u; // These are maximum number of invocations you could expect to execute simultaneously on this device.
214222
asset::IGLSLCompiler::E_SPIRV_VERSION spirvVersion;
@@ -260,6 +268,7 @@ class IPhysicalDevice : public core::Interface, public core::Unmovable
260268
//
261269
struct SFeatures
262270
{
271+
/* Vulkan Core 1.0 */
263272
bool robustBufferAccess = false;
264273
//VkBool32 fullDrawIndexUint32;
265274
bool imageCubeArray = false;
@@ -315,51 +324,38 @@ class IPhysicalDevice : public core::Interface, public core::Unmovable
315324
//VkBool32 sparseResidencyAliased;
316325
//VkBool32 variableMultisampleRate;
317326
bool inheritedQueries = false;
318-
319-
//--> VkPhysicalDeviceSubgroupProperties: // TODO(Erfan): I think we should move these into SProperties::SLimits since it's part of properties and not features
320-
bool shaderSubgroupBasic = false;
321-
bool shaderSubgroupVote = false;
322-
bool shaderSubgroupArithmetic = false;
323-
bool shaderSubgroupBallot = false;
324-
bool shaderSubgroupShuffle = false;
325-
bool shaderSubgroupShuffleRelative = false;
326-
bool shaderSubgroupClustered = false;
327-
bool shaderSubgroupQuad = false;
328-
// Whether `shaderSubgroupQuad` flag refer to all stages where subgroup ops are reported to be supported.
329-
// See SLimit::subgroupOpsShaderStages.
330-
bool shaderSubgroupQuadAllStages = false;
331-
332-
//--> VkPhysicalDeviceRayQueryFeaturesKHR
327+
328+
/* RayQueryFeaturesKHR */
333329
bool rayQuery = false;
334-
335-
//--> VkPhysicalDeviceAccelerationStructureFeaturesKHR
330+
331+
/* AccelerationStructureFeaturesKHR */
336332
bool accelerationStructure = false;
337333
bool accelerationStructureCaptureReplay = false;
338334
bool accelerationStructureIndirectBuild = false;
339335
bool accelerationStructureHostCommands = false;
340336
bool descriptorBindingAccelerationStructureUpdateAfterBind = false;
341-
342-
//--> VkPhysicalDeviceRayTracingPipelineFeaturesKHR
337+
338+
/* RayTracingPipelineFeaturesKHR */
343339
bool rayTracingPipeline = false;
344340
bool rayTracingPipelineShaderGroupHandleCaptureReplay = false;
345341
bool rayTracingPipelineShaderGroupHandleCaptureReplayMixed = false;
346342
bool rayTracingPipelineTraceRaysIndirect = false;
347343
bool rayTraversalPrimitiveCulling = false;
348-
349-
//--> VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT
344+
345+
/* FragmentShaderInterlockFeaturesEXT */
350346
bool fragmentShaderSampleInterlock = false;
351347
bool fragmentShaderPixelInterlock = false;
352348
bool fragmentShaderShadingRateInterlock = false;
353-
354-
355-
//--> VkPhysicalDeviceBufferDeviceAddressFeaturesKHR
349+
350+
/* BufferDeviceAddressFeaturesKHR */
356351
bool bufferDeviceAddress = false;
357352
//VkBool32 bufferDeviceAddressCaptureReplay;
358353
//VkBool32 bufferDeviceAddressMultiDevice;
359354

360-
//--> Nabla:
361-
bool dispatchBase = false;
362-
bool drawIndirectCount = false;
355+
bool drawIndirectCount = false; // TODO(Erfan): Move in 1.2 features
356+
357+
/* Nabla */
358+
bool dispatchBase = false; // true in Vk, false in GL
363359
bool allowCommandBufferQueryCopies = false;
364360
};
365361
const SFeatures& getFeatures() const { return m_features; }

include/nbl/video/surface/CSurfaceGL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CSurfaceGLImpl : public Base<Window,ISurface>
7171
capabilities.maxImageCount = ~0u;
7272
capabilities.currentExtent = { this->getWidth(), this->getHeight() };
7373
capabilities.minImageExtent = { 1u, 1u };
74-
capabilities.maxImageExtent = { static_cast<uint32_t>(physicalDevice->getLimits().maxTextureSize), static_cast<uint32_t>(physicalDevice->getLimits().maxTextureSize) };
74+
capabilities.maxImageExtent = { static_cast<uint32_t>(physicalDevice->getLimits().maxImageDimension2D), static_cast<uint32_t>(physicalDevice->getLimits().maxImageDimension2D) };
7575
capabilities.maxImageArrayLayers = physicalDevice->getLimits().maxImageArrayLayers;
7676
capabilities.supportedTransforms = ISurface::EST_IDENTITY_BIT;
7777
capabilities.currentTransform = ISurface::EST_IDENTITY_BIT;

0 commit comments

Comments
 (0)