Make sure shared uniforms are updated correctly per-map pane

- Broken by shaders being shared between map panes
This commit is contained in:
Dan Paulat 2025-05-17 18:06:38 -05:00
parent f08a7d9a8d
commit 68fcecdc15

View file

@ -58,6 +58,9 @@ public:
bool cfpEnabled_ {false}; bool cfpEnabled_ {false};
std::uint16_t rangeMin_ {0};
float scale_ {1.0f};
bool colorTableNeedsUpdate_ {false}; bool colorTableNeedsUpdate_ {false};
bool sweepNeedsUpdate_ {false}; bool sweepNeedsUpdate_ {false};
}; };
@ -298,6 +301,9 @@ void RadarProductLayer::Render(
gl.glUniform1i(p->uCFPEnabledLocation_, p->cfpEnabled_ ? 1 : 0); gl.glUniform1i(p->uCFPEnabledLocation_, p->cfpEnabled_ ? 1 : 0);
gl.glUniform1ui(p->uDataMomentOffsetLocation_, p->rangeMin_);
gl.glUniform1f(p->uDataMomentScaleLocation_, p->scale_);
gl.glActiveTexture(GL_TEXTURE0); gl.glActiveTexture(GL_TEXTURE0);
gl.glBindTexture(GL_TEXTURE_1D, p->texture_); gl.glBindTexture(GL_TEXTURE_1D, p->texture_);
gl.glBindVertexArray(p->vao_); gl.glBindVertexArray(p->vao_);
@ -553,8 +559,8 @@ void RadarProductLayer::UpdateColorTable(
colorTable.data()); colorTable.data());
gl.glGenerateMipmap(GL_TEXTURE_1D); gl.glGenerateMipmap(GL_TEXTURE_1D);
gl.glUniform1ui(p->uDataMomentOffsetLocation_, rangeMin); p->rangeMin_ = rangeMin;
gl.glUniform1f(p->uDataMomentScaleLocation_, scale); p->scale_ = scale;
} }
} // namespace scwx::qt::map } // namespace scwx::qt::map