Jump to content

  • Log In with Google      Sign In   
  • Create Account

Rarosu

Member Since 16 Jun 2010
Offline Last Active Aug 06 2016 01:29 AM

Posts I've Made

In Topic: Only the last instance is rendered

17 September 2015 - 03:41 PM

Calling glFinish() after the first draw call seems to fix this problem. Obviously this is not ideal as it will block the execution until the draw call has finished, but it will at least fix the symptoms.


In Topic: Only the last instance is rendered

17 September 2015 - 03:31 PM

@Glass_Knife Hah. It it a frightening thought to think how many hidden driver errors there are out there.

 

Updating the Intel driver to 9.17.10.4229 did not solve the problem unfortunately. The only solution I can see currently is revert to using glUniform* or create separate uniform buffer objects for each instance. Which sucks. If I find out anything else I'll update this thread.

 

- Rarosu


In Topic: Only the last instance is rendered

17 September 2015 - 03:14 PM

Running this project on an Nvidia card instead yielded the expected results... Two boxes. Either Nvidia is lenient with whatever error I might be doing, or this Intel driver has some bug. I will look into updating my drivers and see if this fixes the problem.


In Topic: Only the last instance is rendered

17 September 2015 - 02:45 PM

@beans222 I don't think that is the problem in this case, but to be safe, I have tried changing the uniform data to an array of 4 floats and will include it in the edit.


In Topic: Only the last instance is rendered

17 September 2015 - 02:38 PM

Thanks for the reply, GlassKnife, I'll edit the original post with the code.

 

I have reduced the issue to where I know there is something going on with the uniform bindings. I have tried making a separate program, VBO and VAO for the second instance and the same problem occurs. When I make a separate uniform buffer object however and fill it with the same data, it works. That is, the difference between:

glUseProgram(program);
glBindVertexArray(vao);

// Instance is rendered.
uniform_buffer_data.offset = 1.3f;
glBindBufferBase(GL_UNIFORM_BUFFER, UNIFORM_BINDING, uniform_buffer);
glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(UniformBuffer), &uniform_buffer_data);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

// This instance is also rendered.
ubo_data2.offset = -0.4f;
glBindBufferBase(GL_UNIFORM_BUFFER, UNIFORM_BINDING, ubo2);
glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(UniformBuffer), &ubo_data2);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

And this:

glUseProgram(program);
glBindVertexArray(vao);

// This instance is no longer visible.
uniform_buffer_data.offset = 1.3f;
glBindBufferBase(GL_UNIFORM_BUFFER, UNIFORM_BINDING, uniform_buffer);
glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(UniformBuffer), &uniform_buffer_data);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

// And only this one is rendered.
uniform_buffer_data.offset = -0.4f;
glBindBufferBase(GL_UNIFORM_BUFFER, UNIFORM_BINDING, uniform_buffer);
glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(UniformBuffer), &uniform_buffer_data);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

As for checking the state, I am not sure what to look for in this scenario. I tried apitrace at your suggestion (which seems awesome) and the state looks fine to me; as I would expect it.


PARTNERS