From 58d78623c3a84a2e226b37b29db5f153e95c99d9 Mon Sep 17 00:00:00 2001 From: Bill Hollings Date: Thu, 17 Jan 2019 14:54:03 -0500 Subject: [PATCH] Update inline MVKVector sizing for viewport & scissors. Revert MVKSwapchainImage::_availabilitySignalers to use std::list for performance. --- MoltenVK/MoltenVK/Commands/MVKCmdRenderPass.h | 4 ++-- MoltenVK/MoltenVK/Commands/MVKCommandEncoderState.h | 4 ++-- MoltenVK/MoltenVK/GPUObjects/MVKDevice.h | 4 ++++ MoltenVK/MoltenVK/GPUObjects/MVKImage.h | 4 ++-- MoltenVK/MoltenVK/GPUObjects/MVKPipeline.h | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/MoltenVK/MoltenVK/Commands/MVKCmdRenderPass.h b/MoltenVK/MoltenVK/Commands/MVKCmdRenderPass.h index 8de657e0..8a28da3b 100644 --- a/MoltenVK/MoltenVK/Commands/MVKCmdRenderPass.h +++ b/MoltenVK/MoltenVK/Commands/MVKCmdRenderPass.h @@ -115,7 +115,7 @@ public: private: uint32_t _firstViewport; - MVKVectorInline _mtlViewports; + MVKVectorInline _mtlViewports; }; @@ -134,7 +134,7 @@ public: private: uint32_t _firstScissor; - MVKVectorInline _mtlScissors; + MVKVectorInline _mtlScissors; }; diff --git a/MoltenVK/MoltenVK/Commands/MVKCommandEncoderState.h b/MoltenVK/MoltenVK/Commands/MVKCommandEncoderState.h index a18e6d46..ecf7bb8b 100644 --- a/MoltenVK/MoltenVK/Commands/MVKCommandEncoderState.h +++ b/MoltenVK/MoltenVK/Commands/MVKCommandEncoderState.h @@ -147,7 +147,7 @@ protected: void encodeImpl() override; void resetImpl() override; - MVKVectorInline _mtlViewports; + MVKVectorInline _mtlViewports; }; @@ -176,7 +176,7 @@ protected: void encodeImpl() override; void resetImpl() override; - MVKVectorInline _mtlScissors; + MVKVectorInline _mtlScissors; }; diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.h b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.h index 19f7ea31..969e6bf3 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.h +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.h @@ -65,6 +65,10 @@ class MVKCommandResourceFactory; /** The buffer index to use for vertex content. */ const static uint32_t kMVKVertexContentBufferIndex = 0; +// Parameters to define the sizing of inline collections +const static uint32_t kMVKCachedViewportCount = 16; +const static uint32_t kMVKCachedScissorCount = 16; + #pragma mark - #pragma mark MVKPhysicalDevice diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKImage.h b/MoltenVK/MoltenVK/GPUObjects/MVKImage.h index bdf64a5f..71a01468 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKImage.h +++ b/MoltenVK/MoltenVK/GPUObjects/MVKImage.h @@ -20,8 +20,8 @@ #include "MVKResource.h" #include "MVKSync.h" -#include "MVKVector.h" #include +#include #import @@ -396,7 +396,7 @@ protected: uint32_t _swapchainIndex; id _mtlDrawable; std::mutex _availabilityLock; - MVKVectorInline _availabilitySignalers; + std::list _availabilitySignalers; MVKSwapchainSignaler _preSignaled; MVKSwapchainImageAvailability _availability; }; diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.h b/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.h index 5132a055..6ed08b72 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.h +++ b/MoltenVK/MoltenVK/GPUObjects/MVKPipeline.h @@ -142,8 +142,8 @@ protected: VkPipelineRasterizationStateCreateInfo _rasterInfo; VkPipelineDepthStencilStateCreateInfo _depthStencilInfo; - MVKVectorInline _mtlViewports; - MVKVectorInline _mtlScissors; + MVKVectorInline _mtlViewports; + MVKVectorInline _mtlScissors; id _mtlPipelineState; MTLCullMode _mtlCullMode;