GentenStudios / QuartzEngine

Nolonger used, see Phoenix repo
BSD 3-Clause "New" or "Revised" License
34 stars 10 forks source link

Crash when calling ``GLRenderDevice::draw`` without a bound shader pipeline. #126

Open vyomfadia opened 5 years ago

vyomfadia commented 5 years ago

If GLRenderDevice::setShaderPipeline is not called before the GLRenderDevice::draw function, a crash occurs at:

(GLRenderDevice.cpp, Lines 96-102)

void GLRenderDevice::draw(std::size_t first, std::size_t count)
{
    GLShaderPipeline& shader = m_shaders[m_boundShader.get()];
    InputLayout& inputLayout = shader.getInputLayout();

    for (const VertexElement& vertexElement : inputLayout.elements)
    {

This could potentially be fixed by a simple conditional statement, and then just replace the element being iterated over with an empty one temporarily..

apachano commented 5 years ago

@beeperdeeper089 Please add a priority label to this. Thanks!