From 88d48994edfdd853102a41e2ca35c6bd08235055 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Mon, 28 Sep 2015 16:17:56 -0700 Subject: [PATCH 1/2] Disabling glVertexAttribFormat for now because of an issue with instancing --- libraries/gpu/src/gpu/GLBackendInput.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/gpu/src/gpu/GLBackendInput.cpp b/libraries/gpu/src/gpu/GLBackendInput.cpp index 6a4a092c64..91c5492c2c 100755 --- a/libraries/gpu/src/gpu/GLBackendInput.cpp +++ b/libraries/gpu/src/gpu/GLBackendInput.cpp @@ -91,7 +91,11 @@ void GLBackend::syncInputStateCache() { #if (GPU_INPUT_PROFILE == GPU_CORE_41) #define NO_SUPPORT_VERTEX_ATTRIB_FORMAT #else -#define SUPPORT_VERTEX_ATTRIB_FORMAT +// FIXME unfortunately, something is wrong with the SUPPORT_VERTEX_ATTRIB_FORMAT manipulation of vertex attrib divisors +// You can see this problem if you load the sandbox model and a non-procedrual sphere (or any other instanced primitive) +// and can see them in a stereo view. The right eye view will lack textures because for some reason the texture +// vertex attribute still retains the divisor from the instanced rendering at the end of the previous frame. +//#define SUPPORT_VERTEX_ATTRIB_FORMAT #endif void GLBackend::updateInput() { From 375d7839970037e539b3250f6aad9134cbad7ee1 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Mon, 28 Sep 2015 17:13:51 -0700 Subject: [PATCH 2/2] Better fix for texture issues in stereo --- libraries/gpu/src/gpu/GLBackendInput.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libraries/gpu/src/gpu/GLBackendInput.cpp b/libraries/gpu/src/gpu/GLBackendInput.cpp index 91c5492c2c..866459a158 100755 --- a/libraries/gpu/src/gpu/GLBackendInput.cpp +++ b/libraries/gpu/src/gpu/GLBackendInput.cpp @@ -91,11 +91,7 @@ void GLBackend::syncInputStateCache() { #if (GPU_INPUT_PROFILE == GPU_CORE_41) #define NO_SUPPORT_VERTEX_ATTRIB_FORMAT #else -// FIXME unfortunately, something is wrong with the SUPPORT_VERTEX_ATTRIB_FORMAT manipulation of vertex attrib divisors -// You can see this problem if you load the sandbox model and a non-procedrual sphere (or any other instanced primitive) -// and can see them in a stereo view. The right eye view will lack textures because for some reason the texture -// vertex attribute still retains the divisor from the instanced rendering at the end of the previous frame. -//#define SUPPORT_VERTEX_ATTRIB_FORMAT +#define SUPPORT_VERTEX_ATTRIB_FORMAT #endif void GLBackend::updateInput() { @@ -121,9 +117,9 @@ void GLBackend::updateInput() { for (size_t locNum = 0; locNum < locationCount; ++locNum) { newActivation.set(slot + locNum); glVertexAttribFormat(slot + locNum, count, type, isNormalized, offset + locNum * perLocationSize); - glVertexAttribDivisor(slot + locNum, attrib._frequency); glVertexAttribBinding(slot + locNum, attrib._channel); } + glVertexBindingDivisor(attrib._channel, attrib._frequency); } (void) CHECK_GL_ERROR(); }