mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Chore] (MG_State/ProgramObject): rename attrib to vertex in for clarity
This commit is contained in:
@@ -100,7 +100,7 @@ namespace MobileGL {
|
|||||||
if (!programObject) return;
|
if (!programObject) return;
|
||||||
|
|
||||||
MGLOG_D("%s: loc %02d = \"%s\"", __func__, index, name);
|
MGLOG_D("%s: loc %02d = \"%s\"", __func__, index, name);
|
||||||
programObject->SetExplicitAttribLocation(index, name);
|
programObject->SetExplicitVertexInLocation(index, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompileShader_State(GLuint shader) {
|
void CompileShader_State(GLuint shader) {
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ namespace MobileGL {
|
|||||||
// if (location < 0) continue;
|
// if (location < 0) continue;
|
||||||
// if (location >= (int)m_attribs.size()) {
|
// if (location >= (int)m_attribs.size()) {
|
||||||
// if (location >= maxAttribs) {
|
// if (location >= maxAttribs) {
|
||||||
// MGLOG_W("ProgramObject %u: SetExplicitAttribLocation: requested location %d >= "
|
// MGLOG_W("ProgramObject %u: SetExplicitVertexInLocation: requested location %d >= "
|
||||||
// "GL_MAX_VERTEX_ATTRIBS (%d). Ignored for attribute '%s'.",
|
// "GL_MAX_VERTEX_ATTRIBS (%d). Ignored for attribute '%s'.",
|
||||||
// m_externalIndex, location, maxAttribs, name.c_str());
|
// m_externalIndex, location, maxAttribs, name.c_str());
|
||||||
// continue;
|
// continue;
|
||||||
@@ -465,11 +465,11 @@ namespace MobileGL {
|
|||||||
// will probably be useful when multi-threaded compilation
|
// will probably be useful when multi-threaded compilation
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProgramObject::SetExplicitAttribLocation(Uint index, const char* name) {
|
void ProgramObject::SetExplicitVertexInLocation(Uint index, const char* name) {
|
||||||
MGLOG_D("ProgramObject %u: SetExplicitAttribLocation called name='%s' index=%u", m_externalIndex, name,
|
MGLOG_D("ProgramObject %u: SetExplicitVertexInLocation called name='%s' index=%u", m_externalIndex, name,
|
||||||
index);
|
index);
|
||||||
m_explicitAttribLocations[name] = index;
|
m_explicitAttribLocations[name] = index;
|
||||||
MGLOG_D("ProgramObject %u: SetExplicitAttribLocation - stored explicit location for '%s' -> %u",
|
MGLOG_D("ProgramObject %u: SetExplicitVertexInLocation - stored explicit location for '%s' -> %u",
|
||||||
m_externalIndex, name, index);
|
m_externalIndex, name, index);
|
||||||
}
|
}
|
||||||
} // namespace GLState
|
} // namespace GLState
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace MobileGL {
|
|||||||
void Link();
|
void Link();
|
||||||
void MarkAsDeleted();
|
void MarkAsDeleted();
|
||||||
|
|
||||||
void SetExplicitAttribLocation(Uint index, const char* name);
|
void SetExplicitVertexInLocation(Uint index, const char* name);
|
||||||
|
|
||||||
Vector<SharedPtr<ShaderObject>>& GetAttachedShaders();
|
Vector<SharedPtr<ShaderObject>>& GetAttachedShaders();
|
||||||
const String& GetInfoLog() const { return m_infoLog; }
|
const String& GetInfoLog() const { return m_infoLog; }
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ namespace MobileGL {
|
|||||||
const glslang::TType& type = ent.symbol->getType();
|
const glslang::TType& type = ent.symbol->getType();
|
||||||
const glslang::TString& name = ent.symbol->getAccessName();
|
const glslang::TString& name = ent.symbol->getAccessName();
|
||||||
if (currentStage == EShLangVertex && type.getQualifier().isPipeInput()) {
|
if (currentStage == EShLangVertex && type.getQualifier().isPipeInput()) {
|
||||||
auto it = m_explicitAttribLocations.find(name.c_str());
|
auto it = m_explicitVertexIns.find(name.c_str());
|
||||||
if (it != m_explicitAttribLocations.end()) {
|
if (it != m_explicitVertexIns.end()) {
|
||||||
auto& writableType = ent.symbol->getWritableType();
|
auto& writableType = ent.symbol->getWritableType();
|
||||||
writableType.getQualifier().layoutLocation = it->second;
|
writableType.getQualifier().layoutLocation = it->second;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ namespace MobileGL {
|
|||||||
class TMglGlslIoResolver: public glslang::TDefaultGlslIoResolver {
|
class TMglGlslIoResolver: public glslang::TDefaultGlslIoResolver {
|
||||||
public:
|
public:
|
||||||
using ExplicitVarSlotMap = UnorderedMap<String, Uint>;
|
using ExplicitVarSlotMap = UnorderedMap<String, Uint>;
|
||||||
TMglGlslIoResolver(const glslang::TIntermediate& intermediate, const ExplicitVarSlotMap& attribLocations):
|
TMglGlslIoResolver(const glslang::TIntermediate& intermediate, const ExplicitVarSlotMap& vertexIns, const ExplicitVarSlotMap& fragOuts):
|
||||||
TDefaultGlslIoResolver(intermediate), m_explicitAttribLocations(attribLocations) {}
|
TDefaultGlslIoResolver(intermediate), m_explicitVertexIns(vertexIns), m_explicitFragOuts(fragOuts) {}
|
||||||
TMglGlslIoResolver(const glslang::TProgram& program, const EShLanguage stage, const ExplicitVarSlotMap& attribLocations):
|
TMglGlslIoResolver(const glslang::TProgram& program, const EShLanguage stage, const ExplicitVarSlotMap& vertexIns, const ExplicitVarSlotMap& fragOuts):
|
||||||
TDefaultGlslIoResolver(*program.getIntermediate(stage)),
|
TMglGlslIoResolver(*program.getIntermediate(stage), vertexIns, fragOuts) {}
|
||||||
m_explicitAttribLocations(attribLocations) {}
|
|
||||||
void reserverStorageSlot(glslang::TVarEntryInfo& ent, TInfoSink& infoSink) override;
|
void reserverStorageSlot(glslang::TVarEntryInfo& ent, TInfoSink& infoSink) override;
|
||||||
protected:
|
protected:
|
||||||
const ExplicitVarSlotMap& m_explicitAttribLocations;
|
const ExplicitVarSlotMap& m_explicitVertexIns;
|
||||||
|
const ExplicitVarSlotMap& m_explicitFragOuts;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user