• Zebediah Figura's avatar
    wined3d: Prefer mapping a BO if the buffer has WINED3D_BUFFER_USE_BO set. · 6b96021a
    Zebediah Figura authored
    Instead of checking whether a BO already exists.
    
    This will end up allocating a BO earlier in some cases. This is not particularly
    impactful by itself, since we already would have sysmem available and thus could
    use it without a performance penalty. However, we would like to avoid ever
    allocating sysmem where not necessary, in particular by deferring allocation of
    any location at all until the resource is written to.
    
    This also has the side effect of fixing test_map_synchronization() on 64-bit
    architectures, broken since 194b47b4. The test
    creates a buffer, maps it once, then maps it again with NOOVERWRITE while the
    GPU is still drawing, expecting the new data to be read by the GPU during the
    draw. On 32-bit machines, and 64-bit machines before the offending commit, we do
    the following:
    
    First map: uses SYSMEM since the BO is not created yet
    Draw: upload to VBO
    Second map: map the existing VBO with GL_MAP_UNSYNCHRONIZED_BIT
    
    After 194b47b4, we don't use GL_MAP_UNSYNCHRONIZED_BIT since the buffer has
    READ access, which means that the second map will be synchronized and wait for
    the draw to complete.
    
    After this patch, we do the following:
    
    First map: create and map a VBO (not unsynchronized, but coherent and
    persistently mapped)
    Draw: use mapped VBO
    Second map: write to existing (coherent) VBO, which is unsynchronized
    Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com>
    Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com>
    Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
    6b96021a
Name
Last commit
Last update
dlls Loading commit data...
documentation Loading commit data...
fonts Loading commit data...
include Loading commit data...
libs Loading commit data...
loader Loading commit data...
nls Loading commit data...
po Loading commit data...
programs Loading commit data...
server Loading commit data...
tools Loading commit data...
.editorconfig Loading commit data...
.mailmap Loading commit data...
ANNOUNCE Loading commit data...
AUTHORS Loading commit data...
COPYING.LIB Loading commit data...
LICENSE Loading commit data...
LICENSE.OLD Loading commit data...
MAINTAINERS Loading commit data...
README Loading commit data...
VERSION Loading commit data...
aclocal.m4 Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...