wined3d: Don't submit fences when the GL context doesn't support them.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2022-04-27 13:21:54 +02:00 committed by Alexandre Julliard
parent aebee707e6
commit 4aac4bbea6
6 changed files with 16 additions and 9 deletions

View File

@ -5228,6 +5228,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
d3d_info->scaled_resolve = !!gl_info->supported[EXT_FRAMEBUFFER_MULTISAMPLE_BLIT_SCALED]; d3d_info->scaled_resolve = !!gl_info->supported[EXT_FRAMEBUFFER_MULTISAMPLE_BLIT_SCALED];
d3d_info->pbo = !!gl_info->supported[ARB_PIXEL_BUFFER_OBJECT]; d3d_info->pbo = !!gl_info->supported[ARB_PIXEL_BUFFER_OBJECT];
d3d_info->subpixel_viewport = gl_info->limits.viewport_subpixel_bits >= 8; d3d_info->subpixel_viewport = gl_info->limits.viewport_subpixel_bits >= 8;
d3d_info->fences = wined3d_fence_supported(gl_info);
d3d_info->feature_level = feature_level_from_caps(gl_info, &shader_caps, &fragment_caps); 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->filling_convention_offset = gl_info->filling_convention_offset;

View File

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

View File

@ -2865,9 +2865,12 @@ static void *wined3d_bo_gl_map(struct wined3d_bo_gl *bo, struct wined3d_context_
ERR("Failed to create new buffer object.\n"); ERR("Failed to create new buffer object.\n");
} }
if (context_gl->c.d3d_info->fences)
{
if (bo->command_fence_id == device_gl->current_fence_id) if (bo->command_fence_id == device_gl->current_fence_id)
wined3d_context_gl_submit_command_fence(context_gl); wined3d_context_gl_submit_command_fence(context_gl);
wined3d_context_gl_wait_command_fence(context_gl, bo->command_fence_id); wined3d_context_gl_wait_command_fence(context_gl, bo->command_fence_id);
}
map: map:
if (bo->b.map_ptr) if (bo->b.map_ptr)

View File

@ -173,11 +173,6 @@ static struct wined3d_pipeline_statistics_query *wined3d_pipeline_statistics_que
return CONTAINING_RECORD(query, struct wined3d_pipeline_statistics_query, query); return CONTAINING_RECORD(query, struct wined3d_pipeline_statistics_query, query);
} }
static BOOL wined3d_fence_supported(const struct wined3d_gl_info *gl_info)
{
return gl_info->supported[ARB_SYNC] || gl_info->supported[NV_FENCE] || gl_info->supported[APPLE_FENCE];
}
enum wined3d_fence_result wined3d_fence_test(const struct wined3d_fence *fence, enum wined3d_fence_result wined3d_fence_test(const struct wined3d_fence *fence,
struct wined3d_device *device, DWORD flags) struct wined3d_device *device, DWORD flags)
{ {

View File

@ -633,6 +633,7 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
gl_info->gl_ops.wgl.p_wglSwapBuffers(context_gl->dc); gl_info->gl_ops.wgl.p_wglSwapBuffers(context_gl->dc);
} }
if (context->d3d_info->fences)
wined3d_context_gl_submit_command_fence(context_gl); wined3d_context_gl_submit_command_fence(context_gl);
wined3d_swapchain_gl_rotate(swapchain, context); wined3d_swapchain_gl_rotate(swapchain, context);

View File

@ -242,6 +242,7 @@ struct wined3d_d3d_info
uint32_t scaled_resolve : 1; uint32_t scaled_resolve : 1;
uint32_t pbo : 1; uint32_t pbo : 1;
uint32_t subpixel_viewport : 1; uint32_t subpixel_viewport : 1;
uint32_t fences : 1;
enum wined3d_feature_level feature_level; enum wined3d_feature_level feature_level;
DWORD multisample_draw_location; DWORD multisample_draw_location;
@ -3282,6 +3283,11 @@ struct wined3d_gl_info
void (WINE_GLAPI *p_glEnableWINE)(GLenum cap); void (WINE_GLAPI *p_glEnableWINE)(GLenum cap);
}; };
static inline BOOL wined3d_fence_supported(const struct wined3d_gl_info *gl_info)
{
return gl_info->supported[ARB_SYNC] || gl_info->supported[NV_FENCE] || gl_info->supported[APPLE_FENCE];
}
/* The driver names reflect the lowest GPU supported /* The driver names reflect the lowest GPU supported
* by a certain driver, so DRIVER_AMD_R300 supports * by a certain driver, so DRIVER_AMD_R300 supports
* R3xx, R4xx and R5xx GPUs. */ * R3xx, R4xx and R5xx GPUs. */