GLSL shader binding refactor

This commit is contained in:
Jack Andersen 2016-07-07 14:06:42 -10:00
parent 6e761b9870
commit cf09630cdb
2 changed files with 5 additions and 3 deletions

View File

@ -67,18 +67,19 @@ BOO_GLSL_BINDING_HEAD
"}\n";
static const char* BlockNames[] = {"SpecterViewBlock"};
static const char* TexNames[] = {"fontTex"};
void TextView::Resources::init(boo::GLDataFactory::Context& ctx, FontCache* fcache)
{
m_fcache = fcache;
m_regular =
ctx.newShaderPipeline(GLSLVS, GLSLFSReg, 1, "fontTex", 1, BlockNames,
ctx.newShaderPipeline(GLSLVS, GLSLFSReg, 1, TexNames, 1, BlockNames,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, false, false, false);
m_subpixel =
ctx.newShaderPipeline(GLSLVS, GLSLFSSubpixel, 1, "fontTex", 1, BlockNames,
ctx.newShaderPipeline(GLSLVS, GLSLFSSubpixel, 1, TexNames, 1, BlockNames,
boo::BlendFactor::SrcColor1, boo::BlendFactor::InvSrcColor1,
boo::Primitive::TriStrips, false, false, false);
}

View File

@ -75,6 +75,7 @@ BOO_GLSL_BINDING_HEAD
"}\n";
static const char* BlockNames[] = {"SpecterViewBlock"};
static const char* TexNames[] = {"tex"};
void View::Resources::init(boo::GLDataFactory::Context& ctx, const IThemeData& theme)
{
@ -82,7 +83,7 @@ void View::Resources::init(boo::GLDataFactory::Context& ctx, const IThemeData& t
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, false, false, false);
m_texShader = ctx.newShaderPipeline(GLSLTexVS, GLSLTexFS, 1, "tex", 1, BlockNames,
m_texShader = ctx.newShaderPipeline(GLSLTexVS, GLSLTexFS, 1, TexNames, 1, BlockNames,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, false, false, false);
}