st/nine: Fix Multithreading issue with MANAGED buffers
authorAxel Davy <axel.davy@ens.fr>
Thu, 25 Feb 2016 18:07:37 +0000 (19:07 +0100)
committerAxel Davy <axel.davy@ens.fr>
Mon, 29 Feb 2016 17:55:58 +0000 (18:55 +0100)
commit44246fe99d4c880b70a58043624bf023237009f5
tree17ae49fc91041afd018e1b193539646b88ae4242
parent35c858c42c818d5bf5b4bfee03a342df52acface
st/nine: Fix Multithreading issue with MANAGED buffers

d3d calls are protected by mutexes, however if app is doing in
two threads:

Thread 1: buffer Lock
Thread 2: Draw call
Thread 1: writes data
Thread 1: Unlock

Then before this patch, the Draw call would begin to upload
the buffer.

Solves this by moving the moment we add the buffer to the queue
of things to upload (We move it from Lock time to Unlock time).

Cc: "11.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/buffer9.c