Merge pull request #108 from billhollings/master
SPIRV entry points, streamline integration with V-LVL & v1.0.1.
This commit is contained in:
commit
18fa813fc4
17
External/README.md
vendored
17
External/README.md
vendored
@ -127,8 +127,7 @@ if you encounter any linking errors, may need to re-add the *SPIRV-Cross* librar
|
||||
2. In the *Finder*, right-click your `MoltenVKShaderConverter.xcodeproj` file and select
|
||||
**_Show Package Contents_**.
|
||||
3. Open the `project.pbxproj` file in a text editor.
|
||||
4. Replace all occurrences of the `path-to-SPIRV-Cross-repo-folder` with simply
|
||||
`SPIRV-Cross`.
|
||||
4. Remove all occurrences of `path-to-SPIRV-Cross-repo-folder` from the paths to the files added above.
|
||||
|
||||
|
||||
### Regression Testing Your Changes to *SPIRV-Cross*
|
||||
@ -174,10 +173,10 @@ if you encounter any linking errors, may need to re-add the *SPIRV-Tools* librar
|
||||
*Build Settings* tab. Locate the build setting entry **Header Search Paths**
|
||||
(`HEADER_SEARCH_PATHS`) and add the following paths:
|
||||
|
||||
"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/include"
|
||||
"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/source"
|
||||
"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/build"
|
||||
"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Headers/include"
|
||||
"$(SRCROOT)/../External/glslang/External/spirv-tools/include"
|
||||
"$(SRCROOT)/../External/glslang/External/spirv-tools/source"
|
||||
"$(SRCROOT)/../External/glslang/External/spirv-tools/external/spirv-headers/include"
|
||||
"$(SRCROOT)/../External/glslang/build/External/spirv-tools"
|
||||
|
||||
5. ***(Optional)*** To simplify the paths used within *Xcode* to reference the added files,
|
||||
perform the following steps:
|
||||
@ -186,7 +185,8 @@ if you encounter any linking errors, may need to re-add the *SPIRV-Tools* librar
|
||||
2. In the *Finder*, right-click your `MoltenVKShaderConverter.xcodeproj` file and select
|
||||
**_Show Package Contents_**.
|
||||
3. Open the `project.pbxproj` file in a text editor.
|
||||
4. Replace all occurrences of the `path-to-SPIRV-Tools-repo-folder/source` with simply `source`.
|
||||
4. Remove all occurrences of `path-to-SPIRV-Tools-repo-folder` from the paths to the
|
||||
`source` directory added above.
|
||||
|
||||
|
||||
|
||||
@ -225,6 +225,7 @@ if you encounter any linking errors, may need to re-add the *glslang* library to
|
||||
2. In the *Finder*, right-click your `MoltenVKShaderConverter.xcodeproj` file and select
|
||||
**_Show Package Contents_**.
|
||||
3. Open the `project.pbxproj` file in a text editor.
|
||||
4. Replace all occurrences of the `path-to-glslang-repo-folder` with simply `glslang `.
|
||||
4. Remove all occurrences of `path-to-glslang-repo-folder` from the paths to the
|
||||
`glslang`, `OGLCompilersDLL`, and `SPIRV` directories added above.
|
||||
|
||||
|
||||
|
2
External/SPIRV-Cross_repo_revision
vendored
2
External/SPIRV-Cross_repo_revision
vendored
@ -1 +1 @@
|
||||
0f9cb0da0d5ab91b21a42ffc0062840fc76e81e3
|
||||
5161d5ed3b5a788c2469bb548fbb6001f98c03fa
|
||||
|
@ -1 +1 @@
|
||||
6d3938172cba2d9235f258efa1db1c16443c66c6
|
||||
78ae9ec027bfad5d2ace2fce7d82c4e364c6b22c
|
||||
|
17
External/fetchDependencies
vendored
17
External/fetchDependencies
vendored
@ -47,7 +47,6 @@ echo
|
||||
|
||||
V_LVL_NAME=Vulkan-LoaderAndValidationLayers
|
||||
GLSLANG_NAME=glslang
|
||||
SPIRV_TOOLS_NAME=SPIRV-Tools
|
||||
|
||||
# ----------------- SPIRV-Cross -------------------
|
||||
|
||||
@ -67,20 +66,6 @@ REPO_REV=$(cat "./${REPO_NAME}_repo_revision")
|
||||
clone_repo ${REPO_NAME} ${REPO_URL} ${REPO_REV}
|
||||
|
||||
|
||||
# ----------------- SPIRV-Tools -------------------
|
||||
|
||||
REPO_NAME=${SPIRV_TOOLS_NAME}
|
||||
rm -rf ${REPO_NAME}
|
||||
ln -sfn ${GLSLANG_NAME}/External/spirv-tools ${REPO_NAME}
|
||||
|
||||
|
||||
# ----------------- SPIRV-Headers -------------------
|
||||
|
||||
REPO_NAME=SPIRV-Headers
|
||||
rm -rf ${REPO_NAME}
|
||||
ln -sfn ${SPIRV_TOOLS_NAME}/external/spirv-headers ${REPO_NAME}
|
||||
|
||||
|
||||
# ----------------- Vulkan-LoaderAndValidationLayers, glslang, SPIRV-Tools & SPIRV-Headers -------------------
|
||||
|
||||
# When MoltenVK is loaded as a dependency of the LunarG SDK, the LunarG SDK already
|
||||
@ -120,7 +105,5 @@ else
|
||||
|
||||
build_repo ${GLSLANG_NAME}
|
||||
|
||||
build_repo ${SPIRV_TOOLS_NAME}
|
||||
|
||||
fi
|
||||
|
||||
|
@ -48,7 +48,7 @@ extern "C" {
|
||||
*/
|
||||
#define MVK_VERSION_MAJOR 1
|
||||
#define MVK_VERSION_MINOR 0
|
||||
#define MVK_VERSION_PATCH 0
|
||||
#define MVK_VERSION_PATCH 1
|
||||
|
||||
#define MVK_MAKE_VERSION(major, minor, patch) (((major) * 10000) + ((minor) * 100) + (patch))
|
||||
#define MVK_VERSION MVK_MAKE_VERSION(MVK_VERSION_MAJOR, MVK_VERSION_MINOR, MVK_VERSION_PATCH)
|
||||
|
@ -264,17 +264,20 @@ MTLRenderPipelineDescriptor* MVKGraphicsPipeline::getMTLRenderPipelineDescriptor
|
||||
// Add shader stages
|
||||
for (uint32_t i = 0; i < pCreateInfo->stageCount; i++) {
|
||||
const VkPipelineShaderStageCreateInfo* pSS = &pCreateInfo->pStages[i];
|
||||
shaderContext.options.entryPointName = pSS->pName;
|
||||
|
||||
MVKShaderModule* mvkShdrMod = (MVKShaderModule*)pSS->module;
|
||||
|
||||
// Vertex shader
|
||||
if (mvkAreFlagsEnabled(pSS->stage, VK_SHADER_STAGE_VERTEX_BIT)) {
|
||||
plDesc.vertexFunction = mvkShdrMod->getMTLFunction(pSS, &shaderContext).mtlFunction;
|
||||
shaderContext.options.entryPointStage = spv::ExecutionModelVertex;
|
||||
plDesc.vertexFunction = mvkShdrMod->getMTLFunction(&shaderContext, pSS->pSpecializationInfo).mtlFunction;
|
||||
}
|
||||
|
||||
// Fragment shader
|
||||
if (mvkAreFlagsEnabled(pSS->stage, VK_SHADER_STAGE_FRAGMENT_BIT)) {
|
||||
plDesc.fragmentFunction = mvkShdrMod->getMTLFunction(pSS, &shaderContext).mtlFunction;
|
||||
shaderContext.options.entryPointStage = spv::ExecutionModelFragment;
|
||||
plDesc.fragmentFunction = mvkShdrMod->getMTLFunction(&shaderContext, pSS->pSpecializationInfo).mtlFunction;
|
||||
}
|
||||
}
|
||||
|
||||
@ -426,13 +429,15 @@ MVKMTLFunction MVKComputePipeline::getMTLFunction(const VkComputePipelineCreateI
|
||||
if ( !mvkAreFlagsEnabled(pSS->stage, VK_SHADER_STAGE_COMPUTE_BIT) ) { return MVKMTLFunctionNull; }
|
||||
|
||||
SPIRVToMSLConverterContext shaderContext;
|
||||
shaderContext.options.entryPointName = pCreateInfo->stage.pName;
|
||||
shaderContext.options.entryPointStage = spv::ExecutionModelGLCompute;
|
||||
shaderContext.options.mslVersion = _device->_pMetalFeatures->mslVersion;
|
||||
|
||||
MVKPipelineLayout* layout = (MVKPipelineLayout*)pCreateInfo->layout;
|
||||
layout->populateShaderConverterContext(shaderContext);
|
||||
|
||||
MVKShaderModule* mvkShdrMod = (MVKShaderModule*)pSS->module;
|
||||
return mvkShdrMod->getMTLFunction(pSS, &shaderContext);
|
||||
return mvkShdrMod->getMTLFunction(&shaderContext, pSS->pSpecializationInfo);
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,8 +44,8 @@ extern const MVKMTLFunction MVKMTLFunctionNull;
|
||||
class MVKShaderLibrary : public MVKBaseDeviceObject {
|
||||
|
||||
public:
|
||||
/** Returns the Metal shader function used by the specified shader state. */
|
||||
MVKMTLFunction getMTLFunction(const VkPipelineShaderStageCreateInfo* pShaderStage);
|
||||
/** Returns the Metal shader function, possibly specialized. */
|
||||
MVKMTLFunction getMTLFunction(const VkSpecializationInfo* pSpecializationInfo);
|
||||
|
||||
/** Constructs an instance from the MSL source code in the specified SPIRVToMSLConverter. */
|
||||
MVKShaderLibrary(MVKDevice* device, SPIRVToMSLConverter& mslConverter);
|
||||
@ -62,7 +62,7 @@ protected:
|
||||
MTLFunctionConstant* getFunctionConstant(NSArray<MTLFunctionConstant*>* mtlFCs, NSUInteger mtlFCID);
|
||||
|
||||
id<MTLLibrary> _mtlLibrary;
|
||||
SPIRVEntryPointsByName _entryPoints;
|
||||
SPIRVEntryPoint _entryPoint;
|
||||
};
|
||||
|
||||
|
||||
@ -73,9 +73,9 @@ protected:
|
||||
class MVKShaderModule : public MVKBaseDeviceObject {
|
||||
|
||||
public:
|
||||
/** Returns the Metal shader function used by the specified shader state, or nil if it doesn't exist. */
|
||||
MVKMTLFunction getMTLFunction(const VkPipelineShaderStageCreateInfo* pShaderStage,
|
||||
SPIRVToMSLConverterContext* pContext);
|
||||
/** Returns the Metal shader function, possibly specialized. */
|
||||
MVKMTLFunction getMTLFunction(SPIRVToMSLConverterContext* pContext,
|
||||
const VkSpecializationInfo* pSpecializationInfo);
|
||||
|
||||
MVKShaderModule(MVKDevice* device, const VkShaderModuleCreateInfo* pCreateInfo);
|
||||
|
||||
|
@ -39,14 +39,13 @@ static uint32_t getOffsetForConstantId(const VkSpecializationInfo* pSpecInfo, ui
|
||||
return -1;
|
||||
}
|
||||
|
||||
MVKMTLFunction MVKShaderLibrary::getMTLFunction(const VkPipelineShaderStageCreateInfo* pShaderStage) {
|
||||
MVKMTLFunction MVKShaderLibrary::getMTLFunction(const VkSpecializationInfo* pSpecializationInfo) {
|
||||
|
||||
if ( !_mtlLibrary ) { return MVKMTLFunctionNull; }
|
||||
|
||||
// Ensure the function name is compatible with Metal (Metal does not allow main()
|
||||
// as a function name), and retrieve the unspecialized Metal function with that name.
|
||||
SPIRVEntryPoint& ep = _entryPoints[pShaderStage->pName];
|
||||
NSString* mtlFuncName = @(ep.mtlFunctionName.c_str());
|
||||
NSString* mtlFuncName = @(_entryPoint.mtlFunctionName.c_str());
|
||||
|
||||
uint64_t startTime = _device->getPerformanceTimestamp();
|
||||
id<MTLFunction> mtlFunc = [[_mtlLibrary newFunctionWithName: mtlFuncName] autorelease];
|
||||
@ -64,16 +63,15 @@ MVKMTLFunction MVKShaderLibrary::getMTLFunction(const VkPipelineShaderStageCreat
|
||||
// The Metal shader contains function constants and expects to be specialized
|
||||
// Populate the Metal function constant values from the Vulkan specialization info.
|
||||
MTLFunctionConstantValues* mtlFCVals = [[MTLFunctionConstantValues new] autorelease];
|
||||
const VkSpecializationInfo* pSpecInfo = pShaderStage->pSpecializationInfo;
|
||||
if (pSpecInfo) {
|
||||
if (pSpecializationInfo) {
|
||||
// Iterate through the provided Vulkan specialization entries, and populate the
|
||||
// Metal function constant value that matches the Vulkan specialization constantID.
|
||||
for (uint32_t specIdx = 0; specIdx < pSpecInfo->mapEntryCount; specIdx++) {
|
||||
const VkSpecializationMapEntry* pMapEntry = &pSpecInfo->pMapEntries[specIdx];
|
||||
for (uint32_t specIdx = 0; specIdx < pSpecializationInfo->mapEntryCount; specIdx++) {
|
||||
const VkSpecializationMapEntry* pMapEntry = &pSpecializationInfo->pMapEntries[specIdx];
|
||||
NSUInteger mtlFCIndex = pMapEntry->constantID;
|
||||
MTLFunctionConstant* mtlFC = getFunctionConstant(mtlFCs, mtlFCIndex);
|
||||
if (mtlFC) {
|
||||
[mtlFCVals setConstantValue: &(((char*)pSpecInfo->pData)[pMapEntry->offset])
|
||||
[mtlFCVals setConstantValue: &(((char*)pSpecializationInfo->pData)[pMapEntry->offset])
|
||||
type: mtlFC.type
|
||||
atIndex: mtlFCIndex];
|
||||
}
|
||||
@ -90,29 +88,28 @@ MVKMTLFunction MVKShaderLibrary::getMTLFunction(const VkPipelineShaderStageCreat
|
||||
} else {
|
||||
mvkNotifyErrorWithText(VK_ERROR_INITIALIZATION_FAILED, "Shader module does not contain an entry point named '%s'.", mtlFuncName.UTF8String);
|
||||
}
|
||||
|
||||
const VkSpecializationInfo* pSpecInfo = pShaderStage->pSpecializationInfo;
|
||||
if (pSpecInfo) {
|
||||
|
||||
if (pSpecializationInfo) {
|
||||
// Get the specialization constant values for the work group size
|
||||
if (ep.workgroupSizeId.constant != 0) {
|
||||
uint32_t widthOffset = getOffsetForConstantId(pSpecInfo, ep.workgroupSizeId.width);
|
||||
if (_entryPoint.workgroupSizeId.constant != 0) {
|
||||
uint32_t widthOffset = getOffsetForConstantId(pSpecializationInfo, _entryPoint.workgroupSizeId.width);
|
||||
if (widthOffset != -1) {
|
||||
ep.workgroupSize.width = *reinterpret_cast<uint32_t*>((uint8_t*)pSpecInfo->pData + widthOffset);
|
||||
_entryPoint.workgroupSize.width = *reinterpret_cast<uint32_t*>((uint8_t*)pSpecializationInfo->pData + widthOffset);
|
||||
}
|
||||
|
||||
uint32_t heightOffset = getOffsetForConstantId(pSpecInfo, ep.workgroupSizeId.height);
|
||||
|
||||
uint32_t heightOffset = getOffsetForConstantId(pSpecializationInfo, _entryPoint.workgroupSizeId.height);
|
||||
if (heightOffset != -1) {
|
||||
ep.workgroupSize.height = *reinterpret_cast<uint32_t*>((uint8_t*)pSpecInfo->pData + heightOffset);
|
||||
_entryPoint.workgroupSize.height = *reinterpret_cast<uint32_t*>((uint8_t*)pSpecializationInfo->pData + heightOffset);
|
||||
}
|
||||
|
||||
uint32_t depthOffset = getOffsetForConstantId(pSpecInfo, ep.workgroupSizeId.depth);
|
||||
|
||||
uint32_t depthOffset = getOffsetForConstantId(pSpecializationInfo, _entryPoint.workgroupSizeId.depth);
|
||||
if (depthOffset != -1) {
|
||||
ep.workgroupSize.depth = *reinterpret_cast<uint32_t*>((uint8_t*)pSpecInfo->pData + depthOffset);
|
||||
_entryPoint.workgroupSize.depth = *reinterpret_cast<uint32_t*>((uint8_t*)pSpecializationInfo->pData + depthOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { mtlFunc, MTLSizeMake(ep.workgroupSize.width, ep.workgroupSize.height, ep.workgroupSize.depth) };
|
||||
return { mtlFunc, MTLSizeMake(_entryPoint.workgroupSize.width, _entryPoint.workgroupSize.height, _entryPoint.workgroupSize.depth) };
|
||||
}
|
||||
|
||||
// Returns the MTLFunctionConstant with the specified ID from the specified array of function constants.
|
||||
@ -134,7 +131,7 @@ MVKShaderLibrary::MVKShaderLibrary(MVKDevice* device, SPIRVToMSLConverter& mslCo
|
||||
}
|
||||
_device->addShaderCompilationEventPerformance(_device->_shaderCompilationPerformance.mslCompile, startTime);
|
||||
|
||||
_entryPoints = mslConverter.getEntryPoints();
|
||||
_entryPoint = mslConverter.getEntryPoint();
|
||||
}
|
||||
|
||||
MVKShaderLibrary::MVKShaderLibrary(MVKDevice* device,
|
||||
@ -179,11 +176,11 @@ MVKShaderLibrary::~MVKShaderLibrary() {
|
||||
#pragma mark -
|
||||
#pragma mark MVKShaderModule
|
||||
|
||||
MVKMTLFunction MVKShaderModule::getMTLFunction(const VkPipelineShaderStageCreateInfo* pShaderStage,
|
||||
SPIRVToMSLConverterContext* pContext) {
|
||||
MVKMTLFunction MVKShaderModule::getMTLFunction(SPIRVToMSLConverterContext* pContext,
|
||||
const VkSpecializationInfo* pSpecializationInfo) {
|
||||
lock_guard<mutex> lock(_accessLock);
|
||||
MVKShaderLibrary* mvkLib = getShaderLibrary(pContext);
|
||||
return mvkLib ? mvkLib->getMTLFunction(pShaderStage) : MVKMTLFunctionNull;
|
||||
return mvkLib ? mvkLib->getMTLFunction(pSpecializationInfo) : MVKMTLFunctionNull;
|
||||
}
|
||||
|
||||
MVKShaderLibrary* MVKShaderModule::getShaderLibrary(SPIRVToMSLConverterContext* pContext) {
|
||||
@ -200,7 +197,7 @@ MVKShaderLibrary* MVKShaderModule::getShaderLibrary(SPIRVToMSLConverterContext*
|
||||
MVKShaderLibrary* MVKShaderModule::findShaderLibrary(SPIRVToMSLConverterContext* pContext) {
|
||||
for (auto& slPair : _shaderLibraries) {
|
||||
if (slPair.first.matches(*pContext)) {
|
||||
(*pContext).alignUsageWith(slPair.first);
|
||||
pContext->alignUsageWith(slPair.first);
|
||||
return slPair.second;
|
||||
}
|
||||
}
|
||||
@ -248,8 +245,7 @@ MVKShaderModule::MVKShaderModule(MVKDevice* device,
|
||||
}
|
||||
case kMVKMagicNumberMSLSourceCode: { // MSL source code
|
||||
uintptr_t pMSLCode = uintptr_t(pCreateInfo->pCode) + sizeof(MVKMSLSPIRVHeader);
|
||||
SPIRVEntryPointsByName entryPoints;
|
||||
_converter.setMSL((char*)pMSLCode, entryPoints);
|
||||
_converter.setMSL((char*)pMSLCode, nullptr);
|
||||
_defaultLibrary = new MVKShaderLibrary(_device, _converter);
|
||||
break;
|
||||
}
|
||||
|
@ -157,18 +157,22 @@ void MVKSwapchain::markFrameInterval() {
|
||||
_performanceStatistics.averageFrameInterval += _averageFrameIntervalFilterAlpha * (_performanceStatistics.lastFrameInterval - _performanceStatistics.averageFrameInterval);
|
||||
_performanceStatistics.averageFramesPerSecond = 1000.0 / _performanceStatistics.averageFrameInterval;
|
||||
|
||||
// Uncomment for per-frame logging.
|
||||
// MVKLogDebug("Frame interval: %.2f ms. Avg frame interval: %.2f ms. Frame number: %d.",
|
||||
// _performanceStatistics.lastFrameInterval,
|
||||
// _performanceStatistics.averageFrameInterval,
|
||||
// _currentPerfLogFrameCount + 1);
|
||||
|
||||
uint32_t perfLogCntLimit = _device->_mvkConfig.performanceLoggingFrameCount;
|
||||
if (perfLogCntLimit > 0) {
|
||||
_currentPerfLogFrameCount++;
|
||||
if (_currentPerfLogFrameCount >= perfLogCntLimit) {
|
||||
MVKLogInfo("Frame interval: %.2f ms. Avg frame interval: %.2f ms. FPS: %.2f. Elapsed time: %.3f seconds.",
|
||||
_performanceStatistics.lastFrameInterval,
|
||||
_performanceStatistics.averageFrameInterval,
|
||||
_performanceStatistics.averageFramesPerSecond,
|
||||
mvkGetElapsedMilliseconds() / 1000.0);
|
||||
_currentPerfLogFrameCount = 0;
|
||||
}
|
||||
}
|
||||
if ((perfLogCntLimit > 0) && (++_currentPerfLogFrameCount >= perfLogCntLimit)) {
|
||||
_currentPerfLogFrameCount = 0;
|
||||
MVKLogInfo("Frame interval: %.2f ms. Avg frame interval: %.2f ms. Avg FPS: %.2f. Reporting every: %d frames. Elapsed time: %.3f seconds.",
|
||||
_performanceStatistics.lastFrameInterval,
|
||||
_performanceStatistics.averageFrameInterval,
|
||||
_performanceStatistics.averageFramesPerSecond,
|
||||
perfLogCntLimit,
|
||||
mvkGetElapsedMilliseconds() / 1000.0);
|
||||
}
|
||||
}
|
||||
|
||||
void MVKSwapchain::getPerformanceStatistics(MVKSwapchainPerformance* pSwapchainPerf) {
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "SPIRVToMSLConverter.h"
|
||||
#include "MVKStrings.h"
|
||||
#include "GlslangToSpv.h"
|
||||
#include "glslang/SPIRV/disassemble.h"
|
||||
#include "../../External/glslang/SPIRV/disassemble.h"
|
||||
#include "doc.h"
|
||||
#include <sstream>
|
||||
|
||||
@ -43,8 +43,8 @@ MVK_PUBLIC_SYMBOL void GLSLToSPIRVConverter::setGLSL(const string& glslSrc) { _g
|
||||
MVK_PUBLIC_SYMBOL const string& GLSLToSPIRVConverter::getGLSL() { return _glsl; }
|
||||
|
||||
MVK_PUBLIC_SYMBOL bool GLSLToSPIRVConverter::convert(MVKShaderStage shaderStage,
|
||||
bool shouldLogGLSL,
|
||||
bool shouldLogSPIRV) {
|
||||
bool shouldLogGLSL,
|
||||
bool shouldLogSPIRV) {
|
||||
_wasConverted = true;
|
||||
_resultLog.clear();
|
||||
_spirv.clear();
|
||||
|
@ -1 +0,0 @@
|
||||
../../External/glslang
|
@ -1 +0,0 @@
|
||||
../../External/SPIRV-Cross
|
@ -1 +0,0 @@
|
||||
../../External/SPIRV-Headers
|
@ -1 +0,0 @@
|
||||
../../External/SPIRV-Tools
|
@ -21,7 +21,6 @@
|
||||
#include "MVKStrings.h"
|
||||
#include "FileSupport.h"
|
||||
#include "spirv_msl.hpp"
|
||||
#include "spirv_glsl.hpp"
|
||||
#include <spirv-tools/libspirv.h>
|
||||
#import <CoreFoundation/CFByteOrder.h>
|
||||
|
||||
@ -34,19 +33,21 @@ using namespace std;
|
||||
|
||||
// Returns whether the vector contains the value (using a matches(T&) comparison member function). */
|
||||
template<class T>
|
||||
bool contains(vector<T>& vec, T& val) {
|
||||
for (T& vecVal : vec) { if (vecVal.matches(val)) { return true; } }
|
||||
bool contains(const vector<T>& vec, const T& val) {
|
||||
for (const T& vecVal : vec) { if (vecVal.matches(val)) { return true; } }
|
||||
return false;
|
||||
}
|
||||
|
||||
MVK_PUBLIC_SYMBOL bool SPIRVToMSLConverterOptions::matches(SPIRVToMSLConverterOptions& other) {
|
||||
MVK_PUBLIC_SYMBOL bool SPIRVToMSLConverterOptions::matches(const SPIRVToMSLConverterOptions& other) const {
|
||||
if (entryPointStage != other.entryPointStage) { return false; }
|
||||
if (mslVersion != other.mslVersion) { return false; }
|
||||
if (!!shouldFlipVertexY != !!other.shouldFlipVertexY) { return false; }
|
||||
if (!!isRenderingPoints != !!other.isRenderingPoints) { return false; }
|
||||
if (entryPointName != other.entryPointName) { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
MVK_PUBLIC_SYMBOL bool MSLVertexAttribute::matches(MSLVertexAttribute& other) {
|
||||
MVK_PUBLIC_SYMBOL bool MSLVertexAttribute::matches(const MSLVertexAttribute& other) const {
|
||||
if (location != other.location) { return false; }
|
||||
if (mslBuffer != other.mslBuffer) { return false; }
|
||||
if (mslOffset != other.mslOffset) { return false; }
|
||||
@ -55,7 +56,7 @@ MVK_PUBLIC_SYMBOL bool MSLVertexAttribute::matches(MSLVertexAttribute& other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
MVK_PUBLIC_SYMBOL bool MSLResourceBinding::matches(MSLResourceBinding& other) {
|
||||
MVK_PUBLIC_SYMBOL bool MSLResourceBinding::matches(const MSLResourceBinding& other) const {
|
||||
if (stage != other.stage) { return false; }
|
||||
if (descriptorSet != other.descriptorSet) { return false; }
|
||||
if (binding != other.binding) { return false; }
|
||||
@ -66,7 +67,7 @@ MVK_PUBLIC_SYMBOL bool MSLResourceBinding::matches(MSLResourceBinding& other) {
|
||||
}
|
||||
|
||||
// Check them all in case inactive VA's duplicate locations used by active VA's.
|
||||
MVK_PUBLIC_SYMBOL bool SPIRVToMSLConverterContext::isVertexAttributeLocationUsed(uint32_t location) {
|
||||
MVK_PUBLIC_SYMBOL bool SPIRVToMSLConverterContext::isVertexAttributeLocationUsed(uint32_t location) const {
|
||||
for (auto& va : vertexAttributes) {
|
||||
if ((va.location == location) && va.isUsedByShader) { return true; }
|
||||
}
|
||||
@ -74,22 +75,22 @@ MVK_PUBLIC_SYMBOL bool SPIRVToMSLConverterContext::isVertexAttributeLocationUsed
|
||||
}
|
||||
|
||||
// Check them all in case inactive VA's duplicate buffers used by active VA's.
|
||||
MVK_PUBLIC_SYMBOL bool SPIRVToMSLConverterContext::isVertexBufferUsed(uint32_t mslBuffer) {
|
||||
MVK_PUBLIC_SYMBOL bool SPIRVToMSLConverterContext::isVertexBufferUsed(uint32_t mslBuffer) const {
|
||||
for (auto& va : vertexAttributes) {
|
||||
if ((va.mslBuffer == mslBuffer) && va.isUsedByShader) { return true; }
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
MVK_PUBLIC_SYMBOL bool SPIRVToMSLConverterContext::matches(SPIRVToMSLConverterContext& other) {
|
||||
MVK_PUBLIC_SYMBOL bool SPIRVToMSLConverterContext::matches(const SPIRVToMSLConverterContext& other) const {
|
||||
|
||||
if ( !options.matches(other.options) ) { return false; }
|
||||
|
||||
for (auto& va : vertexAttributes) {
|
||||
for (const auto& va : vertexAttributes) {
|
||||
if (va.isUsedByShader && !contains(other.vertexAttributes, va)) { return false; }
|
||||
}
|
||||
|
||||
for (auto& rb : resourceBindings) {
|
||||
for (const auto& rb : resourceBindings) {
|
||||
if (rb.isUsedByShader && !contains(other.resourceBindings, rb)) { return false; }
|
||||
}
|
||||
|
||||
@ -97,7 +98,7 @@ MVK_PUBLIC_SYMBOL bool SPIRVToMSLConverterContext::matches(SPIRVToMSLConverterCo
|
||||
}
|
||||
|
||||
// Aligns the usage of the destination context to that of the source context.
|
||||
MVK_PUBLIC_SYMBOL void SPIRVToMSLConverterContext::alignUsageWith(SPIRVToMSLConverterContext& srcContext) {
|
||||
MVK_PUBLIC_SYMBOL void SPIRVToMSLConverterContext::alignUsageWith(const SPIRVToMSLConverterContext& srcContext) {
|
||||
|
||||
for (auto& va : vertexAttributes) {
|
||||
va.isUsedByShader = false;
|
||||
@ -119,7 +120,7 @@ MVK_PUBLIC_SYMBOL void SPIRVToMSLConverterContext::alignUsageWith(SPIRVToMSLConv
|
||||
#pragma mark SPIRVToMSLConverter
|
||||
|
||||
/** Populates content extracted from the SPRI-V compiler. */
|
||||
void populateFromCompiler(spirv_cross::Compiler& compiler, SPIRVEntryPointsByName& entryPoints);
|
||||
void populateFromCompiler(spirv_cross::Compiler& compiler, SPIRVEntryPoint& entryPoint, SPIRVToMSLConverterOptions& options);
|
||||
|
||||
MVK_PUBLIC_SYMBOL void SPIRVToMSLConverter::setSPIRV(const vector<uint32_t>& spirv) { _spirv = spirv; }
|
||||
|
||||
@ -172,9 +173,13 @@ MVK_PUBLIC_SYMBOL bool SPIRVToMSLConverter::convert(SPIRVToMSLConverterContext&
|
||||
|
||||
spirv_cross::CompilerMSL mslCompiler(_spirv);
|
||||
|
||||
if (context.options.hasEntryPoint()) {
|
||||
mslCompiler.set_entry_point(context.options.entryPointName, context.options.entryPointStage);
|
||||
}
|
||||
|
||||
// Establish the MSL options for the compiler
|
||||
// This needs to be done in two steps...for CompilerMSL and its superclass.
|
||||
auto mslOpts = mslCompiler.get_options();
|
||||
auto mslOpts = mslCompiler.get_msl_options();
|
||||
|
||||
#if MVK_MACOS
|
||||
mslOpts.platform = spirv_cross::CompilerMSL::Options::macOS;
|
||||
@ -186,11 +191,11 @@ MVK_PUBLIC_SYMBOL bool SPIRVToMSLConverter::convert(SPIRVToMSLConverterContext&
|
||||
mslOpts.msl_version = context.options.mslVersion;
|
||||
mslOpts.enable_point_size_builtin = context.options.isRenderingPoints;
|
||||
mslOpts.resolve_specialized_array_lengths = true;
|
||||
mslCompiler.set_options(mslOpts);
|
||||
mslCompiler.set_msl_options(mslOpts);
|
||||
|
||||
auto scOpts = mslCompiler.CompilerGLSL::get_options();
|
||||
auto scOpts = mslCompiler.get_common_options();
|
||||
scOpts.vertex.flip_vert_y = context.options.shouldFlipVertexY;
|
||||
mslCompiler.CompilerGLSL::set_options(scOpts);
|
||||
mslCompiler.set_common_options(scOpts);
|
||||
|
||||
#ifndef SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS
|
||||
try {
|
||||
@ -210,7 +215,7 @@ MVK_PUBLIC_SYMBOL bool SPIRVToMSLConverter::convert(SPIRVToMSLConverterContext&
|
||||
#endif
|
||||
|
||||
// Populate content extracted from the SPRI-V compiler.
|
||||
populateFromCompiler(mslCompiler, _entryPoints);
|
||||
populateFromCompiler(mslCompiler, _entryPoint, context.options);
|
||||
|
||||
// To check GLSL conversion
|
||||
if (shouldLogGLSL) {
|
||||
@ -317,28 +322,32 @@ void SPIRVToMSLConverter::logSource(string& src, const char* srcLang, const char
|
||||
|
||||
#pragma mark Support functions
|
||||
|
||||
void populateFromCompiler(spirv_cross::Compiler& compiler, SPIRVEntryPointsByName& entryPoints) {
|
||||
void populateFromCompiler(spirv_cross::Compiler& compiler, SPIRVEntryPoint& entryPoint, SPIRVToMSLConverterOptions& options) {
|
||||
|
||||
uint32_t minDim = 1;
|
||||
entryPoints.clear();
|
||||
for (string& epOrigName : compiler.get_entry_points()) {
|
||||
auto& spvEP = compiler.get_entry_point(epOrigName);
|
||||
auto& wgSize = spvEP.workgroup_size;
|
||||
spirv_cross::SPIREntryPoint spvEP;
|
||||
if (options.hasEntryPoint()) {
|
||||
spvEP = compiler.get_entry_point(options.entryPointName, options.entryPointStage);
|
||||
} else {
|
||||
const auto& entryPoints = compiler.get_entry_points_and_stages();
|
||||
if ( !entryPoints.empty() ) {
|
||||
auto& ep = entryPoints[0];
|
||||
spvEP = compiler.get_entry_point(ep.name, ep.execution_model);
|
||||
}
|
||||
}
|
||||
|
||||
SPIRVEntryPoint mvkEP;
|
||||
mvkEP.mtlFunctionName = spvEP.name;
|
||||
mvkEP.workgroupSize.width = max(wgSize.x, minDim);
|
||||
mvkEP.workgroupSize.height = max(wgSize.y, minDim);
|
||||
mvkEP.workgroupSize.depth = max(wgSize.z, minDim);
|
||||
uint32_t minDim = 1;
|
||||
auto& wgSize = spvEP.workgroup_size;
|
||||
|
||||
spirv_cross::SpecializationConstant width, height, depth;
|
||||
mvkEP.workgroupSizeId.constant = compiler.get_work_group_size_specialization_constants(width, height, depth);
|
||||
mvkEP.workgroupSizeId.width = width.constant_id;
|
||||
mvkEP.workgroupSizeId.height = height.constant_id;
|
||||
mvkEP.workgroupSizeId.depth = depth.constant_id;
|
||||
entryPoint.mtlFunctionName = spvEP.name;
|
||||
entryPoint.workgroupSize.width = max(wgSize.x, minDim);
|
||||
entryPoint.workgroupSize.height = max(wgSize.y, minDim);
|
||||
entryPoint.workgroupSize.depth = max(wgSize.z, minDim);
|
||||
|
||||
entryPoints[epOrigName] = mvkEP;
|
||||
}
|
||||
spirv_cross::SpecializationConstant width, height, depth;
|
||||
entryPoint.workgroupSizeId.constant = compiler.get_work_group_size_specialization_constants(width, height, depth);
|
||||
entryPoint.workgroupSizeId.width = width.constant_id;
|
||||
entryPoint.workgroupSizeId.height = height.constant_id;
|
||||
entryPoint.workgroupSizeId.depth = depth.constant_id;
|
||||
}
|
||||
|
||||
MVK_PUBLIC_SYMBOL void mvk::logSPIRV(vector<uint32_t>& spirv, string& spvLog) {
|
||||
|
@ -32,6 +32,9 @@ namespace mvk {
|
||||
|
||||
/** Options for converting SPIR-V to Metal Shading Language */
|
||||
typedef struct SPIRVToMSLConverterOptions {
|
||||
std::string entryPointName;
|
||||
spv::ExecutionModel entryPointStage = spv::ExecutionModelMax;
|
||||
|
||||
uint32_t mslVersion = makeMSLVersion(2);
|
||||
bool shouldFlipVertexY = true;
|
||||
bool isRenderingPoints = false;
|
||||
@ -40,13 +43,17 @@ namespace mvk {
|
||||
* Returns whether the specified options match this one.
|
||||
* It does if all corresponding elements are equal.
|
||||
*/
|
||||
bool matches(SPIRVToMSLConverterOptions& other);
|
||||
bool matches(const SPIRVToMSLConverterOptions& other) const;
|
||||
|
||||
bool hasEntryPoint() const {
|
||||
return !entryPointName.empty() && entryPointStage != spv::ExecutionModelMax;
|
||||
}
|
||||
|
||||
void setMSLVersion(uint32_t major, uint32_t minor = 0, uint32_t point = 0) {
|
||||
mslVersion = makeMSLVersion(major, minor, point);
|
||||
}
|
||||
|
||||
bool supportsMSLVersion(uint32_t major, uint32_t minor = 0, uint32_t point = 0) {
|
||||
bool supportsMSLVersion(uint32_t major, uint32_t minor = 0, uint32_t point = 0) const {
|
||||
return mslVersion >= makeMSLVersion(major, minor, point);
|
||||
}
|
||||
|
||||
@ -74,7 +81,7 @@ namespace mvk {
|
||||
* Returns whether the specified vertex attribute match this one.
|
||||
* It does if all corresponding elements except isUsedByShader are equal.
|
||||
*/
|
||||
bool matches(MSLVertexAttribute& other);
|
||||
bool matches(const MSLVertexAttribute& other) const;
|
||||
|
||||
} MSLVertexAttribute;
|
||||
|
||||
@ -100,7 +107,7 @@ namespace mvk {
|
||||
* Returns whether the specified resource binding match this one.
|
||||
* It does if all corresponding elements except isUsedByShader are equal.
|
||||
*/
|
||||
bool matches(MSLResourceBinding& other);
|
||||
bool matches(const MSLResourceBinding& other) const;
|
||||
|
||||
} MSLResourceBinding;
|
||||
|
||||
@ -111,10 +118,10 @@ namespace mvk {
|
||||
std::vector<MSLResourceBinding> resourceBindings;
|
||||
|
||||
/** Returns whether the vertex attribute at the specified location is used by the shader. */
|
||||
bool isVertexAttributeLocationUsed(uint32_t location);
|
||||
bool isVertexAttributeLocationUsed(uint32_t location) const;
|
||||
|
||||
/** Returns whether the vertex buffer at the specified Metal binding index is used by the shader. */
|
||||
bool isVertexBufferUsed(uint32_t mslBuffer);
|
||||
bool isVertexBufferUsed(uint32_t mslBuffer) const;
|
||||
|
||||
/**
|
||||
* Returns whether this context matches the other context. It does if the respective
|
||||
@ -122,10 +129,10 @@ namespace mvk {
|
||||
* can be found in the other context. Vertex attributes and resource bindings that are
|
||||
* in the other context but are not used by the shader that created this context, are ignored.
|
||||
*/
|
||||
bool matches(SPIRVToMSLConverterContext& other);
|
||||
bool matches(const SPIRVToMSLConverterContext& other) const;
|
||||
|
||||
/** Aligns the usage of this context with that of the source context. */
|
||||
void alignUsageWith(SPIRVToMSLConverterContext& srcContext);
|
||||
void alignUsageWith(const SPIRVToMSLConverterContext& srcContext);
|
||||
|
||||
} SPIRVToMSLConverterContext;
|
||||
|
||||
@ -135,20 +142,22 @@ namespace mvk {
|
||||
* and the number of threads in each workgroup or their specialization constant id, if the shader is a compute shader.
|
||||
*/
|
||||
typedef struct {
|
||||
std::string mtlFunctionName;
|
||||
std::string mtlFunctionName = "main0";
|
||||
struct {
|
||||
uint32_t width = 1;
|
||||
uint32_t height = 1;
|
||||
uint32_t depth = 1;
|
||||
} workgroupSize;
|
||||
struct {
|
||||
uint32_t width, height, depth;
|
||||
uint32_t width = 1;
|
||||
uint32_t height = 1;
|
||||
uint32_t depth = 1;
|
||||
uint32_t constant = 0;
|
||||
} workgroupSizeId;
|
||||
} SPIRVEntryPoint;
|
||||
|
||||
/** Holds a map of entry point info, indexed by the SPIRV entry point name. */
|
||||
typedef std::unordered_map<std::string, SPIRVEntryPoint> SPIRVEntryPointsByName;
|
||||
// typedef std::unordered_map<std::string, SPIRVEntryPoint> SPIRVEntryPointsByName;
|
||||
|
||||
/** Special constant used in a MSLResourceBinding descriptorSet element to indicate the bindings for the push constants. */
|
||||
static const uint32_t kPushConstDescSet = std::numeric_limits<uint32_t>::max();
|
||||
@ -195,8 +204,11 @@ namespace mvk {
|
||||
*/
|
||||
const std::string& getMSL() { return _msl; }
|
||||
|
||||
/** Returns a mapping of entry point info, indexed by SPIR-V entry point name. */
|
||||
const SPIRVEntryPointsByName& getEntryPoints() { return _entryPoints; }
|
||||
/** Returns information about the shader entry point. */
|
||||
const SPIRVEntryPoint& getEntryPoint() { return _entryPoint; }
|
||||
|
||||
/** Returns a mapping of entry point info, indexed by SPIR-V entry point name. */
|
||||
// const SPIRVEntryPointsByName& getEntryPoints() { return _entryPoints; }
|
||||
|
||||
/**
|
||||
* Returns whether the most recent conversion was successful.
|
||||
@ -212,10 +224,14 @@ namespace mvk {
|
||||
const std::string& getResultLog() { return _resultLog; }
|
||||
|
||||
/** Sets MSL source code. This can be used when MSL is supplied directly. */
|
||||
void setMSL(const std::string& msl, const SPIRVEntryPointsByName& entryPoints) {
|
||||
void setMSL(const std::string& msl, const SPIRVEntryPoint* pEntryPoint) {
|
||||
_msl = msl;
|
||||
_entryPoints = entryPoints;
|
||||
if (pEntryPoint) { _entryPoint = *pEntryPoint; }
|
||||
}
|
||||
// void setMSL(const std::string& msl, const SPIRVEntryPointsByName& entryPoints) {
|
||||
// _msl = msl;
|
||||
// _entryPoints = entryPoints;
|
||||
// }
|
||||
|
||||
protected:
|
||||
void logMsg(const char* logMsg);
|
||||
@ -228,7 +244,8 @@ namespace mvk {
|
||||
std::vector<uint32_t> _spirv;
|
||||
std::string _msl;
|
||||
std::string _resultLog;
|
||||
SPIRVEntryPointsByName _entryPoints;
|
||||
SPIRVEntryPoint _entryPoint;
|
||||
// SPIRVEntryPointsByName _entryPoints;
|
||||
bool _wasConverted = false;
|
||||
};
|
||||
|
||||
|
@ -1 +1 @@
|
||||
SPIRV-Cross/spirv.hpp
|
||||
../../External/SPIRV-Cross/spirv.hpp
|
@ -756,8 +756,8 @@
|
||||
A93903C71C57E9ED00FE90DC /* MoltenVKSPIRVToMSLConverter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MoltenVKSPIRVToMSLConverter.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A95096BD2003D32400F10950 /* DirectorySupport.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DirectorySupport.mm; sourceTree = "<group>"; };
|
||||
A95096BE2003D32400F10950 /* DirectorySupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectorySupport.h; sourceTree = "<group>"; };
|
||||
A95C5F3D1DEA9070000D17B6 /* spirv_cfg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = spirv_cfg.cpp; path = "SPIRV-Cross/spirv_cfg.cpp"; sourceTree = "<group>"; };
|
||||
A95C5F3E1DEA9070000D17B6 /* spirv_cfg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = spirv_cfg.hpp; path = "SPIRV-Cross/spirv_cfg.hpp"; sourceTree = "<group>"; };
|
||||
A95C5F3D1DEA9070000D17B6 /* spirv_cfg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spirv_cfg.cpp; sourceTree = "<group>"; };
|
||||
A95C5F3E1DEA9070000D17B6 /* spirv_cfg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spirv_cfg.hpp; sourceTree = "<group>"; };
|
||||
A964BD5F1C57EFBD00D930D8 /* MoltenVKShaderConverter */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = MoltenVKShaderConverter; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A964BD601C57EFBD00D930D8 /* MoltenVKGLSLToSPIRVConverter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MoltenVKGLSLToSPIRVConverter.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
A964BD611C57EFBD00D930D8 /* MoltenVKGLSLToSPIRVConverter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MoltenVKGLSLToSPIRVConverter.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@ -1110,13 +1110,13 @@
|
||||
A9A578282054A0E20072F392 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
|
||||
A9A578292054A0E20072F392 /* InitializeDll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitializeDll.h; sourceTree = "<group>"; };
|
||||
A9A5782A2054A0E20072F392 /* InitializeDll.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InitializeDll.cpp; sourceTree = "<group>"; };
|
||||
A9AB19901CB5B5A80001E7F9 /* spirv_common.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = spirv_common.hpp; path = "SPIRV-Cross/spirv_common.hpp"; sourceTree = "<group>"; };
|
||||
A9AB19911CB5B5A80001E7F9 /* spirv_cross.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = spirv_cross.cpp; path = "SPIRV-Cross/spirv_cross.cpp"; sourceTree = "<group>"; };
|
||||
A9AB19921CB5B5A80001E7F9 /* spirv_cross.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = spirv_cross.hpp; path = "SPIRV-Cross/spirv_cross.hpp"; sourceTree = "<group>"; };
|
||||
A9AB19931CB5B5A80001E7F9 /* spirv_glsl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = spirv_glsl.cpp; path = "SPIRV-Cross/spirv_glsl.cpp"; sourceTree = "<group>"; };
|
||||
A9AB19941CB5B5A80001E7F9 /* spirv_glsl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = spirv_glsl.hpp; path = "SPIRV-Cross/spirv_glsl.hpp"; sourceTree = "<group>"; };
|
||||
A9AB19951CB5B5A80001E7F9 /* spirv_msl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = spirv_msl.cpp; path = "SPIRV-Cross/spirv_msl.cpp"; sourceTree = "<group>"; };
|
||||
A9AB19961CB5B5A80001E7F9 /* spirv_msl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = spirv_msl.hpp; path = "SPIRV-Cross/spirv_msl.hpp"; sourceTree = "<group>"; };
|
||||
A9AB19901CB5B5A80001E7F9 /* spirv_common.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spirv_common.hpp; sourceTree = "<group>"; };
|
||||
A9AB19911CB5B5A80001E7F9 /* spirv_cross.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spirv_cross.cpp; sourceTree = "<group>"; };
|
||||
A9AB19921CB5B5A80001E7F9 /* spirv_cross.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spirv_cross.hpp; sourceTree = "<group>"; };
|
||||
A9AB19931CB5B5A80001E7F9 /* spirv_glsl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spirv_glsl.cpp; sourceTree = "<group>"; };
|
||||
A9AB19941CB5B5A80001E7F9 /* spirv_glsl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spirv_glsl.hpp; sourceTree = "<group>"; };
|
||||
A9AB19951CB5B5A80001E7F9 /* spirv_msl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spirv_msl.cpp; sourceTree = "<group>"; };
|
||||
A9AB19961CB5B5A80001E7F9 /* spirv_msl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spirv_msl.hpp; sourceTree = "<group>"; };
|
||||
A9BB09751CEF89B100CCAB22 /* spirv.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spirv.hpp; sourceTree = "<group>"; };
|
||||
A9F042AA1FB4D060009FCCB8 /* MVKCommonEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKCommonEnvironment.h; sourceTree = "<group>"; };
|
||||
A9F042AB1FB4D060009FCCB8 /* MVKLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MVKLogging.h; sourceTree = "<group>"; };
|
||||
@ -1177,6 +1177,7 @@
|
||||
A9AB19961CB5B5A80001E7F9 /* spirv_msl.hpp */,
|
||||
);
|
||||
name = "SPIRV-Cross";
|
||||
path = "../../External/SPIRV-Cross";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A964B28D1C57EBC400D930D8 /* Products */ = {
|
||||
@ -1198,7 +1199,8 @@
|
||||
A9A578272054A0E20072F392 /* OGLCompilersDLL */,
|
||||
A9A577C02054A0E20072F392 /* SPIRV */,
|
||||
);
|
||||
path = glslang;
|
||||
name = glslang;
|
||||
path = ../../External/glslang;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A97CC73C1C7527F3004A5C7E /* MoltenVKShaderConverterTool */ = {
|
||||
@ -1709,7 +1711,8 @@
|
||||
children = (
|
||||
A9A574D520549F1B0072F392 /* source */,
|
||||
);
|
||||
path = "SPIRV-Tools";
|
||||
name = "SPIRV-Tools";
|
||||
path = "../../External/glslang/External/spirv-tools";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
@ -2739,10 +2742,10 @@
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/include\"",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/source\"",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/build\"",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Headers/include\"",
|
||||
"\"$(SRCROOT)/../External/glslang/External/spirv-tools/include\"",
|
||||
"\"$(SRCROOT)/../External/glslang/External/spirv-tools/source\"",
|
||||
"\"$(SRCROOT)/../External/glslang/External/spirv-tools/external/spirv-headers/include\"",
|
||||
"\"$(SRCROOT)/../External/glslang/build/External/spirv-tools\"",
|
||||
);
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MACH_O_TYPE = staticlib;
|
||||
@ -2761,10 +2764,10 @@
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/include\"",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/source\"",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/build\"",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Headers/include\"",
|
||||
"\"$(SRCROOT)/../External/glslang/External/spirv-tools/include\"",
|
||||
"\"$(SRCROOT)/../External/glslang/External/spirv-tools/source\"",
|
||||
"\"$(SRCROOT)/../External/glslang/External/spirv-tools/external/spirv-headers/include\"",
|
||||
"\"$(SRCROOT)/../External/glslang/build/External/spirv-tools\"",
|
||||
);
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MACH_O_TYPE = staticlib;
|
||||
@ -2782,10 +2785,10 @@
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/include\"",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/source\"",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/build\"",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Headers/include\"",
|
||||
"\"$(SRCROOT)/../External/glslang/External/spirv-tools/include\"",
|
||||
"\"$(SRCROOT)/../External/glslang/External/spirv-tools/source\"",
|
||||
"\"$(SRCROOT)/../External/glslang/External/spirv-tools/external/spirv-headers/include\"",
|
||||
"\"$(SRCROOT)/../External/glslang/build/External/spirv-tools\"",
|
||||
);
|
||||
MACH_O_TYPE = staticlib;
|
||||
PRODUCT_NAME = MoltenVKSPIRVToMSLConverter;
|
||||
@ -2800,10 +2803,10 @@
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/include\"",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/source\"",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Tools/build\"",
|
||||
"\"$(SRCROOT)/MoltenVKSPIRVToMSLConverter/SPIRV-Headers/include\"",
|
||||
"\"$(SRCROOT)/../External/glslang/External/spirv-tools/include\"",
|
||||
"\"$(SRCROOT)/../External/glslang/External/spirv-tools/source\"",
|
||||
"\"$(SRCROOT)/../External/glslang/External/spirv-tools/external/spirv-headers/include\"",
|
||||
"\"$(SRCROOT)/../External/glslang/build/External/spirv-tools\"",
|
||||
);
|
||||
MACH_O_TYPE = staticlib;
|
||||
PRODUCT_NAME = MoltenVKSPIRVToMSLConverter;
|
||||
@ -2844,7 +2847,6 @@
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
|
||||
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
@ -2892,7 +2894,6 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "SPIRV_CROSS_FLT_FMT=\\\"%.6g\\\"";
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
|
||||
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
|
Loading…
x
Reference in New Issue
Block a user