diff --git a/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm b/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm index 2c84d4ad..e37a89a9 100644 --- a/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm +++ b/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm @@ -1039,15 +1039,15 @@ MVKCommandEncoder::MVKCommandEncoder(MVKCommandBuffer* cmdBuffer) : MVKBaseDevic _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 95f48920..0e0d1f30 100644 --- a/MoltenVK/MoltenVK/Commands/MVKCommandPool.mm +++ b/MoltenVK/MoltenVK/Commands/MVKCommandPool.mm @@ -94,15 +94,15 @@ MVKCommandPool::MVKCommandPool(MVKDevice* device, 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 d83318c6..41cd28f1 100644 --- a/MoltenVK/MoltenVK/Commands/MVKMTLBufferAllocation.h +++ b/MoltenVK/MoltenVK/Commands/MVKMTLBufferAllocation.h @@ -58,7 +58,7 @@ public: id 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 958654e4..012600a4 100644 --- a/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h +++ b/MoltenVK/MoltenVK/Commands/MVKMTLResourceBindings.h @@ -71,6 +71,11 @@ typedef struct MVKPipelineBarrier { 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 @@ typedef struct MVKPipelineBarrier { 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 @@ typedef struct MVKPipelineBarrier { 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 fd42da8e..0d0397f2 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptor.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptor.mm @@ -602,9 +602,9 @@ MVKDescriptorSetLayoutBinding::MVKDescriptorSetLayoutBinding(const MVKDescriptor _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 e1f3bdb5..e62e5263 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm @@ -712,6 +712,7 @@ MVKDescriptorPool::MVKDescriptorPool(MVKDevice* device, const VkDescriptorPoolCr 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 @@ MVKDescriptorPool::MVKDescriptorPool(MVKDevice* device, const VkDescriptorPoolCr _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 06936327..58c84dcb 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm @@ -3997,10 +3997,10 @@ MVKDevice::MVKDevice(MVKPhysicalDevice* physicalDevice, const VkDeviceCreateInfo _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 f801d3fa..6abce41f 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.mm @@ -205,8 +205,8 @@ void MVKPipeline::addMTLArgumentEncoders(MVKMTLFunction& mvkMTLFunc, 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 9154d4d8..68e7e239 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm @@ -241,12 +241,12 @@ void MVKSwapchain::setHDRMetadataEXT(const VkHdrMetadataEXT& metadata) { 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 2a2dd7f7..60091a4b 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKSync.h +++ b/MoltenVK/MoltenVK/GPUObjects/MVKSync.h @@ -101,8 +101,8 @@ private: 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 834f96bb..c1126227 100644 --- a/MoltenVK/MoltenVK/Layers/MVKExtensions.mm +++ b/MoltenVK/MoltenVK/Layers/MVKExtensions.mm @@ -90,10 +90,11 @@ MVKExtension::MVKExtension(VkExtensionProperties* pProperties, bool enableForPla #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(); }