diff --git a/tests/spec/arb_texture_buffer_object/subdata-sync.c b/tests/spec/arb_texture_buffer_object/subdata-sync.c index 636d8fcdd..143b6ff25 100644 --- a/tests/spec/arb_texture_buffer_object/subdata-sync.c +++ b/tests/spec/arb_texture_buffer_object/subdata-sync.c @@ -79,7 +79,28 @@ piglit_display(void) glTexBuffer(GL_TEXTURE_BUFFER, GL_RGBA8, bo); piglit_draw_rect(-1, -1, 1, 2); + + glBufferData(GL_TEXTURE_BUFFER, 4096, NULL, GL_STREAM_DRAW);//or directly glInvalidateBufferData(bo); glBufferSubData(GL_TEXTURE_BUFFER, 0, sizeof(b_rgba8), b_rgba8); + + /* According to EXT_texture_buffer_object, Issue (5): + * "(5) What happens if a buffer object is deleted or respecified when bound + * to a buffer texture? + * + * RESOLVED: BufferData is allowed to be used to update a buffer object that + * has already been bound to a texture with TexBuffer. The update to the data + * is not guaranteed to affect the texture until next time it is bound to a + * texture image unit. When DeleteBuffers is called, any buffer that is + * bound to a texture is removed from the names array, but remains as long as + * it is bound to a texture. The buffer is fully removed when the texture + * unbinds it or when the texture buffer object is deleted." + * + * We need to rebound buffer object to the texture with TexBuffer to be sure + * that our data update affects the texture + */ + glBindTexture(GL_TEXTURE_BUFFER, tex); + glTexBuffer(GL_TEXTURE_BUFFER, GL_RGBA8, bo); + piglit_draw_rect(0, -1, 1, 2); pass = pass && piglit_probe_rect_rgba(0, 0,