diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2017-06-21 13:23:49 +0200 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2017-06-21 13:43:25 -0600 |
commit | c9550bbf6323fe2a5a4665f60b9b9645dca66adf (patch) | |
tree | a069839bb9e612ff1bbfd6dfc25424481ff49e50 /tests/glx | |
parent | 8cdb621a91bc3c37bccf6dced2821431f49cb77f (diff) |
glx/glx-multithread-texture: Avoid uploading stale data to texture
the (tex->color != color) test, if false may cause uploading of stale
tex_data to the texture and cause a comparison failure. Also add a flush
after uploading so that texture data actually becomes visible for the draw
thread.
Cc: Frank Henigman <fjhenigman@google.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'tests/glx')
-rw-r--r-- | tests/glx/glx-multithread-texture.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/glx/glx-multithread-texture.c b/tests/glx/glx-multithread-texture.c index 94ca1bc2e..c838fb7d6 100644 --- a/tests/glx/glx-multithread-texture.c +++ b/tests/glx/glx-multithread-texture.c @@ -113,10 +113,12 @@ load_func(void *arg) if (tex->color != color) { memset(tex_data, color, tex_bytes); tex->color = color; + glBindTexture(GL_TEXTURE_2D, tex->id); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex_width, + tex_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, + tex_data); + glFlush(); } - glBindTexture(GL_TEXTURE_2D, tex->id); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex_width, tex_height, - 0, GL_RGBA, GL_UNSIGNED_BYTE, tex_data); tex = advance(&count, LOAD); } |