wined3d: Do not accelerate NOOVERWRITE maps if we cannot map persistently.

I.e. if ARB_buffer_storage is not supported.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-05-30 20:10:07 -05:00 committed by Alexandre Julliard
parent 1c66d05a9c
commit d838cf7004
4 changed files with 6 additions and 1 deletions

View file

@ -5231,6 +5231,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
d3d_info->fences = wined3d_fence_supported(gl_info);
d3d_info->feature_level = feature_level_from_caps(gl_info, &shader_caps, &fragment_caps);
d3d_info->filling_convention_offset = gl_info->filling_convention_offset;
d3d_info->persistent_map = !!gl_info->supported[ARB_BUFFER_STORAGE];
if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE])
d3d_info->multisample_draw_location = WINED3D_LOCATION_TEXTURE_RGB;

View file

@ -2351,6 +2351,7 @@ static void wined3d_adapter_vk_init_d3d_info(struct wined3d_adapter_vk *adapter_
d3d_info->feature_level = feature_level_from_caps(&shader_caps);
d3d_info->subpixel_viewport = true;
d3d_info->fences = true;
d3d_info->persistent_map = true;
/* Like GL, Vulkan doesn't explicitly specify a filling convention and only mandates that a
* shared edge of two adjacent triangles generate a fragment for exactly one of the triangles.

View file

@ -1008,11 +1008,13 @@ static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resourc
addr.buffer_object = buffer->buffer_object;
addr.addr = 0;
buffer->map_ptr = wined3d_context_map_bo_address(context, &addr, resource->size, flags);
/* We are accessing buffer->resource.client from the CS thread,
* but it's safe because the client thread will wait for the
* map to return, thus completely serializing this call with
* other client code. */
buffer->resource.client.addr = addr;
if (context->d3d_info->persistent_map)
buffer->resource.client.addr = addr;
if (((DWORD_PTR)buffer->map_ptr) & (RESOURCE_ALIGNMENT - 1))
{

View file

@ -243,6 +243,7 @@ struct wined3d_d3d_info
uint32_t pbo : 1;
uint32_t subpixel_viewport : 1;
uint32_t fences : 1;
uint32_t persistent_map : 1;
enum wined3d_feature_level feature_level;
DWORD multisample_draw_location;