Advertise support for extension VK_KHR_spirv_1_4.

- Advertise support for extension VK_KHR_spirv_1_4.
- MoltenVKShaderConverter automatically map bindings when converting GLSL.
- MoltenVKShaderConverter improvements to diagnostic logging.
- Update Whats_New.md document.
This commit is contained in:
Bill Hollings 2022-09-23 11:43:32 -04:00
parent 73a3faa13b
commit 31a77834f1
6 changed files with 23 additions and 7 deletions

View File

@ -292,6 +292,7 @@ In addition to core *Vulkan* functionality, **MoltenVK** also supports the foll
- `VK_KHR_shader_float_controls`
- `VK_KHR_shader_float16_int8`
- `VK_KHR_shader_subgroup_extended_types` *(requires Metal 2.1 on Mac or Metal 2.2 and Apple family 4 on iOS)*
- `VK_KHR_spirv_1_4`
- `VK_KHR_storage_buffer_storage_class`
- `VK_KHR_surface`
- `VK_KHR_swapchain`

View File

@ -20,6 +20,7 @@ Released TBD
- Add support for extensions:
- `VK_KHR_shader_float_controls`
- `VK_KHR_spirv_1_4`
- Vulkan semaphore functional improvements:
- Replace use of `MTLFence` with an option to limit to a single Vulkan queue and use Metal's implicit submisison order guarantees.
- Support option to force use of `MTLEvents` for Vulkan semaphores on NVIDIA and Rosetta2.
@ -29,7 +30,9 @@ Released TBD
is now an enum field. The use of Metal argument buffers is still disabled by default (`MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS_NEVER`).
- Fix occassional crash from retention of `MVKSwapchain` for future drawable presentations.
- Fix undefined reference to `vkGetBufferDeviceAddressEXT` when building with `MVK_HIDE_VULKAN_SYMBOLS=1`.
- Update `Makefile` to forward any build setting declared on the command line to Xcode.
- Add `MVK_USE_CEREAL` build setting to avoid use of Cereal external library (for pipeline caching).
- `MoltenVKShaderConverter` tool automatically map bindings when converting _GLSL_.
- Update `VK_MVK_MOLTENVK_SPEC_VERSION` to version `36`.

View File

@ -81,6 +81,7 @@ MVK_EXTENSION(KHR_shader_draw_parameters, KHR_SHADER_DRAW_PARAMETERS,
MVK_EXTENSION(KHR_shader_float_controls, KHR_SHADER_FLOAT_CONTROLS, DEVICE, 10.11, 8.0)
MVK_EXTENSION(KHR_shader_float16_int8, KHR_SHADER_FLOAT16_INT8, DEVICE, 10.11, 8.0)
MVK_EXTENSION(KHR_shader_subgroup_extended_types, KHR_SHADER_SUBGROUP_EXTENDED_TYPES, DEVICE, 10.14, 13.0)
MVK_EXTENSION(KHR_spirv_1_4, KHR_SPIRV_1_4, DEVICE, 10.11, 8.0)
MVK_EXTENSION(KHR_storage_buffer_storage_class, KHR_STORAGE_BUFFER_STORAGE_CLASS, DEVICE, 10.11, 8.0)
MVK_EXTENSION(KHR_surface, KHR_SURFACE, INSTANCE, 10.11, 8.0)
MVK_EXTENSION(KHR_swapchain, KHR_SWAPCHAIN, DEVICE, 10.11, 8.0)

View File

@ -97,7 +97,7 @@
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "2.1"
argument = "2.4"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument

View File

@ -76,6 +76,7 @@ MVK_PUBLIC_SYMBOL bool GLSLToSPIRVConverter::convert(MVKGLSLConversionShaderStag
// Create and compile a shader from the source code
glslShaders.emplace_back(new glslang::TShader(stage));
glslShaders.back()->setStrings(glslStrings, 1);
glslShaders.back()->setAutoMapBindings(true);
if (glslShaders.back()->parse(&glslCompilerResources, 100, false, messages)) {
if (shouldLogGLSL) {
logMsg(glslShaders.back()->getInfoLog());

View File

@ -20,6 +20,7 @@
#include "MVKStrings.h"
#include <spirv.hpp>
#include <ostream>
#include <sstream>
#import <CoreFoundation/CFByteOrder.h>
@ -97,16 +98,25 @@ void mvk::logSPIRV(vector<uint32_t>& spirv, string& spvLog) {
uint32_t options = (SPV_BINARY_TO_TEXT_OPTION_INDENT);
spv_text text;
spv_diagnostic diagnostic = nullptr;
spv_context context = spvContextCreate(SPV_ENV_VULKAN_1_0);
spv_context context = spvContextCreate(SPV_ENV_VULKAN_1_2);
spv_result_t error = spvBinaryToText(context, spirv.data(), spirv.size(), options, &text, &diagnostic);
spvContextDestroy(context);
if (error) {
spvDiagnosticPrint(diagnostic);
if (diagnostic) {
// Cribbed from spvDiagnosticPrint()
stringstream diagMsgOut;
diagMsgOut << "\nSPIR-V error (" << error << ") at ";
if (diagnostic->isTextSource) {
diagMsgOut << "line: " << diagnostic->position.line + 1 << " col: " << diagnostic->position.column + 1 << ": ";
} else {
diagMsgOut << "index: " << diagnostic->position.index << ": ";
}
diagMsgOut << diagnostic->error << "\n";
spvLog.append(diagMsgOut.str());
spvDiagnosticDestroy(diagnostic);
return;
} else {
spvLog.append(text->str, text->length);
spvTextDestroy(text);
}
spvLog.append(text->str, text->length);
spvTextDestroy(text);
}
#endif