mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
Merge pull request #13443 from samcake/punk
report FIx from rc69 to master: Fix for the point light test flashing in HMD
This commit is contained in:
commit
0c9f0cbe03
4 changed files with 28 additions and 3 deletions
|
@ -278,6 +278,7 @@ protected:
|
|||
|
||||
struct InputStageState {
|
||||
bool _invalidFormat { true };
|
||||
bool _lastUpdateStereoState{ false };
|
||||
bool _hadColorAttribute{ true };
|
||||
Stream::FormatPointer _format;
|
||||
std::string _formatKey;
|
||||
|
|
|
@ -156,6 +156,14 @@ void GLBackend::do_setIndirectBuffer(const Batch& batch, size_t paramOffset) {
|
|||
}
|
||||
|
||||
void GLBackend::updateInput() {
|
||||
bool isStereoNow = isStereo();
|
||||
// track stereo state change potentially happening wihtout changing the input format
|
||||
// this is a rare case requesting to invalid the format
|
||||
#ifdef GPU_STEREO_DRAWCALL_INSTANCED
|
||||
_input._invalidFormat |= (isStereoNow != _input._lastUpdateStereoState);
|
||||
#endif
|
||||
_input._lastUpdateStereoState = isStereoNow;
|
||||
|
||||
if (_input._invalidFormat) {
|
||||
InputStageState::ActivationCache newActivation;
|
||||
|
||||
|
@ -213,7 +221,7 @@ void GLBackend::updateInput() {
|
|||
(void)CHECK_GL_ERROR();
|
||||
}
|
||||
#ifdef GPU_STEREO_DRAWCALL_INSTANCED
|
||||
glVertexBindingDivisor(bufferChannelNum, frequency * (isStereo() ? 2 : 1));
|
||||
glVertexBindingDivisor(bufferChannelNum, frequency * (isStereoNow ? 2 : 1));
|
||||
#else
|
||||
glVertexBindingDivisor(bufferChannelNum, frequency);
|
||||
#endif
|
||||
|
|
|
@ -25,6 +25,14 @@ void GL41Backend::resetInputStage() {
|
|||
}
|
||||
|
||||
void GL41Backend::updateInput() {
|
||||
bool isStereoNow = isStereo();
|
||||
// track stereo state change potentially happening wihtout changing the input format
|
||||
// this is a rare case requesting to invalid the format
|
||||
#ifdef GPU_STEREO_DRAWCALL_INSTANCED
|
||||
_input._invalidFormat |= (isStereoNow != _input._lastUpdateStereoState);
|
||||
#endif
|
||||
_input._lastUpdateStereoState = isStereoNow;
|
||||
|
||||
if (_input._invalidFormat || _input._invalidBuffers.any()) {
|
||||
|
||||
if (_input._invalidFormat) {
|
||||
|
@ -111,7 +119,7 @@ void GL41Backend::updateInput() {
|
|||
reinterpret_cast<GLvoid*>(pointer + perLocationStride * (GLuint)locNum));
|
||||
}
|
||||
#ifdef GPU_STEREO_DRAWCALL_INSTANCED
|
||||
glVertexAttribDivisor(slot + (GLuint)locNum, attrib._frequency * (isStereo() ? 2 : 1));
|
||||
glVertexAttribDivisor(slot + (GLuint)locNum, attrib._frequency * (isStereoNow ? 2 : 1));
|
||||
#else
|
||||
glVertexAttribDivisor(slot + (GLuint)locNum, attrib._frequency);
|
||||
#endif
|
||||
|
|
|
@ -27,6 +27,14 @@ void GL45Backend::resetInputStage() {
|
|||
}
|
||||
|
||||
void GL45Backend::updateInput() {
|
||||
bool isStereoNow = isStereo();
|
||||
// track stereo state change potentially happening wihtout changing the input format
|
||||
// this is a rare case requesting to invalid the format
|
||||
#ifdef GPU_STEREO_DRAWCALL_INSTANCED
|
||||
_input._invalidFormat |= (isStereoNow != _input._lastUpdateStereoState);
|
||||
#endif
|
||||
_input._lastUpdateStereoState = isStereoNow;
|
||||
|
||||
if (_input._invalidFormat) {
|
||||
InputStageState::ActivationCache newActivation;
|
||||
|
||||
|
@ -84,7 +92,7 @@ void GL45Backend::updateInput() {
|
|||
(void)CHECK_GL_ERROR();
|
||||
}
|
||||
#ifdef GPU_STEREO_DRAWCALL_INSTANCED
|
||||
glVertexBindingDivisor(bufferChannelNum, frequency * (isStereo() ? 2 : 1));
|
||||
glVertexBindingDivisor(bufferChannelNum, frequency * (isStereoNow ? 2 : 1));
|
||||
#else
|
||||
glVertexBindingDivisor(bufferChannelNum, frequency);
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue