Skip to content

Commit

Permalink
Merge pull request KhronosGroup#2089 from Roy-AMD/Fix-iomapper-issue
Browse files Browse the repository at this point in the history
Fix iomapper issue
  • Loading branch information
johnkslang authored Feb 19, 2020
2 parents ed0da37 + 615ae25 commit c008fcb
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions glslang/MachineIndependent/iomapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,10 @@ TDefaultGlslIoResolver::TDefaultGlslIoResolver(const TIntermediate& intermediate

int TDefaultGlslIoResolver::resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) {
const TType& type = ent.symbol->getType();
const TString& name = ent.symbol->getName();
const TString& name = IsAnonymous(ent.symbol->getName()) ?
ent.symbol->getType().getTypeName()
:
ent.symbol->getName();
if (currentStage != stage) {
preStage = currentStage;
currentStage = stage;
Expand Down Expand Up @@ -663,7 +666,10 @@ int TDefaultGlslIoResolver::resolveInOutLocation(EShLanguage stage, TVarEntryInf

int TDefaultGlslIoResolver::resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) {
const TType& type = ent.symbol->getType();
const TString& name = ent.symbol->getName();
const TString& name = IsAnonymous(ent.symbol->getName()) ?
ent.symbol->getType().getTypeName()
:
ent.symbol->getName();
// kick out of not doing this
if (! doAutoLocationMapping()) {
return ent.newLocation = -1;
Expand Down Expand Up @@ -734,7 +740,10 @@ int TDefaultGlslIoResolver::resolveUniformLocation(EShLanguage /*stage*/, TVarEn

int TDefaultGlslIoResolver::resolveBinding(EShLanguage /*stage*/, TVarEntryInfo& ent) {
const TType& type = ent.symbol->getType();
const TString& name = ent.symbol->getName();
const TString& name = IsAnonymous(ent.symbol->getName()) ?
ent.symbol->getType().getTypeName()
:
ent.symbol->getName();
// On OpenGL arrays of opaque types take a seperate binding for each element
int numBindings = intermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1;
TResourceType resource = getResourceType(type);
Expand Down Expand Up @@ -809,7 +818,10 @@ void TDefaultGlslIoResolver::endCollect(EShLanguage /*stage*/) {

void TDefaultGlslIoResolver::reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& infoSink) {
const TType& type = ent.symbol->getType();
const TString& name = ent.symbol->getName();
const TString& name = IsAnonymous(ent.symbol->getName()) ?
ent.symbol->getType().getTypeName()
:
ent.symbol->getName();
TStorageQualifier storage = type.getQualifier().storage;
EShLanguage stage(EShLangCount);
switch (storage) {
Expand Down Expand Up @@ -869,7 +881,10 @@ void TDefaultGlslIoResolver::reserverStorageSlot(TVarEntryInfo& ent, TInfoSink&

void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& infoSink) {
const TType& type = ent.symbol->getType();
const TString& name = ent.symbol->getName();
const TString& name = IsAnonymous(ent.symbol->getName()) ?
ent.symbol->getType().getTypeName()
:
ent.symbol->getName();
int resource = getResourceType(type);
if (type.getQualifier().hasBinding()) {
TVarSlotMap& varSlotMap = resourceSlotMap[resource];
Expand Down

0 comments on commit c008fcb

Please sign in to comment.