mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-10-03 22:59:18 +00:00
Minor formatting in GLProgram
This commit is contained in:
parent
714ff6c32e
commit
39cf935929
1 changed files with 13 additions and 8 deletions
|
@ -10,9 +10,9 @@ GLProgram::GLProgram() : id(0)
|
||||||
|
|
||||||
int GLProgram::GetLocation(const std::string& name)
|
int GLProgram::GetLocation(const std::string& name)
|
||||||
{
|
{
|
||||||
for(u32 i=0; i<m_locations.size(); ++i)
|
for (u32 i=0; i < m_locations.size(); ++i)
|
||||||
{
|
{
|
||||||
if(!m_locations[i].name.compare(name))
|
if (!m_locations[i].name.compare(name))
|
||||||
{
|
{
|
||||||
return m_locations[i].loc;
|
return m_locations[i].loc;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,9 @@ bool GLProgram::IsCreated() const
|
||||||
|
|
||||||
void GLProgram::Create(const u32 vp, const u32 fp)
|
void GLProgram::Create(const u32 vp, const u32 fp)
|
||||||
{
|
{
|
||||||
if(IsCreated()) Delete();
|
if (IsCreated())
|
||||||
|
Delete();
|
||||||
|
|
||||||
id = glCreateProgram();
|
id = glCreateProgram();
|
||||||
|
|
||||||
glAttachShader(id, vp);
|
glAttachShader(id, vp);
|
||||||
|
@ -44,7 +46,7 @@ void GLProgram::Create(const u32 vp, const u32 fp)
|
||||||
|
|
||||||
GLint linkStatus = GL_FALSE;
|
GLint linkStatus = GL_FALSE;
|
||||||
glGetProgramiv(id, GL_LINK_STATUS, &linkStatus);
|
glGetProgramiv(id, GL_LINK_STATUS, &linkStatus);
|
||||||
if(linkStatus != GL_TRUE)
|
if (linkStatus != GL_TRUE)
|
||||||
{
|
{
|
||||||
GLint bufLength = 0;
|
GLint bufLength = 0;
|
||||||
glGetProgramiv(id, GL_INFO_LOG_LENGTH, &bufLength);
|
glGetProgramiv(id, GL_INFO_LOG_LENGTH, &bufLength);
|
||||||
|
@ -59,10 +61,10 @@ void GLProgram::Create(const u32 vp, const u32 fp)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//else LOG_NOTICE(HLE, "program linked!");
|
//else LOG_NOTICE(HLE, "Program linked!");
|
||||||
|
|
||||||
glGetProgramiv(id, GL_VALIDATE_STATUS, &linkStatus);
|
glGetProgramiv(id, GL_VALIDATE_STATUS, &linkStatus);
|
||||||
if(linkStatus != GL_TRUE)
|
if (linkStatus != GL_TRUE)
|
||||||
{
|
{
|
||||||
GLint bufLength = 0;
|
GLint bufLength = 0;
|
||||||
glGetProgramiv(id, GL_INFO_LOG_LENGTH, &bufLength);
|
glGetProgramiv(id, GL_INFO_LOG_LENGTH, &bufLength);
|
||||||
|
@ -87,7 +89,8 @@ void GLProgram::UnUse()
|
||||||
|
|
||||||
void GLProgram::Use()
|
void GLProgram::Use()
|
||||||
{
|
{
|
||||||
glUseProgram(id);
|
if (id != 0)
|
||||||
|
glUseProgram(id);
|
||||||
checkForGlError("glUseProgram");
|
checkForGlError("glUseProgram");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +110,9 @@ void GLProgram::SetVTex(u32 index)
|
||||||
|
|
||||||
void GLProgram::Delete()
|
void GLProgram::Delete()
|
||||||
{
|
{
|
||||||
if(!IsCreated()) return;
|
if (!IsCreated())
|
||||||
|
return;
|
||||||
|
|
||||||
glDeleteProgram(id);
|
glDeleteProgram(id);
|
||||||
id = 0;
|
id = 0;
|
||||||
m_locations.clear();
|
m_locations.clear();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue