Bug fixes for HECL

This commit is contained in:
Jack Andersen 2015-11-16 10:43:27 -10:00
parent d75c675f7a
commit 181a038901
3 changed files with 19 additions and 19 deletions

View File

@ -13,6 +13,7 @@ struct IGraphicsBuffer
protected:
bool m_dynamic;
IGraphicsBuffer(bool dynamic) : m_dynamic(dynamic) {}
virtual ~IGraphicsBuffer() {}
};
/** Static resource buffer for verts, indices, uniform constants */
@ -59,6 +60,7 @@ struct ITexture
protected:
Type m_type;
ITexture(Type type) : m_type(type) {}
virtual ~ITexture() {}
};
/** Static resource buffer for textures */

View File

@ -262,6 +262,12 @@ public:
other.m_frag = 0;
m_prog = other.m_prog;
other.m_prog = 0;
m_sfactor = other.m_sfactor;
m_dfactor = other.m_dfactor;
m_depthTest = other.m_depthTest;
m_depthWrite = other.m_depthWrite;
m_backfaceCulling = other.m_backfaceCulling;
m_uniLocs = std::move(other.m_uniLocs);
return *this;
}
GLShaderPipeline(GLShaderPipeline&& other) {*this = std::move(other);}
@ -440,18 +446,20 @@ struct GLShaderDataBinding : IShaderDataBinding
m_vtxFormat->bind();
for (size_t i=0 ; i<m_ubufCount ; ++i)
{
if (m_ubufs[i]->dynamic())
static_cast<GLGraphicsBufferD*>(m_ubufs[i])->bindUniform(i);
IGraphicsBuffer* ubuf = m_ubufs[i];
if (ubuf->dynamic())
static_cast<GLGraphicsBufferD*>(ubuf)->bindUniform(i);
else
static_cast<GLGraphicsBufferS*>(m_ubufs[i])->bindUniform(i);
static_cast<GLGraphicsBufferS*>(ubuf)->bindUniform(i);
glUniformBlockBinding(prog, m_pipeline->m_uniLocs.at(i), i);
}
for (size_t i=0 ; i<m_texCount ; ++i)
{
if (m_texs[i]->type() == ITexture::TextureDynamic)
static_cast<GLTextureD*>(m_texs[i])->bind(i);
else if (m_texs[i]->type() == ITexture::TextureStatic)
static_cast<GLTextureS*>(m_texs[i])->bind(i);
ITexture* tex = m_texs[i];
if (tex->type() == ITexture::TextureDynamic)
static_cast<GLTextureD*>(tex)->bind(i);
else if (tex->type() == ITexture::TextureStatic)
static_cast<GLTextureS*>(tex)->bind(i);
}
}
};

View File

@ -118,10 +118,7 @@ class HIDListenerUdev final : public IHIDListener
}
/* Empty handler for SIGTERM */
static void _sigterm(int signo)
{
(void)signo;
}
static void _sigterm(int) {}
static void _udevProc(HIDListenerUdev* listener)
{
@ -132,13 +129,6 @@ class HIDListenerUdev final : public IHIDListener
s.sa_flags = 0;
sigaction(SIGTERM, &s, nullptr);
/* SIGTERM will atomically become unblocked
* when pselect is entered */
sigset_t sigset, oldset;
sigemptyset(&sigset);
sigaddset(&sigset, SIGTERM);
pthread_sigmask(SIG_BLOCK, &sigset, &oldset);
udev_monitor_enable_receiving(listener->m_udevMon);
int fd = udev_monitor_get_fd(listener->m_udevMon);
while (listener->m_udevRunning)
@ -146,7 +136,7 @@ class HIDListenerUdev final : public IHIDListener
fd_set fds;
FD_ZERO(&fds);
FD_SET(fd, &fds);
if (pselect(fd+1, &fds, nullptr, nullptr, nullptr, &oldset) < 0)
if (select(fd+1, &fds, nullptr, nullptr, nullptr) < 0)
{
/* SIGTERM handled here */
if (errno == EINTR)