Added uniform frequency. (#3485)

* Added uniform frequency.

* Cleanup.

* Cleanup.
This commit is contained in:
Branimir Karadžić
2025-11-10 15:41:33 -08:00
committed by GitHub
parent 8a9bc3ed65
commit 35911ac2d9
25 changed files with 1294 additions and 117 deletions

View File

@@ -367,7 +367,7 @@ public:
s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler);
// Create time uniform.
u_time = bgfx::createUniform("u_time", bgfx::UniformType::Vec4);
u_time = bgfx::createUniform("u_time", bgfx::UniformFreq::Frame, bgfx::UniformType::Vec4);
for(uint32_t ii = 0; ii<BX_COUNTOF( m_textureCube ); ++ii)
{
@@ -592,7 +592,7 @@ public:
int64_t now = bx::getHPCounter();
float time = (float)( (now - m_timeOffset)/double(bx::getHPFrequency() ) );
bgfx::setUniform(u_time, &time);
bgfx::setFrameUniform(u_time, &time);
if (now > m_updateTime)
{