fixed SPIR-V global initializer ordering
Bug: skia:8649 Change-Id: I737ae2ef0b13511332f9b480a1cb5cb73320d22a Reviewed-on: https://skia-review.googlesource.com/c/179880 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com> Auto-Submit: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
parent
b49d68c230
commit
8eb64d3be5
@ -2512,12 +2512,12 @@ SpvId SPIRVCodeGenerator::writeFunction(const FunctionDefinition& f, OutputStrea
|
|||||||
fVariableBuffer.reset();
|
fVariableBuffer.reset();
|
||||||
SpvId result = this->writeFunctionStart(f.fDeclaration, out);
|
SpvId result = this->writeFunctionStart(f.fDeclaration, out);
|
||||||
this->writeLabel(this->nextId(), out);
|
this->writeLabel(this->nextId(), out);
|
||||||
if (f.fDeclaration.fName == "main") {
|
|
||||||
write_stringstream(fGlobalInitializersBuffer, out);
|
|
||||||
}
|
|
||||||
StringStream bodyBuffer;
|
StringStream bodyBuffer;
|
||||||
this->writeBlock((Block&) *f.fBody, bodyBuffer);
|
this->writeBlock((Block&) *f.fBody, bodyBuffer);
|
||||||
write_stringstream(fVariableBuffer, out);
|
write_stringstream(fVariableBuffer, out);
|
||||||
|
if (f.fDeclaration.fName == "main") {
|
||||||
|
write_stringstream(fGlobalInitializersBuffer, out);
|
||||||
|
}
|
||||||
write_stringstream(bodyBuffer, out);
|
write_stringstream(bodyBuffer, out);
|
||||||
if (fCurrentBlock) {
|
if (fCurrentBlock) {
|
||||||
if (f.fDeclaration.fReturnType == *fContext.fVoid_Type) {
|
if (f.fDeclaration.fReturnType == *fContext.fVoid_Type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user