When new descriptor sets are bound, it may be the case that many of the
bindings are not changed from their previous state. Detect this case and avoid
binding the same resources in the Metal comand buffer repeatedly. If possible,
change only the offset. This saves some encoding time.
This patch fixes a regression caused by 1b6b8bc9 when the implicit buffers
were moved to top of Metal buffer index range.
Fix vertex buffer binding counts when binding indexes are not consecutive,
or when additional synthetic buffer bindings are required to accommodate
vertex attributes that are outside the vertex buffer stride values.
Take into consideration that the app may bind more vertex attribute buffers
than a pipeline may consume, and don't allow these to overwrite any implicit
buffers sent to the shader.
MVKResourcesCommandEncoderState::encodeBinding() clear binding dirty flag
before calling lambda function to allow function operation to possibly
override and leave binding marked dirty.
Set tessellation vertex buffer indexes based on platform maximum vertex stage
buffer count, instead of hardcoding them, to preemptively avoid conflict with
implicit buffers should the platform counts ever change.
So far it always returned a 60 Hz refresh on macOS. Now we query the
actual refresh interval for the NSScreen on which our swapChain is likely
displaying.
Tested on a MacBookPro dual-display setup with builtin 60 Hz Retina panel
and external 100 Hz monitor, showing proper reporting depending on which
monitor the window was displaying on. Tested on macOS 10.15.7 only.
renderpass was writing timestamp before renderpass activity was complete.
MVKCommandBuffer tracks whether it contains a stage-based timestamp command,
and MVKCommandEncoder updates the timestamp command fence when ending any
Metal command encoder on such a MVKCommandBuffer.
MVKCommandEncoder reorder member variables to avoid layout gaps (unrelated).
MVKCommandBuffer update _commandCount even for single-use immediate command
encoding (unrelated).
Add VK_KHR_separate_depth_stencil_layouts and enable its features.
Metal generally ignores image layouts, so nothing further needed.
Update Whats_New.md and MoltenVK_Runtime_UserGuide.md documents
with recently-added extensions.
Passes almost all supported separate_layouts CTS tests, with the
few remaining tests failing due to issues with unrelated capabilities.
Unrelated cleanup:
- MVKDevice enable extensions before features.
- MVKDevice reorder ivar declarations to reduce
memory layout gaps, and define default values.
- Rename VkSemaphoreStyle to MVKSemaphoreStyle to
remove potential conflicts with Vulkan Vk name space.
- MVKRenderPass set rendering flags from outside instead of via constructor.
- MVKCommandEncodingContext tracks and manages lifespan of renderpass and
framebuffer, potentially across multiple MVKCommandEncoders.
- When resuming a suspended dynamic renderpass, reuse the renderpass and
framebuffer cached in MVKCommandEncodingContext, otherwise create them.
- MVKCommandBuffer::begin() creates local copy of dynamic rendering color formats.
- MVKDevice track enabling VK_KHR_dynamic_rendering extension features.
- Add MVKCmdBeginRendering and MVKCmdEndRendering command objects
and associated command pools.
- Add MVKCommandEncoder::beginRendering() which dynamically instantiates
temporary MVKRenderpass and (imageless) MVKFramebuffer objects to handle
equivalent renderpass operations.
- MVKCommandEncoder retain and release subpass and framebuffer objects
to allow transient dynamic instances to be created and destroyed.
- Add support functions to create MVKRenderpass and (imageless)
MVKFramebuffer objects from VkRenderingInfo.
- MVKRenderpass track VkRenderingFlags.
- MVKRenderSubpass create and track an internal VkPipelineRenderingCreateInfo.
- MVKRenderPassAttachment support LoadOp and StoreOp behavior for
dynamic rendering suspend and resume.
- Refactor viewMask processing to permit operations on viewMask outside of
MVKGraphicsPipeline without requiring the presence of an MVKSubpass.
- MVKGraphicsPipeline extract VkPipelineRenderingCreateInfo from MVKRenderSubpass
if available, or VkGraphicsPipelineCreateInfo::pNext if not.
- MVKCommandBuffer track VkCommandBufferInheritanceRenderingInfo (currently unused).
- (unrelated) vulkan.mm move location of VK_EXT_sample_locations functions
for layout readability consistency.
buffer binding used by a subsequent pipeline that does not use push constants.
This error was previously introduced in 2a17f75, where a push constants
binding could override the Metal buffer binding 0 of a subsequent pipeline
that does not use push constants.
When pipeline binding is encoded, track which stages use push constants
and only encode push constants if the pipeline and stage uses them.
(unrelated) Make use of MVKResourcesCommandEncoderState::getPipeline() consistent.
Update README.md and MoltenVK_Runtime_UserGuide.md to document the impact
of the VK_KHR_portability_enumeration extension during runtime loading on macOS.
Update MoltenVK version to 1.1.10.