Skip to content

Commit

Permalink
Merge pull request #642 from billhollings/master
Browse files Browse the repository at this point in the history
 Updates for SDK 1.1.108 release.
  • Loading branch information
billhollings authored Jun 13, 2019
2 parents a6d1306 + bf8c7f8 commit 00c86d8
Show file tree
Hide file tree
Showing 12 changed files with 2,350 additions and 2,307 deletions.
40 changes: 38 additions & 2 deletions Docs/Whats_New.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For best results, use a Markdown reader.*
MoltenVK 1.0.35
---------------

Released TBD
Released 2019/06/13

- Add support for extensions:
- `VK_EXT_debug_report`
Expand All @@ -33,25 +33,61 @@ Released TBD
- Fix tessellated indirect draws using wrong kernels to map parameters.
- Work around potential Metal bug with stage-in indirect buffers.
- Fix zero local threadgroup size in indirect tessellated rendering.
- Fix [[attribute]] assignment for tessellation evaluation shaders.
- `VkSemaphore` optionally uses `MTLEvent`, if available and
`MVK_ALLOW_METAL_EVENTS` environment variable is enabled.
- Add `vkSetWorkgroupSizeMVK()` to set compute kernel workgroup size
when using MSL source code or MSL compiled code.
- Allow zero count of viewports and scissors.
- Report image layer limits for attachments in `vkGetPhysicalDeviceImageFormatProperties()`.
- Change log indication of error in logs from `[***MoltenVK ERROR***]` to
`[mvk-error]`, for consistency with other log level indications.
`[mvk-error]`, for consistency with other log level indications.
- Allow `mvkMTLRenderStagesFromVkPipelineStageFlags()` to map to all Vulkan stages,
by indicating whether the pipeline barrier should come before or after the stages.
- Automatically update `VkPhysicalDeviceProperties::pipelineCacheUUID` when SPIRV-Cross revision changes.
- Fix crash when clearing attachments using layered rendering on older macOS devices.
- Fixes to Metal renderpass layered rendering settings.
- `vkCmdClearAttachments()` returns encoder to previous pipeline, depth-stencil & resource state after execution.
- Fix issue clearing stencil attachment via renderpass when depth attachment is not being cleared.
- Fix sporadic crash on `vkDestroySwapchainKHR()`.
- `MoltenVKShaderConverter` tool: Add MSL version and platform command-line options.
- Fix crash on pipeline cache merge after `VkShaderModule` destroyed.
- Fix case where viewport/scissor doesn't get set properly when mixing dynamic and
static-configured pipelines in the same command buffer.
- Fix a race condition between sync objects and queries.
- Fix unused attachments terminating loop early.
- Fix offset of buffer view relative to buffer offset within device memory.
- Guard against missing Metal pipeline states when pipeline compilation fails.
- MVKBuffer: Force managed storage for linear textures on shared buffers.
- Use device address space when decompressing DXT image data.
- Added missing `texelBufferTextureWidth` setting in `MVKComputePipeline::getMTLFunction()`.
- Fixes and consolidation of external library header references.
- Allow building external dependency libraries in `Debug` mode.
- Enable AMD and NV GLSL extensions when building `glslang` for `MoltenVKGLSLToSPIRVConverter`.
- Make external library header references consistent and add `MVK_EXCLUDE_SPIRV_TOOLS` option.
- MVKVector improvements.
- Update `VK_MVK_MOLTENVK_SPEC_VERSION` to 20.
- Update to latest SPIRV-Cross version:
- MSL: Add support for subgroup operations.
- MSL: Support argument buffers and image swizzling.
- MSL: Add support for `OpArrayLength`.
- MSL: Only use constant address space for tessellation control shader.
- MSL: Support native texture_buffer type, throw error on atomics.
- MSL: Add native texture buffer support.
- MSL: Deal with texture swizzle on arrays of images.
- MSL: Fix complex type alias declaration order.
- MSL: Fix declaration of unused input variables.
- MSL: Use correct address space when passing array-of-buffers.
- MSL: Deal correctly with nonuniformEXT qualifier.
- MSL: Cast texture_buffer index to uint.
- MSL: Fix nonuniform test.
- MSL: Fix regression with Private parameter declaration.
- MSL: Support remapping constexpr samplers by set/binding.
- MSL: Support Invariant qualifier on position.
- MSL: Support stencil export.
- Deal with case where a block is somehow emitted in a duplicated fashion.
- Fix infinite loop when OpAtomic* temporaries are used in other blocks.
- Fix tests for device->constant address space change in MSL tessellation control shader generation.
- Accept SPIR-V 1.4 version.


Expand Down
4,558 changes: 2,280 additions & 2,278 deletions ExternalDependencies.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion ExternalRevisions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ the *SPIRV-Tools* library to the `ExternalDependencies` *Xcode* project as follo
that opens, select the _**Create groups**_ option, add the files to *both* the `SPIRV-Tools-macOS`
and `SPIRV-Tools-iOS` targets, and click the ***Finish*** button.

3. In the *Project Navigator* panel, select the `ExternalDependencies` *Xcode* project, then

3. Remove the *Group* named `fuzz` from under the *Group* named `External/SPIRV-Tools/source`.

4. In the *Project Navigator* panel, select the `ExternalDependencies` *Xcode* project, then
select the `SPIRV-Tools-macOS` target, and open the *Build Settings* tab. Locate the build
setting entry **Header Search Paths** (`HEADER_SEARCH_PATHS`) and add the following paths:

Expand Down
2 changes: 1 addition & 1 deletion ExternalRevisions/SPIRV-Cross_repo_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cb686a5dba9a7086a778fe21900383beed9ea5d3
4104e363005a079acc215f0920743a8affb31278
2 changes: 1 addition & 1 deletion ExternalRevisions/Vulkan-Headers_repo_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
08cbb5458f692d4778806775f65eb3dc642ddbbf
097a1045098213919fd56442f52c716fc78eeb27
2 changes: 1 addition & 1 deletion ExternalRevisions/Vulkan-Tools_repo_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2abb69904b9ad017d39d3da1e7fc3dec1a584cd8
d2de4ac0a28766c6fb10968fdcc4d75566eef8d7
2 changes: 1 addition & 1 deletion ExternalRevisions/VulkanSamples_repo_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
37e808988e758ec4f6f689012fb425bab1398ecf
c6df494e270b5afad6bf5aaca725a037abe10501
2 changes: 1 addition & 1 deletion ExternalRevisions/glslang_repo_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e06c7e9a515b716c731bda13f507546f107775d1
21eebe74214488264bbf0d19323a03c13a9e53a7
4 changes: 4 additions & 0 deletions MoltenVK/MoltenVK/Commands/MVKCmdTransfer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,11 @@
[mtlRendEnc drawPrimitives: MTLPrimitiveTypeTriangle vertexStart: 0 vertexCount: vtxCnt];
[mtlRendEnc popDebugGroup];

// Return to the previous rendering state on the next render activity
cmdEncoder->_graphicsPipelineState.markDirty();
cmdEncoder->_depthStencilState.markDirty();
cmdEncoder->_stencilReferenceValueState.markDirty();
cmdEncoder->_graphicsResourcesState.beginMetalRenderPass();
}


Expand Down
3 changes: 2 additions & 1 deletion MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@
(*pDynamicOffsetIndex)++; // Move on to next dynamic offset (and feedback to caller)
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: {
MVKBuffer* mvkBuff = (MVKBuffer*)descBinding._bufferBindings[rezIdx].buffer;
bb.mtlBuffer = descBinding._mtlBuffers[rezIdx];
bb.offset = descBinding._mtlBufferOffsets[rezIdx] + bufferDynamicOffset;
bb.size = (uint32_t)((MVKBuffer*)descBinding._bufferBindings[rezIdx].buffer)->getByteCount();
bb.size = mvkBuff ? (uint32_t)mvkBuff->getByteCount() : 0;
for (uint32_t i = kMVKShaderStageVertex; i < kMVKShaderStageMax; i++) {
if (_applyToStage[i]) {
bb.index = mtlIdxs.stages[i].bufferIndex + rezIdx;
Expand Down
35 changes: 16 additions & 19 deletions MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -221,21 +221,25 @@
return VK_ERROR_FORMAT_NOT_SUPPORTED;
}

bool hasAttachmentUsage = mvkIsAnyFlagEnabled(usage, (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT |
VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT |
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT));

VkPhysicalDeviceLimits* pLimits = &_properties.limits;
VkExtent3D maxExt;
uint32_t maxLayers;
uint32_t maxLevels;
uint32_t maxLayers = hasAttachmentUsage ? pLimits->maxFramebufferLayers : pLimits->maxImageArrayLayers;

VkSampleCountFlags sampleCounts = _metalFeatures.supportedSampleCounts;
switch (type) {
case VK_IMAGE_TYPE_1D:
// Metal does not allow 1D textures to be used as attachments
if (mvkIsAnyFlagEnabled(usage, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) {
return VK_ERROR_FORMAT_NOT_SUPPORTED;
}
if (hasAttachmentUsage) { return VK_ERROR_FORMAT_NOT_SUPPORTED; }

// Metal does not allow linear tiling on 1D textures
if (tiling == VK_IMAGE_TILING_LINEAR) {
return VK_ERROR_FORMAT_NOT_SUPPORTED;
}
if (tiling == VK_IMAGE_TILING_LINEAR) { return VK_ERROR_FORMAT_NOT_SUPPORTED; }

// Metal does not allow compressed or depth/stencil formats on 1D textures
if (mvkFormatTypeFromVkFormat(format) == kMVKFormatDepthStencil ||
mvkFormatTypeFromVkFormat(format) == kMVKFormatCompressed) {
Expand All @@ -245,7 +249,6 @@
maxExt.height = 1;
maxExt.depth = 1;
maxLevels = 1;
maxLayers = pLimits->maxImageArrayLayers;
sampleCounts = VK_SAMPLE_COUNT_1_BIT;
break;
case VK_IMAGE_TYPE_2D:
Expand All @@ -265,16 +268,12 @@
return VK_ERROR_FORMAT_NOT_SUPPORTED;
}
#if MVK_MACOS
// - On macOS, they may not be used as framebuffer attachments.
if (mvkIsAnyFlagEnabled(usage, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT|VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT|VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT|VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) ) {
return VK_ERROR_FORMAT_NOT_SUPPORTED;
}
// - On macOS, Linear textures may not be used as framebuffer attachments.
if (hasAttachmentUsage) { return VK_ERROR_FORMAT_NOT_SUPPORTED; }
#endif
// - They may only have one mip level.
// Linear textures may only have one mip level. layer & sample
maxLevels = 1;
// - They may only have one layer.
maxLayers = 1;
// - They may not be multisampled.
sampleCounts = VK_SAMPLE_COUNT_1_BIT;
} else {
VkFormatProperties fmtProps;
Expand All @@ -288,7 +287,6 @@
sampleCounts = VK_SAMPLE_COUNT_1_BIT;
}
maxLevels = mvkMipmapLevels3D(maxExt);
maxLayers = pLimits->maxImageArrayLayers;
}
break;
case VK_IMAGE_TYPE_3D:
Expand Down Expand Up @@ -320,9 +318,8 @@
break;
default:
// Metal does not allow linear tiling on anything but 2D textures
if (tiling == VK_IMAGE_TILING_LINEAR) {
return VK_ERROR_FORMAT_NOT_SUPPORTED;
}
if (tiling == VK_IMAGE_TILING_LINEAR) { return VK_ERROR_FORMAT_NOT_SUPPORTED; }

// Metal does not allow compressed or depth/stencil formats on anything but 2D textures
if (mvkFormatTypeFromVkFormat(format) == kMVKFormatDepthStencil ||
mvkFormatTypeFromVkFormat(format) == kMVKFormatCompressed) {
Expand Down
2 changes: 1 addition & 1 deletion MoltenVK/MoltenVK/GPUObjects/MVKRenderPass.mm
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
} else if ( isRenderingEntireAttachment && (subpass->_subpassIndex == _firstUseSubpassIdx) ) {
VkAttachmentLoadOp loadOp = isStencil ? _info.stencilLoadOp : _info.loadOp;
mtlAttDesc.loadAction = mvkMTLLoadActionFromVkAttachmentLoadOp(loadOp);
willClear = (_info.loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR);
willClear = (loadOp == VK_ATTACHMENT_LOAD_OP_CLEAR);
} else {
mtlAttDesc.loadAction = MTLLoadActionLoad;
}
Expand Down

0 comments on commit 00c86d8

Please sign in to comment.