Fixing the bad rendering of the instanced primitives on 4.1

This commit is contained in:
samcake 2017-04-03 11:49:00 -07:00
parent 3c62826ef9
commit c3c73b209a
4 changed files with 14 additions and 1 deletions

View file

@ -571,10 +571,15 @@ void OpenGLDisplayPlugin::compositeLayers() {
compositeScene();
}
#ifdef HIFI_ENABLE_NSIGHT_DEBUG
if (false) // do not compositeoverlay if running nsight debug
#endif
{
PROFILE_RANGE_EX(render_detail, "compositeOverlay", 0xff0077ff, (uint64_t)presentCount())
compositeOverlay();
}
auto compositorHelper = DependencyManager::get<CompositorHelper>();
if (compositorHelper->getReticleVisible()) {
PROFILE_RANGE_EX(render_detail, "compositePointer", 0xff0077ff, (uint64_t)presentCount())

View file

@ -28,6 +28,9 @@
#include <GL/wglew.h>
// Uncomment this define and recompile to be able to avoid code path preventing to be able to run nsight graphics debug
//#define HIFI_ENABLE_NSIGHT_DEBUG 1
#endif
#endif // hifi_gpu_GPUConfig_h

View file

@ -278,6 +278,11 @@ void OffscreenQmlSurface::cleanup() {
}
void OffscreenQmlSurface::render() {
#ifdef HIFI_ENABLE_NSIGHT_DEBUG
return;
#endif
if (_paused) {
return;
}

View file

@ -95,7 +95,6 @@ void GL41Backend::updateTransform(const Batch& batch) {
} else {
if (!_transform._enabledDrawcallInfoBuffer) {
glEnableVertexAttribArray(gpu::Stream::DRAW_CALL_INFO); // Make sure attrib array is enabled
glBindBuffer(GL_ARRAY_BUFFER, _transform._drawCallInfoBuffer);
#ifdef GPU_STEREO_DRAWCALL_INSTANCED
glVertexAttribDivisor(gpu::Stream::DRAW_CALL_INFO, (isStereo() ? 2 : 1));
#else
@ -103,6 +102,7 @@ void GL41Backend::updateTransform(const Batch& batch) {
#endif
_transform._enabledDrawcallInfoBuffer = true;
}
glBindBuffer(GL_ARRAY_BUFFER, _transform._drawCallInfoBuffer);
glVertexAttribIPointer(gpu::Stream::DRAW_CALL_INFO, 2, GL_UNSIGNED_SHORT, 0, _transform._drawCallInfoOffsets[batch._currentNamedCall]);
}