Merge pull request #1603 from scandit-opm/reorder-ctor

Fix reorder-ctor warnings
diff --git a/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm b/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm
index 2c84d4a..e37a89a 100644
--- a/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm
+++ b/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm
@@ -1039,15 +1039,15 @@
         _scissorState(this),
         _depthBiasState(this),
         _blendColorState(this),
+        _depthStencilState(this),
+        _stencilReferenceValueState(this),
+        _graphicsResourcesState(this),
+        _computeResourcesState(this),
         _vertexPushConstants(this, VK_SHADER_STAGE_VERTEX_BIT),
         _tessCtlPushConstants(this, VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT),
         _tessEvalPushConstants(this, VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT),
         _fragmentPushConstants(this, VK_SHADER_STAGE_FRAGMENT_BIT),
         _computePushConstants(this, VK_SHADER_STAGE_COMPUTE_BIT),
-        _depthStencilState(this),
-        _stencilReferenceValueState(this),
-        _graphicsResourcesState(this),
-        _computeResourcesState(this),
         _occlusionQueryState(this) {
 
             _pDeviceFeatures = &_device->_enabledFeatures;
diff --git a/MoltenVK/MoltenVK/Commands/MVKCommandPool.mm b/MoltenVK/MoltenVK/Commands/MVKCommandPool.mm
index 95f4892..0e0d1f3 100644
--- a/MoltenVK/MoltenVK/Commands/MVKCommandPool.mm
+++ b/MoltenVK/MoltenVK/Commands/MVKCommandPool.mm
@@ -94,15 +94,15 @@
 							   const VkCommandPoolCreateInfo* pCreateInfo,
 							   bool usePooling) :
 	MVKVulkanAPIDeviceObject(device),
-	_queueFamilyIndex(pCreateInfo->queueFamilyIndex),
-	_commandBufferPool(device, usePooling),
-	_commandEncodingPool(this),
 
 // Initialize the command type pool member variables.
 #	define MVK_CMD_TYPE_POOL_LAST(cmdType)  _cmd ##cmdType ##Pool(usePooling)
 #	define MVK_CMD_TYPE_POOL(cmdType)  MVK_CMD_TYPE_POOL_LAST(cmdType),
 #	include "MVKCommandTypePools.def"
-
+	,
+	_commandBufferPool(device, usePooling),
+	_commandEncodingPool(this),
+	_queueFamilyIndex(pCreateInfo->queueFamilyIndex)
 {}
 
 MVKCommandPool::~MVKCommandPool() {
diff --git a/MoltenVK/MoltenVK/Commands/MVKMTLBufferAllocation.h b/MoltenVK/MoltenVK/Commands/MVKMTLBufferAllocation.h
index d83318c..41cd28f 100644
--- a/MoltenVK/MoltenVK/Commands/MVKMTLBufferAllocation.h
+++ b/MoltenVK/MoltenVK/Commands/MVKMTLBufferAllocation.h
@@ -58,7 +58,7 @@
                            id<MTLBuffer> mtlBuffer,
                            NSUInteger offset,
                            NSUInteger length,
-                           uint64_t poolIndex) : _pool(pool), _mtlBuffer(mtlBuffer), _offset(offset), _length(length), _poolIndex(poolIndex) {}
+                           uint64_t poolIndex) : _mtlBuffer(mtlBuffer), _offset(offset), _length(length), _pool(pool), _poolIndex(poolIndex) {}
 
 protected:
     friend class MVKMTLBufferAllocationPool;
diff --git a/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h b/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h
index 958654e..012600a 100644
--- a/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h
+++ b/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h
@@ -71,6 +71,11 @@
 		Image,
 	} MVKPipelineBarrierType;
 
+	MVKPipelineBarrierType type = None;
+	VkAccessFlags srcAccessMask = 0;
+	VkAccessFlags dstAccessMask = 0;
+	uint8_t srcQueueFamilyIndex = 0;
+	uint8_t dstQueueFamilyIndex = 0;
 	union { MVKBuffer* mvkBuffer = nullptr; MVKImage* mvkImage; MVKResource* mvkResource; };
 	union {
 		struct {
@@ -86,12 +91,6 @@
 			uint8_t levelCount;
 		};
 	};
-	VkAccessFlags srcAccessMask = 0;
-	VkAccessFlags dstAccessMask = 0;
-	uint8_t srcQueueFamilyIndex = 0;
-	uint8_t dstQueueFamilyIndex = 0;
-
-	MVKPipelineBarrierType type = None;
 
 	bool isMemoryBarrier() { return type == Memory; }
 	bool isBufferBarrier() { return type == Buffer; }
@@ -118,15 +117,15 @@
 		type(Image),
 		srcAccessMask(vkBarrier.srcAccessMask),
 		dstAccessMask(vkBarrier.dstAccessMask),
-		newLayout(vkBarrier.newLayout),
 		srcQueueFamilyIndex(vkBarrier.srcQueueFamilyIndex),
 		dstQueueFamilyIndex(vkBarrier.dstQueueFamilyIndex),
 		mvkImage((MVKImage*)vkBarrier.image),
+		newLayout(vkBarrier.newLayout),
 		aspectMask(vkBarrier.subresourceRange.aspectMask),
-		baseMipLevel(vkBarrier.subresourceRange.baseMipLevel),
-		levelCount(vkBarrier.subresourceRange.levelCount),
 		baseArrayLayer(vkBarrier.subresourceRange.baseArrayLayer),
-		layerCount(vkBarrier.subresourceRange.layerCount)
+		layerCount(vkBarrier.subresourceRange.layerCount),
+		baseMipLevel(vkBarrier.subresourceRange.baseMipLevel),
+		levelCount(vkBarrier.subresourceRange.levelCount)
 		{}
 
 } MVKPipelineBarrier;
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptor.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptor.mm
index fd42da8..0d0397f 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptor.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptor.mm
@@ -602,9 +602,9 @@
 	_layout(binding._layout),
 	_info(binding._info),
 	_flags(binding._flags),
-	_descriptorIndex(binding._descriptorIndex),
 	_immutableSamplers(binding._immutableSamplers),
-	_mtlResourceIndexOffsets(binding._mtlResourceIndexOffsets) {
+	_mtlResourceIndexOffsets(binding._mtlResourceIndexOffsets),
+	_descriptorIndex(binding._descriptorIndex) {
 
 	for (uint32_t i = kMVKShaderStageVertex; i < kMVKShaderStageCount; i++) {
         _applyToStage[i] = binding._applyToStage[i];
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm
index e1f3bdb..e62e526 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm
@@ -712,6 +712,7 @@
 	MVKVulkanAPIDeviceObject(device),
 	_descriptorSets(pCreateInfo->maxSets, MVKDescriptorSet(this)),
 	_descriptorSetAvailablility(pCreateInfo->maxSets, true),
+	_inlineBlockMTLBufferAllocator(device, device->_pMetalFeatures->dynamicMTLBufferSize, true),
 	_uniformBufferDescriptors(getPoolSize(pCreateInfo, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, poolDescriptors)),
 	_storageBufferDescriptors(getPoolSize(pCreateInfo, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, poolDescriptors)),
 	_uniformBufferDynamicDescriptors(getPoolSize(pCreateInfo, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, poolDescriptors)),
@@ -724,7 +725,6 @@
 	_combinedImageSamplerDescriptors(getPoolSize(pCreateInfo, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, poolDescriptors)),
 	_uniformTexelBufferDescriptors(getPoolSize(pCreateInfo, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, poolDescriptors)),
 	_storageTexelBufferDescriptors(getPoolSize(pCreateInfo, VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER, poolDescriptors)),
-	_inlineBlockMTLBufferAllocator(device, device->_pMetalFeatures->dynamicMTLBufferSize, true),
 	_hasPooledDescriptors(poolDescriptors) {
 		initMetalArgumentBuffer(pCreateInfo);
 	}
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
index 0693632..58c84dc 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
@@ -3997,10 +3997,10 @@
 	_enabledInterlockFeatures(),
 	_enabledHostQryResetFeatures(),
 	_enabledSamplerYcbcrConversionFeatures(),
+	_enabledPrivateDataFeatures(),
 	_enabledScalarLayoutFeatures(),
 	_enabledTexelBuffAlignFeatures(),
 	_enabledVtxAttrDivFeatures(),
-	_enabledPrivateDataFeatures(),
 	_enabledPortabilityFeatures(),
 	_enabledImagelessFramebufferFeatures(),
 	_enabledDynamicRenderingFeatures(),
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.mm b/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.mm
index f801d3f..6abce41 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.mm
@@ -205,8 +205,8 @@
 MVKPipeline::MVKPipeline(MVKDevice* device, MVKPipelineCache* pipelineCache, MVKPipelineLayout* layout, MVKPipeline* parent) :
 	MVKVulkanAPIDeviceObject(device),
 	_pipelineCache(pipelineCache),
-	_fullImageViewSwizzle(mvkConfig().fullImageViewSwizzle),
-	_descriptorSetCount(layout->getDescriptorSetCount()) {
+	_descriptorSetCount(layout->getDescriptorSetCount()),
+	_fullImageViewSwizzle(mvkConfig().fullImageViewSwizzle) {
 
 		// Establish descriptor counts and push constants use.
 		for (uint32_t stage = kMVKShaderStageVertex; stage < kMVKShaderStageCount; stage++) {
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm b/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm
index 9154d4d..68e7e23 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm
@@ -241,12 +241,12 @@
 MVKSwapchain::MVKSwapchain(MVKDevice* device,
 						   const VkSwapchainCreateInfoKHR* pCreateInfo) :
 	MVKVulkanAPIDeviceObject(device),
-	_surfaceLost(false),
-	_currentAcquisitionID(0),
-	_layerObserver(nil),
-	_currentPerfLogFrameCount(0),
-	_lastFrameTime(0),
 	_licenseWatermark(nil),
+	_currentAcquisitionID(0),
+	_lastFrameTime(0),
+	_currentPerfLogFrameCount(0),
+	_surfaceLost(false),
+	_layerObserver(nil),
 	_presentHistoryCount(0),
 	_presentHistoryIndex(0),
 	_presentHistoryHeadIndex(0) {
diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKSync.h b/MoltenVK/MoltenVK/GPUObjects/MVKSync.h
index 2a2dd7f..60091a4 100644
--- a/MoltenVK/MoltenVK/GPUObjects/MVKSync.h
+++ b/MoltenVK/MoltenVK/GPUObjects/MVKSync.h
@@ -101,8 +101,8 @@
 
 	std::mutex _lock;
 	std::condition_variable _blocker;
-	uint32_t _reservationCount;
 	bool _shouldWaitAll;
+	uint32_t _reservationCount;
 };
 
 
diff --git a/MoltenVK/MoltenVK/Layers/MVKExtensions.mm b/MoltenVK/MoltenVK/Layers/MVKExtensions.mm
index 834f96b..c112622 100644
--- a/MoltenVK/MoltenVK/Layers/MVKExtensions.mm
+++ b/MoltenVK/MoltenVK/Layers/MVKExtensions.mm
@@ -90,10 +90,11 @@
 #pragma mark -
 #pragma mark MVKExtensionList
 
-MVKExtensionList::MVKExtensionList(MVKVulkanAPIObject* apiObject, bool enableForPlatform) : _apiObject(apiObject),
+MVKExtensionList::MVKExtensionList(MVKVulkanAPIObject* apiObject, bool enableForPlatform) :
 #define MVK_EXTENSION_LAST(var, EXT, type, macos, ios)		vk_ ##var(&kVkExtProps_ ##EXT, enableForPlatform)
 #define MVK_EXTENSION(var, EXT, type, macos, ios)			MVK_EXTENSION_LAST(var, EXT, type, macos, ios),
 #include "MVKExtensions.def"
+	, _apiObject(apiObject)
 {
 	initCount();
 }