From 064c28f58e845be67a31283cb885b22f32118f49 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Sun, 9 Jul 2017 18:08:22 -0700 Subject: Pick layout rules based on target languge, not source. The tricky bit here was that the `reflection-json` output format isn't really a code generation target like the others, and we need to be able to have multiple "targets" active to make sense of it. This needs cleaning-up. --- source/slang/parameter-binding.cpp | 40 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) (limited to 'source/slang/parameter-binding.cpp') diff --git a/source/slang/parameter-binding.cpp b/source/slang/parameter-binding.cpp index 5811fd9fa..228af7d99 100644 --- a/source/slang/parameter-binding.cpp +++ b/source/slang/parameter-binding.cpp @@ -137,9 +137,6 @@ struct SharedParameterBindingContext // The program layout we are trying to construct RefPtr programLayout; - // The source language we are trying to use - SourceLanguage sourceLanguage; - // Information on what ranges of "registers" have already // been claimed, for each resource type UsedRanges usedResourceRanges[kLayoutResourceKindCount]; @@ -160,6 +157,9 @@ struct ParameterBindingContext // What stage (if any) are we compiling for? Stage stage; + + // The source language we are trying to use + SourceLanguage sourceLanguage; }; struct LayoutSemanticInfo @@ -398,7 +398,7 @@ getTypeLayoutForGlobalShaderParameter( ParameterBindingContext* context, VarDeclBase* varDecl) { - switch( context->shared->sourceLanguage ) + switch( context->sourceLanguage ) { case SourceLanguage::Slang: case SourceLanguage::HLSL: @@ -1167,6 +1167,7 @@ static void collectParameters( for( auto& translationUnit : request->translationUnits ) { context->stage = inferStageForTranslationUnit(translationUnit.Ptr()); + context->sourceLanguage = translationUnit->sourceLanguage; // First look at global-scope parameters collectGlobalScopeParameters(context, translationUnit->SyntaxNode.Ptr()); @@ -1189,31 +1190,13 @@ static void collectParameters( void generateParameterBindings( CompileRequest* request) { - // TODO: infer a language or set of language rules to use based on the - // source files and entry points given - auto language = SourceLanguage::Unknown; - for( auto& translationUnit : request->translationUnits ) - { - auto translationUnitLanguage = translationUnit->sourceLanguage; - if( language == SourceLanguage::Unknown ) - { - language = translationUnitLanguage; - } - else if( language == translationUnitLanguage ) - { - // same language: nothing to do... - } - else - { - // mismatch! - // TODO(tfoley): emit a diagnostic - } - } + // Try to find rules based on the selected code-generation target + auto rules = GetLayoutRulesFamilyImpl(request->Target); - // TODO(tfoley): We should really be picking layout rules - // based on the *target* language, and not the source... - auto rules = GetLayoutRulesFamilyImpl(language); - assert(rules); + // If there was no target, or there are no rules for the target, + // then bail out here. + if (!rules) + return; RefPtr programLayout = new ProgramLayout; @@ -1222,7 +1205,6 @@ void generateParameterBindings( SharedParameterBindingContext sharedContext; sharedContext.defaultLayoutRules = rules; sharedContext.programLayout = programLayout; - sharedContext.sourceLanguage = language; // Create a sub-context to collect parameters that get // declared into the global scope -- cgit v1.2.3 From 0e220da96b819f3a31635689f78ad20bd9a36d0b Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 10 Jul 2017 08:34:52 -0700 Subject: More cross-compilation fixes - Add GLSL mappings for more `Texture*` methods - The annoying one here is `Texture*.Load()` because it doesn't take a sampler, but the GLSL equivalent needs one (while the SPIR-V does *not*). I've hacked this pretty seriously for now. - Try to ensure that we add `uniform` to global declarations that need it in GLSL - When outputting an `in` or `out` variable that might have been created from an `inout` shader parameter, filter the layout qualifiers that we output to only cover the appropriate resource kind. --- source/slang/emit.cpp | 125 ++++++++++++++++++++++++++++++++++++- source/slang/lower.cpp | 20 ++++++ source/slang/modifier-defs.h | 1 - source/slang/parameter-binding.cpp | 2 +- source/slang/slang-stdlib.cpp | 29 +++++++++ 5 files changed, 172 insertions(+), 5 deletions(-) (limited to 'source/slang/parameter-binding.cpp') diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index c135090c1..01b3e8cc2 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -48,6 +48,10 @@ struct SharedEmitContext StructTypeLayout* globalStructLayout; ProgramLayout* programLayout; + + ProgramSyntaxNode* program; + + bool needHackSamplerForTexelFetch = false; }; struct EmitContext @@ -1758,6 +1762,66 @@ struct EmitVisitor } break; + case 'P': + { + // Okay, we need a collosal hack to deal with the fact that GLSL `texelFetch()` + // for Vulkan seems to be completely broken by design. It's signature wants + // a `sampler2D` for consistency with its peers, but the actual SPIR-V operation + // ignores the sampler paart of it, and just used the `texture2D` part. + // + // The HLSL equivalent (e.g., `Texture2D.Load()`) doesn't provide a sampler + // argument, so we seemingly need to conjure one out of thin air. :( + // + // We are going to hack this *hard* for now. + + // Try to find a suitable sampler-type shader parameter in the global scope + // (fingers crossed) + RefPtr samplerVar; + for (auto d : context->shared->program->Members) + { + if (auto varDecl = d.As()) + { + if (auto samplerType = varDecl->Type.type->As()) + { + samplerVar = varDecl; + break; + } + } + } + + if (auto memberExpr = callExpr->FunctionExpr.As()) + { + auto base = memberExpr->BaseExpression; + if (auto baseTextureType = base->Type->As()) + { + emitGLSLTextureOrTextureSamplerType(baseTextureType, "sampler"); + Emit("("); + EmitExpr(memberExpr->BaseExpression); + Emit(","); + if (samplerVar) + { + EmitDeclRef(makeDeclRef(samplerVar.Ptr())); + } + else + { + Emit("SLANG_hack_samplerForTexelFetch"); + context->shared->needHackSamplerForTexelFetch = true; + } + Emit(")"); + } + else + { + assert(!"unexpected"); + } + + } + else + { + assert(!"unexpected"); + } + } + break; + default: assert(!"unexpected"); break; @@ -2476,6 +2540,9 @@ struct EmitVisitor #define CASE(TYPE, KEYWORD) \ else if(auto mod_##TYPE = mod.As()) Emit(#KEYWORD " ") + #define CASE2(TYPE, HLSL_NAME, GLSL_NAME) \ + else if(auto mod_##TYPE = mod.As()) Emit((context->shared->target == CodeGenTarget::GLSL) ? GLSL_NAME : HLSL_NAME) + CASE(RowMajorLayoutModifier, row_major); CASE(ColumnMajorLayoutModifier, column_major); CASE(HLSLNoInterpolationModifier, nointerpolation); @@ -2502,6 +2569,7 @@ struct EmitVisitor CASE(ConstModifier, const); #undef CASE + #undef CASE2 else if (auto staticModifier = mod.As()) { @@ -2949,7 +3017,8 @@ struct EmitVisitor } void emitGLSLLayoutQualifiers( - RefPtr layout) + RefPtr layout, + LayoutResourceKind filter = LayoutResourceKind::None) { if(!layout) return; @@ -2964,6 +3033,13 @@ struct EmitVisitor for( auto info : layout->resourceInfos ) { + // Skip info that doesn't match our filter + if (filter != LayoutResourceKind::None + && filter != info.kind) + { + continue; + } + emitGLSLLayoutQualifier(info); } } @@ -3095,7 +3171,33 @@ struct EmitVisitor return; } - emitGLSLLayoutQualifiers(layout); + + if (context->shared->target == CodeGenTarget::GLSL) + { + if (decl->HasModifier()) + { + emitGLSLLayoutQualifiers(layout, LayoutResourceKind::VertexInput); + } + else if (decl->HasModifier()) + { + emitGLSLLayoutQualifiers(layout, LayoutResourceKind::FragmentOutput); + } + else + { + emitGLSLLayoutQualifiers(layout); + } + + // If we have a uniform that wasn't tagged `uniform` in GLSL, then fix that here + if (layout + && !decl->HasModifier()) + { + if (layout->FindResourceInfo(LayoutResourceKind::Uniform) + || layout->FindResourceInfo(LayoutResourceKind::DescriptorTableSlot)) + { + Emit("uniform "); + } + } + } EmitVarDeclCommon(decl); @@ -3288,6 +3390,9 @@ String emitEntryPoint( // There may be global-scope modifiers that we should emit now visitor.emitGLSLPreprocessorDirectives(translationUnitSyntax); + String prefix = sharedContext.sb.ProduceString(); + sharedContext.sb.Clear(); + switch(target) { case CodeGenTarget::GLSL: @@ -3303,6 +3408,8 @@ String emitEntryPoint( auto lowered = lowerEntryPoint(entryPoint, programLayout, target); + sharedContext.program = lowered.program; + visitor.EmitDeclsInContainer(lowered.program.Ptr()); #if 0 @@ -3324,7 +3431,19 @@ String emitEntryPoint( String code = sharedContext.sb.ProduceString(); - return code; + StringBuilder finalResultBuilder; + finalResultBuilder << prefix; + + if (sharedContext.needHackSamplerForTexelFetch) + { + finalResultBuilder << "layout(set = 0, binding = 0) uniform sampler SLANG_hack_samplerForTexelFetch;\n"; + } + + finalResultBuilder << code; + + String finalResult = finalResultBuilder.ProduceString(); + + return finalResult; } } // namespace Slang diff --git a/source/slang/lower.cpp b/source/slang/lower.cpp index 6c54d18b6..023c63591 100644 --- a/source/slang/lower.cpp +++ b/source/slang/lower.cpp @@ -194,6 +194,8 @@ public: struct SharedLoweringContext { + CompileRequest* compileRequest; + ProgramLayout* programLayout; // The target we are going to generate code for. @@ -1372,6 +1374,23 @@ struct LoweringVisitor return loweredDecl; } + SourceLanguage getSourceLanguage(ProgramSyntaxNode* moduleDecl) + { + for (auto translationUnit : shared->compileRequest->translationUnits) + { + if (moduleDecl == translationUnit->SyntaxNode) + return translationUnit->sourceLanguage; + } + + for (auto loadedModuleDecl : shared->compileRequest->loadedModulesList) + { + if (moduleDecl == loadedModuleDecl) + return SourceLanguage::Slang; + } + + return SourceLanguage::Unknown; + } + RefPtr visitVariable( Variable* decl) { @@ -2022,6 +2041,7 @@ LoweredEntryPoint lowerEntryPoint( CodeGenTarget target) { SharedLoweringContext sharedContext; + sharedContext.compileRequest = entryPoint->compileRequest; sharedContext.programLayout = programLayout; sharedContext.target = target; diff --git a/source/slang/modifier-defs.h b/source/slang/modifier-defs.h index e50288600..083da79f0 100644 --- a/source/slang/modifier-defs.h +++ b/source/slang/modifier-defs.h @@ -6,7 +6,6 @@ #define SIMPLE_MODIFIER(NAME) \ SIMPLE_SYNTAX_CLASS(NAME##Modifier, Modifier) -SIMPLE_MODIFIER(Uniform); SIMPLE_MODIFIER(In); SIMPLE_MODIFIER(Out); SIMPLE_MODIFIER(Const); diff --git a/source/slang/parameter-binding.cpp b/source/slang/parameter-binding.cpp index 228af7d99..ec611f8b1 100644 --- a/source/slang/parameter-binding.cpp +++ b/source/slang/parameter-binding.cpp @@ -1045,7 +1045,7 @@ static void collectEntryPointParameters( // We have an entry-point parameter, and need to figure out what to do with it. // TODO: need to handle `uniform`-qualified parameters here - if (paramDecl->HasModifier()) + if (paramDecl->HasModifier()) continue; state.directionMask = 0; diff --git a/source/slang/slang-stdlib.cpp b/source/slang/slang-stdlib.cpp index e2d5829b4..23d66201a 100644 --- a/source/slang/slang-stdlib.cpp +++ b/source/slang/slang-stdlib.cpp @@ -1431,6 +1431,22 @@ namespace Slang { int loadCoordCount = kBaseTextureTypes[tt].coordCount + isArray + (isMultisample?0:1); + // When translating to GLSL, we need to break apart the `location` argument. + // + // TODO: this should realy be handled by having this member actually get lowered! + int glslLoadCoordCount = kBaseTextureTypes[tt].coordCount + isArray; + static const char* kGLSLLoadCoordsSwizzle[] = { "", "", "x", "xy", "xyz", "xyzw" }; + static const char* kGLSLLoadLODSwizzle[] = { "", "", "y", "z", "w", "error" }; + + if (isMultisample) + { + sb << "__intrinsic(glsl, \"texelFetch($P, $0, $1)\")\n"; + } + else + { + sb << "__intrinsic(glsl, \"texelFetch($P, ($0)." << kGLSLLoadCoordsSwizzle[loadCoordCount] << ", ($0)." << kGLSLLoadLODSwizzle[loadCoordCount] << ")\")\n"; + } + sb << "__intrinsic\n"; sb << "T Load("; sb << "int" << loadCoordCount << " location"; if(isMultisample) @@ -1439,6 +1455,15 @@ namespace Slang } sb << ");\n"; + if (isMultisample) + { + sb << "__intrinsic(glsl, \"texelFetchOffset($P, $0, $1, $2)\")\n"; + } + else + { + sb << "__intrinsic(glsl, \"texelFetch($P, ($0)." << kGLSLLoadCoordsSwizzle[loadCoordCount] << ", ($0)." << kGLSLLoadLODSwizzle[loadCoordCount] << ", $1)\")\n"; + } + sb << "__intrinsic\n"; sb << "T Load("; sb << "int" << loadCoordCount << " location"; if(isMultisample) @@ -1470,11 +1495,15 @@ namespace Slang { // `Sample()` + sb << "__intrinsic(glsl, \"texture($p, $1)\")\n"; + sb << "__intrinsic\n"; sb << "T Sample(SamplerState s, "; sb << "float" << kBaseTextureTypes[tt].coordCount + isArray << " location);\n"; if( baseShape != TextureType::ShapeCube ) { + sb << "__intrinsic(glsl, \"textureOffset($p, $1)\")\n"; + sb << "__intrinsic\n"; sb << "T Sample(SamplerState s, "; sb << "float" << kBaseTextureTypes[tt].coordCount + isArray << " location, "; sb << "int" << kBaseTextureTypes[tt].coordCount << " offset);\n"; -- cgit v1.2.3 From 5b7c254d24653fd1c19157e8d5ef68a7e787ff58 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 10 Jul 2017 09:29:11 -0700 Subject: Start handling system-value semantics during lowering I hadn't been lowering `SV_Position` outputs to `gl_Position`, and had somehow been relying on hidden driver behavior that I guess made things Just Work. This change adds some infrastructure to handle `SV_` semantics during lowering of an entry point (currently only covering `SV_Position` and `SV_Target`, FWIW). As a byproduct, this also means that a `VarLayout` stores semantic info, which could conceivably be exposed through reflection data now. --- source/slang/lower.cpp | 93 ++++++++++++++++++++++++++++++-------- source/slang/parameter-binding.cpp | 53 ++++++++++++++-------- source/slang/type-layout.h | 4 ++ 3 files changed, 113 insertions(+), 37 deletions(-) (limited to 'source/slang/parameter-binding.cpp') diff --git a/source/slang/lower.cpp b/source/slang/lower.cpp index 023c63591..165812fae 100644 --- a/source/slang/lower.cpp +++ b/source/slang/lower.cpp @@ -1545,38 +1545,93 @@ struct LoweringVisitor type = arrayType; } - // TODO: if we are declaring an SOA-ized array, - // this is where those array dimensions would need - // to be tacked on. + // We need to create a reference to the global-scope declaration + // of the proper GLSL input/output variable. This might + // be a user-defined input/output, or a system-defined `gl_` one. + RefPtr globalVarExpr; + + // Handle system-value inputs/outputs + assert(varLayout); + auto systemValueSemantic = varLayout->systemValueSemantic; + if (systemValueSemantic.Length() != 0) + { + auto ns = systemValueSemantic.ToLower(); - RefPtr globalVarDecl = new Variable(); - globalVarDecl->Name.Content = info.name; - globalVarDecl->Type.type = type; + if (ns == "sv_target") + { + // Note: we do *not* need to generate some kind of `gl_` + // builtin for fragment-shader outputs: they are just + // ordinary `out` variables, with ordinary `location`s, + // as far as GLSL is concerned. + } + else if (ns == "sv_position") + { + RefPtr globalVarRef = new VarExpressionSyntaxNode(); + globalVarRef->name = "gl_Position"; + globalVarExpr = globalVarRef; + } + else + { + assert(!"unhandled"); + } + } - ensureDeclHasAValidName(globalVarDecl); + // If we didn't match some kind of builtin input/output, + // then declare a user input/output variable instead + if (!globalVarExpr) + { + RefPtr globalVarDecl = new Variable(); + globalVarDecl->Name.Content = info.name; + globalVarDecl->Type.type = type; - addMember(shared->loweredProgram, globalVarDecl); + ensureDeclHasAValidName(globalVarDecl); - // Add the layout information - RefPtr modifier = new ComputedLayoutModifier(); - modifier->layout = varLayout; - addModifier(globalVarDecl, modifier); + addMember(shared->loweredProgram, globalVarDecl); - // Need to generate an assignment in the right direction. + // Add the layout information + RefPtr modifier = new ComputedLayoutModifier(); + modifier->layout = varLayout; + addModifier(globalVarDecl, modifier); + + // Add appropriate in/out modifier + switch (info.direction) + { + case VaryingParameterDirection::Input: + addModifier(globalVarDecl, new InModifier()); + break; + + case VaryingParameterDirection::Output: + addModifier(globalVarDecl, new OutModifier()); + break; + } + + + RefPtr globalVarRef = new VarExpressionSyntaxNode(); + globalVarRef->Position = globalVarDecl->Position; + globalVarRef->declRef = makeDeclRef(globalVarDecl.Ptr()); + globalVarRef->name = globalVarDecl->getName(); + + globalVarExpr = globalVarRef; + } + + // TODO: if we are declaring an SOA-ized array, + // this is where those array dimensions would need + // to be tacked on. // - // TODO: for now I am just dealing with input: + // That is, this logic should be getting collected into a loop, + // and so we need to have a loop variable we can use to + // index into the two different expressions. + + // Need to generate an assignment in the right direction. switch (info.direction) { case VaryingParameterDirection::Input: - addModifier(globalVarDecl, new InModifier()); - assign(varExpr, globalVarDecl); + assign(varExpr, globalVarExpr); break; case VaryingParameterDirection::Output: - addModifier(globalVarDecl, new OutModifier()); - - assign(globalVarDecl, varExpr); + assign(globalVarExpr, varExpr); break; } } diff --git a/source/slang/parameter-binding.cpp b/source/slang/parameter-binding.cpp index ec611f8b1..0683c7f8c 100644 --- a/source/slang/parameter-binding.cpp +++ b/source/slang/parameter-binding.cpp @@ -788,6 +788,7 @@ static RefPtr processSimpleEntryPointParameter( ParameterBindingContext* context, RefPtr type, EntryPointParameterState const& inState, + RefPtr varLayout, int semanticSlotCount = 1) { EntryPointParameterState state = inState; @@ -817,6 +818,13 @@ static RefPtr processSimpleEntryPointParameter( } } + // Remember the system-value semantic so that we can query it later + if (varLayout) + { + varLayout->systemValueSemantic = semanticName; + varLayout->systemValueSemanticIndex = semanticIndex; + } + // TODO: add some kind of usage information for system input/output } else @@ -847,13 +855,15 @@ static RefPtr processSimpleEntryPointParameter( static RefPtr processEntryPointParameter( ParameterBindingContext* context, RefPtr type, - EntryPointParameterState const& state); + EntryPointParameterState const& state, + RefPtr varLayout); static RefPtr processEntryPointParameterWithPossibleSemantic( ParameterBindingContext* context, Decl* declForSemantic, RefPtr type, - EntryPointParameterState const& state) + EntryPointParameterState const& state, + RefPtr varLayout) { // If there is no explicit semantic already in effect, *and* we find an explicit // semantic on the associated declaration, then we'll use it. @@ -868,7 +878,7 @@ static RefPtr processEntryPointParameterWithPossibleSemantic( subState.optSemanticName = &semanticInfo.name; subState.ioSemanticIndex = &semanticIndex; - processEntryPointParameter(context, type, subState); + processEntryPointParameter(context, type, subState, varLayout); } } @@ -876,29 +886,30 @@ static RefPtr processEntryPointParameterWithPossibleSemantic( // *or* we couldn't find an explicit semantic to apply on the given // declaration, so we will just recursive with whatever we have at // the moment. - return processEntryPointParameter(context, type, state); + return processEntryPointParameter(context, type, state, varLayout); } static RefPtr processEntryPointParameter( ParameterBindingContext* context, RefPtr type, - EntryPointParameterState const& state) + EntryPointParameterState const& state, + RefPtr varLayout) { // Scalar and vector types are treated as outputs directly if(auto basicType = type->As()) { - return processSimpleEntryPointParameter(context, basicType, state); + return processSimpleEntryPointParameter(context, basicType, state, varLayout); } else if(auto vectorType = type->As()) { - return processSimpleEntryPointParameter(context, vectorType, state); + return processSimpleEntryPointParameter(context, vectorType, state, varLayout); } // A matrix is processed as if it was an array of rows else if( auto matrixType = type->As() ) { auto rowCount = GetIntVal(matrixType->getRowCount()); - return processSimpleEntryPointParameter(context, matrixType, state, (int) rowCount); + return processSimpleEntryPointParameter(context, matrixType, state, varLayout, (int) rowCount); } else if( auto arrayType = type->As() ) { @@ -908,13 +919,13 @@ static RefPtr processEntryPointParameter( auto elementCount = (UInt) GetIntVal(arrayType->ArrayLength); // We use the first element to derive the layout for the element type - auto elementTypeLayout = processEntryPointParameter(context, arrayType->BaseType, state); + auto elementTypeLayout = processEntryPointParameter(context, arrayType->BaseType, state, varLayout); // We still walk over subsequent elements to make sure they consume resources // as needed for( UInt ii = 1; ii < elementCount; ++ii ) { - processEntryPointParameter(context, arrayType->BaseType, state); + processEntryPointParameter(context, arrayType->BaseType, state, nullptr); } RefPtr arrayTypeLayout = new ArrayTypeLayout(); @@ -946,14 +957,16 @@ static RefPtr processEntryPointParameter( // Need to recursively walk the fields of the structure now... for( auto field : GetFields(structDeclRef) ) { + RefPtr fieldVarLayout = new VarLayout(); + fieldVarLayout->varDecl = field; + auto fieldTypeLayout = processEntryPointParameterWithPossibleSemantic( context, field.getDecl(), GetType(field), - state); + state, + fieldVarLayout); - RefPtr fieldVarLayout = new VarLayout(); - fieldVarLayout->varDecl = field; fieldVarLayout->typeLayout = fieldTypeLayout; for (auto rr : fieldTypeLayout->resourceInfos) @@ -1062,14 +1075,16 @@ static void collectEntryPointParameters( state.directionMask |= kEntryPointParameterDirection_Output; } + RefPtr paramVarLayout = new VarLayout(); + paramVarLayout->varDecl = makeDeclRef(paramDecl.Ptr()); + auto paramTypeLayout = processEntryPointParameterWithPossibleSemantic( context, paramDecl.Ptr(), paramDecl->Type.type, - state); + state, + paramVarLayout); - RefPtr paramVarLayout = new VarLayout(); - paramVarLayout->varDecl = makeDeclRef(paramDecl.Ptr()); paramVarLayout->typeLayout = paramTypeLayout; for (auto rr : paramTypeLayout->resourceInfos) @@ -1089,13 +1104,15 @@ static void collectEntryPointParameters( { state.directionMask = kEntryPointParameterDirection_Output; + RefPtr resultLayout = new VarLayout(); + auto resultTypeLayout = processEntryPointParameterWithPossibleSemantic( context, entryPointFuncDecl, resultType, - state); + state, + resultLayout); - RefPtr resultLayout = new VarLayout(); resultLayout->typeLayout = resultTypeLayout; for (auto rr : resultTypeLayout->resourceInfos) diff --git a/source/slang/type-layout.h b/source/slang/type-layout.h index 3ee12656c..262a8c3b1 100644 --- a/source/slang/type-layout.h +++ b/source/slang/type-layout.h @@ -237,6 +237,10 @@ public: // Additional flags VarLayoutFlags flags = 0; + // System-value semantic (and index) if this is a system value + String systemValueSemantic; + int systemValueSemanticIndex; + // The start register(s) for any resources struct ResourceInfo { -- cgit v1.2.3