HLSL: Allow use of $Global members in between function calls.
This allows global initializers to use $Global members.
This commit is contained in:
@@ -1513,11 +1513,6 @@ TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& l
|
||||
// rest of this function doesn't care.
|
||||
entryPointTree = transformEntryPoint(loc, function, attributes);
|
||||
|
||||
// Insert the $Global constant buffer.
|
||||
// TODO: this design fails if new members are declared between function definitions.
|
||||
if (! insertGlobalUniformBlock())
|
||||
error(loc, "failed to insert the global constant buffer", "uniform", "");
|
||||
|
||||
//
|
||||
// New symbol table scope for body of function plus its arguments
|
||||
//
|
||||
@@ -6701,13 +6696,6 @@ void HlslParseContext::declareBlock(const TSourceLoc& loc, TType& type, const TS
|
||||
trackLinkage(variable);
|
||||
}
|
||||
|
||||
void HlslParseContext::finalizeGlobalUniformBlockLayout(TVariable& block)
|
||||
{
|
||||
block.getWritableType().getQualifier().layoutPacking = ElpStd140;
|
||||
block.getWritableType().getQualifier().layoutMatrix = ElmRowMajor;
|
||||
fixBlockUniformOffsets(block.getType().getQualifier(), *block.getWritableType().getWritableStruct());
|
||||
}
|
||||
|
||||
//
|
||||
// "For a block, this process applies to the entire block, or until the first member
|
||||
// is reached that has a location layout qualifier. When a block member is declared with a location
|
||||
|
||||
Reference in New Issue
Block a user