mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Refactored uniform types.
This commit is contained in:
@@ -193,9 +193,9 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(mem);
|
||||
|
||||
// Create texture sampler uniforms.
|
||||
bgfx::UniformHandle u_texColor0 = bgfx::createUniform("u_texColor0", bgfx::UniformType::Uniform1iv);
|
||||
bgfx::UniformHandle u_texColor1 = bgfx::createUniform("u_texColor1", bgfx::UniformType::Uniform1iv);
|
||||
bgfx::UniformHandle u_color = bgfx::createUniform("u_color", bgfx::UniformType::Uniform4fv);
|
||||
bgfx::UniformHandle s_texColor0 = bgfx::createUniform("s_texColor0", bgfx::UniformType::Int1);
|
||||
bgfx::UniformHandle s_texColor1 = bgfx::createUniform("s_texColor1", bgfx::UniformType::Int1);
|
||||
bgfx::UniformHandle u_color = bgfx::createUniform("u_color", bgfx::UniformType::Vec4);
|
||||
|
||||
bgfx::ProgramHandle blend = loadProgram("vs_oit", "fs_oit" );
|
||||
bgfx::ProgramHandle wbSeparatePass = loadProgram("vs_oit", "fs_oit_wb_separate" );
|
||||
@@ -424,8 +424,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
|
||||
if (0 != mode)
|
||||
{
|
||||
bgfx::setTexture(0, u_texColor0, fbtextures[0]);
|
||||
bgfx::setTexture(1, u_texColor1, fbtextures[1]);
|
||||
bgfx::setTexture(0, s_texColor0, fbtextures[0]);
|
||||
bgfx::setTexture(1, s_texColor1, fbtextures[1]);
|
||||
bgfx::setProgram(1 == mode ? wbSeparateBlit : wbBlit);
|
||||
bgfx::setState(0
|
||||
| BGFX_STATE_RGB_WRITE
|
||||
@@ -451,8 +451,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
||||
bgfx::destroyProgram(wbSeparateBlit);
|
||||
bgfx::destroyProgram(wbPass);
|
||||
bgfx::destroyProgram(wbBlit);
|
||||
bgfx::destroyUniform(u_texColor0);
|
||||
bgfx::destroyUniform(u_texColor1);
|
||||
bgfx::destroyUniform(s_texColor0);
|
||||
bgfx::destroyUniform(s_texColor1);
|
||||
bgfx::destroyUniform(u_color);
|
||||
|
||||
// Shutdown bgfx.
|
||||
|
||||
Reference in New Issue
Block a user