本文整理汇总了C++中VertexShader::GetShaderFileName方法的典型用法代码示例。如果您正苦于以下问题:C++ VertexShader::GetShaderFileName方法的具体用法?C++ VertexShader::GetShaderFileName怎么用?C++ VertexShader::GetShaderFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VertexShader
的用法示例。
在下文中一共展示了VertexShader::GetShaderFileName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __GetUniformLocation
//----------------------------------------------------------------------------
void OpenGLDevice::__GetUniformLocation(ShaderProgram* program,
ShaderUniform* uniform, const char* name)
{
OpenGLShaderProgramHandle* programHandle =
(OpenGLShaderProgramHandle*)program->GetProgramHandle();
RTGI_ASSERT(programHandle);
GLint loc = glGetUniformLocation(programHandle->mProgram, name);
if( !uniform->mUniformHandle )
{
uniform->mUniformHandle = new OpenGLShaderUniformHandle();
uniform->mUniformHandle->Device = this;
}
((OpenGLShaderUniformHandle*)uniform->mUniformHandle)->mUniform = loc;
#ifdef _DEBUG
if( loc < 0 )
{
Terminal::Output(Terminal::OC_Warning_Level4,
"Uniform: \'%s\' not found in: \n", name);
VertexShader* vs = program->GetVertexShader();
if( vs )
{
Terminal::Output(Terminal::OC_Warning_Level4, " %s\n",
vs->GetShaderFileName().c_str());
}
FragmentShader* fs = program->GetFragmentShader();
if( fs )
{
Terminal::Output(Terminal::OC_Warning_Level4, " %s\n",
fs->GetShaderFileName().c_str());
}
TessellationControlShader* tcs = program->GetTessellationControlShader();
if( tcs )
{
Terminal::Output(Terminal::OC_Warning_Level4, " %s\n",
tcs->GetShaderFileName().c_str());
}
TessellationEvaluationShader* tes = program->GetTessellationEvaluationShader();
if( tes )
{
Terminal::Output(Terminal::OC_Warning_Level4, " %s\n",
tes->GetShaderFileName().c_str());
}
GeometryShader* gs = program->GetGeometryShader();
if( gs )
{
Terminal::Output(Terminal::OC_Warning_Level4, " %s\n",
gs->GetShaderFileName().c_str());
}
ComputeShader* cs = program->GetComputeShader();
if( cs )
{
Terminal::Output(Terminal::OC_Warning_Level4, " %s\n",
cs->GetShaderFileName().c_str());
}
}
#endif
OPENGL_DEVICE_CHECK_ERROR;
}
示例2: __CreateProgram
//----------------------------------------------------------------------------
ShaderProgramHandle* OpenGLDevice::__CreateProgram(ShaderProgram* program)
{
GLuint __program = glCreateProgram();
std::string linkingString("Linking program");
VertexShader* vShader = program->GetVertexShader();
if( vShader )
{
vShader->CreateDeviceResource(this);
OpenGLShaderHandle* vsHandle =
(OpenGLShaderHandle*)vShader->GetShaderHandle();
glAttachShader(__program, vsHandle->mShader);
linkingString += " ";
linkingString += vShader->GetShaderFileName();
}
FragmentShader* fShader = program->GetFragmentShader();
if( fShader )
{
fShader->CreateDeviceResource(this);
OpenGLShaderHandle* fsHandle =
(OpenGLShaderHandle*)fShader->GetShaderHandle();
glAttachShader(__program, fsHandle->mShader);
linkingString += " ";
linkingString += fShader->GetShaderFileName();
}
GeometryShader* gShader = program->GetGeometryShader();
if( gShader )
{
gShader->CreateDeviceResource(this);
OpenGLShaderHandle* gsHandle =
(OpenGLShaderHandle*)gShader->GetShaderHandle();
glAttachShader(__program, gsHandle->mShader);
linkingString += " ";
linkingString += gShader->GetShaderFileName();
}
ComputeShader* cShader = program->GetComputeShader();
if( cShader )
{
cShader->CreateDeviceResource(this);
OpenGLShaderHandle* csHandle =
(OpenGLShaderHandle*)cShader->GetShaderHandle();
glAttachShader(__program, csHandle->mShader);
linkingString += " ";
linkingString += cShader->GetShaderFileName();
}
TessellationControlShader* tcShader = program->GetTessellationControlShader();
if( tcShader )
{
tcShader->CreateDeviceResource(this);
OpenGLShaderHandle* tcsHandle =
(OpenGLShaderHandle*)tcShader->GetShaderHandle();
glAttachShader(__program, tcsHandle->mShader);
linkingString += " ";
linkingString += tcShader->GetShaderFileName();
}
TessellationEvaluationShader* teShader = program->GetTessellationEvaluationShader();
if( teShader )
{
teShader->CreateDeviceResource(this);
OpenGLShaderHandle* tesHandle =
(OpenGLShaderHandle*)teShader->GetShaderHandle();
glAttachShader(__program, tesHandle->mShader);
linkingString += " ";
linkingString += teShader->GetShaderFileName();
}
glLinkProgram(__program);
GLint linked;
glGetProgramiv(__program, GL_LINK_STATUS, &linked);
if( !linked )
{
GLint iInfoLen = 0;
glGetProgramiv(__program, GL_INFO_LOG_LENGTH, &iInfoLen);
if( iInfoLen > 1 )
{
char* acInfoLog = new char[iInfoLen];
glGetProgramInfoLog(__program, iInfoLen, 0, acInfoLog);
linkingString += " failed";
Terminal::Output(Terminal::OC_Error, "%s\n%s\n",
linkingString.c_str(), acInfoLog);
delete[] acInfoLog;
}
RTGI_ASSERT(false);
return 0;
}
#ifdef RTGI_OUTPUT_SHADER_RESOURCE_LOADING
linkingString += " finished";
Terminal::Output(Terminal::OC_Success, "%s\n", linkingString.c_str());
#endif
OPENGL_DEVICE_CHECK_ERROR;
//.........这里部分代码省略.........