Skip to content

Intel Mesa OpenGL bug fixes and cleanup #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class LIBFREENECT2_API DepthPacketStreamParser : public DataCallback

uint32_t current_sequence_;
uint32_t current_subsequence_;
uint32_t processed_packets_;
};

} /* namespace libfreenect2 */
Expand Down
6 changes: 4 additions & 2 deletions examples/protonect/src/command_transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

#include <stdint.h>

#define WRITE_LIBUSB_ERROR(__RESULT) libusb_error_name(__RESULT) << " " << libusb_strerror((libusb_error)__RESULT)

namespace libfreenect2
{
namespace protocol
Expand Down Expand Up @@ -135,7 +137,7 @@ CommandTransaction::ResultCode CommandTransaction::send(const CommandBase& comma

if(r != LIBUSB_SUCCESS)
{
LOG_ERROR << "bulk transfer failed! libusb error " << r << ": " << libusb_error_name(r);
LOG_ERROR << "bulk transfer failed: " << WRITE_LIBUSB_ERROR(r);
code = Error;
}

Expand All @@ -157,7 +159,7 @@ void CommandTransaction::receive(CommandTransaction::Result& result)

if(r != LIBUSB_SUCCESS)
{
LOG_ERROR << "bulk transfer failed! libusb error " << r << ": " << libusb_error_name(r);
LOG_ERROR << "bulk transfer failed: " << WRITE_LIBUSB_ERROR(r);
result.code = Error;
}
}
Expand Down
22 changes: 17 additions & 5 deletions examples/protonect/src/depth_packet_stream_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace libfreenect2

DepthPacketStreamParser::DepthPacketStreamParser() :
processor_(noopProcessor<DepthPacket>()),
processed_packets_(-1),
current_sequence_(0),
current_subsequence_(0)
{
Expand Down Expand Up @@ -79,7 +80,7 @@ void DepthPacketStreamParser::onDataReceived(unsigned char* buffer, size_t in_le

if(wb.length + in_length > wb.capacity)
{
LOG_ERROR << "subpacket too large";
LOG_DEBUG << "subpacket too large";
wb.length = 0;
return;
}
Expand All @@ -91,7 +92,7 @@ void DepthPacketStreamParser::onDataReceived(unsigned char* buffer, size_t in_le
{
if(footer->length != wb.length)
{
LOG_ERROR << "image data too short!";
LOG_DEBUG << "image data too short!";
}
else
{
Expand All @@ -110,15 +111,26 @@ void DepthPacketStreamParser::onDataReceived(unsigned char* buffer, size_t in_le
packet.buffer_length = buffer_.back().length;

processor_->process(packet);

processed_packets_++;
if (processed_packets_ == 0)
processed_packets_ = current_sequence_;
int diff = current_sequence_ - processed_packets_;
const int interval = 30;
if (current_sequence_ % interval == 0 && diff != 0)
{
LOG_INFO << diff << " of " << interval << " packets were lost";
processed_packets_ = current_sequence_;
}
}
else
{
LOG_WARNING << "skipping depth packet";
LOG_DEBUG << "skipping depth packet";
}
}
else
{
LOG_ERROR << "not all subsequences received " << current_subsequence_;
LOG_DEBUG << "not all subsequences received " << current_subsequence_;
}

current_sequence_ = footer->sequence;
Expand All @@ -132,7 +144,7 @@ void DepthPacketStreamParser::onDataReceived(unsigned char* buffer, size_t in_le

if(footer->subsequence * footer->length > fb.length)
{
LOG_ERROR << "front buffer too short! subsequence number is " << footer->subsequence;
LOG_DEBUG << "front buffer too short! subsequence number is " << footer->subsequence;
}
else
{
Expand Down
90 changes: 1 addition & 89 deletions examples/protonect/src/flextGL.c
Original file line number Diff line number Diff line change
@@ -1,46 +1,11 @@
/* WARNING: This file was automatically generated */
/* Do not edit. */

#include "flextGL.h"
#include "GLFW/glfw3.h"

#include <stdio.h>


#ifdef __cplusplus
extern "C" {
#endif


void flextLoadOpenGLFunctions(OpenGLBindings *bindings);

int flextInit(GLFWwindow* window, OpenGLBindings *bindings)
{

int major = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR);
int minor = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR);

flextLoadOpenGLFunctions(bindings);

/* --- Check for minimal version and profile --- */

if (major * 10 + minor < 33) {
fprintf(stderr, "Error: OpenGL version 3.3 not supported.\n");
fprintf(stderr, " Your version is %d.%d.\n", major, minor);
fprintf(stderr, " Try updating your graphics driver.\n");
return GL_FALSE;
}


/* --- Check for extensions --- */


return GL_TRUE;
}



void flextLoadOpenGLFunctions(OpenGLBindings *bindings)
void flextInit(OpenGLBindings *bindings)
{
/* --- Function pointer loading --- */

Expand Down Expand Up @@ -305,59 +270,6 @@ void flextLoadOpenGLFunctions(OpenGLBindings *bindings)
bindings->glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAME_PROC*)glfwGetProcAddress("glGetActiveUniformBlockName");
bindings->glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDING_PROC*)glfwGetProcAddress("glUniformBlockBinding");

/* GL_VERSION_3_2 */

bindings->glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEX_PROC*)glfwGetProcAddress("glDrawElementsBaseVertex");
bindings->glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEX_PROC*)glfwGetProcAddress("glDrawRangeElementsBaseVertex");
bindings->glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEX_PROC*)glfwGetProcAddress("glDrawElementsInstancedBaseVertex");
bindings->glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEX_PROC*)glfwGetProcAddress("glMultiDrawElementsBaseVertex");
bindings->glProvokingVertex = (PFNGLPROVOKINGVERTEX_PROC*)glfwGetProcAddress("glProvokingVertex");
bindings->glFenceSync = (PFNGLFENCESYNC_PROC*)glfwGetProcAddress("glFenceSync");
bindings->glIsSync = (PFNGLISSYNC_PROC*)glfwGetProcAddress("glIsSync");
bindings->glDeleteSync = (PFNGLDELETESYNC_PROC*)glfwGetProcAddress("glDeleteSync");
bindings->glClientWaitSync = (PFNGLCLIENTWAITSYNC_PROC*)glfwGetProcAddress("glClientWaitSync");
bindings->glWaitSync = (PFNGLWAITSYNC_PROC*)glfwGetProcAddress("glWaitSync");
bindings->glGetInteger64v = (PFNGLGETINTEGER64V_PROC*)glfwGetProcAddress("glGetInteger64v");
bindings->glGetSynciv = (PFNGLGETSYNCIV_PROC*)glfwGetProcAddress("glGetSynciv");
bindings->glGetInteger64i_v = (PFNGLGETINTEGER64I_V_PROC*)glfwGetProcAddress("glGetInteger64i_v");
bindings->glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64V_PROC*)glfwGetProcAddress("glGetBufferParameteri64v");
bindings->glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTURE_PROC*)glfwGetProcAddress("glFramebufferTexture");
bindings->glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLE_PROC*)glfwGetProcAddress("glTexImage2DMultisample");
bindings->glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLE_PROC*)glfwGetProcAddress("glTexImage3DMultisample");
bindings->glGetMultisamplefv = (PFNGLGETMULTISAMPLEFV_PROC*)glfwGetProcAddress("glGetMultisamplefv");
bindings->glSampleMaski = (PFNGLSAMPLEMASKI_PROC*)glfwGetProcAddress("glSampleMaski");

/* GL_VERSION_3_3 */

bindings->glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXED_PROC*)glfwGetProcAddress("glBindFragDataLocationIndexed");
bindings->glGetFragDataIndex = (PFNGLGETFRAGDATAINDEX_PROC*)glfwGetProcAddress("glGetFragDataIndex");
bindings->glGenSamplers = (PFNGLGENSAMPLERS_PROC*)glfwGetProcAddress("glGenSamplers");
bindings->glDeleteSamplers = (PFNGLDELETESAMPLERS_PROC*)glfwGetProcAddress("glDeleteSamplers");
bindings->glIsSampler = (PFNGLISSAMPLER_PROC*)glfwGetProcAddress("glIsSampler");
bindings->glBindSampler = (PFNGLBINDSAMPLER_PROC*)glfwGetProcAddress("glBindSampler");
bindings->glSamplerParameteri = (PFNGLSAMPLERPARAMETERI_PROC*)glfwGetProcAddress("glSamplerParameteri");
bindings->glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIV_PROC*)glfwGetProcAddress("glSamplerParameteriv");
bindings->glSamplerParameterf = (PFNGLSAMPLERPARAMETERF_PROC*)glfwGetProcAddress("glSamplerParameterf");
bindings->glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFV_PROC*)glfwGetProcAddress("glSamplerParameterfv");
bindings->glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIV_PROC*)glfwGetProcAddress("glSamplerParameterIiv");
bindings->glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIV_PROC*)glfwGetProcAddress("glSamplerParameterIuiv");
bindings->glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIV_PROC*)glfwGetProcAddress("glGetSamplerParameteriv");
bindings->glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIV_PROC*)glfwGetProcAddress("glGetSamplerParameterIiv");
bindings->glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFV_PROC*)glfwGetProcAddress("glGetSamplerParameterfv");
bindings->glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIV_PROC*)glfwGetProcAddress("glGetSamplerParameterIuiv");
bindings->glQueryCounter = (PFNGLQUERYCOUNTER_PROC*)glfwGetProcAddress("glQueryCounter");
bindings->glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64V_PROC*)glfwGetProcAddress("glGetQueryObjecti64v");
bindings->glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64V_PROC*)glfwGetProcAddress("glGetQueryObjectui64v");
bindings->glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISOR_PROC*)glfwGetProcAddress("glVertexAttribDivisor");
bindings->glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UI_PROC*)glfwGetProcAddress("glVertexAttribP1ui");
bindings->glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIV_PROC*)glfwGetProcAddress("glVertexAttribP1uiv");
bindings->glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UI_PROC*)glfwGetProcAddress("glVertexAttribP2ui");
bindings->glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIV_PROC*)glfwGetProcAddress("glVertexAttribP2uiv");
bindings->glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UI_PROC*)glfwGetProcAddress("glVertexAttribP3ui");
bindings->glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIV_PROC*)glfwGetProcAddress("glVertexAttribP3uiv");
bindings->glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UI_PROC*)glfwGetProcAddress("glVertexAttribP4ui");
bindings->glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIV_PROC*)glfwGetProcAddress("glVertexAttribP4uiv");

}

/* ----------------------- Extension flag definitions ---------------------- */
Expand Down
Loading