Commit 4aac4bbe authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

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

parent aebee707
......@@ -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->pbo = !!gl_info->supported[ARB_PIXEL_BUFFER_OBJECT];
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->filling_convention_offset = gl_info->filling_convention_offset;
......
......@@ -2350,6 +2350,7 @@ static void wined3d_adapter_vk_init_d3d_info(struct wined3d_adapter_vk *adapter_
d3d_info->pbo = true;
d3d_info->feature_level = feature_level_from_caps(&shader_caps);
d3d_info->subpixel_viewport = true;
d3d_info->fences = 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.
......
......@@ -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");
}
if (bo->command_fence_id == device_gl->current_fence_id)
wined3d_context_gl_submit_command_fence(context_gl);
wined3d_context_gl_wait_command_fence(context_gl, bo->command_fence_id);
if (context_gl->c.d3d_info->fences)
{
if (bo->command_fence_id == device_gl->current_fence_id)
wined3d_context_gl_submit_command_fence(context_gl);
wined3d_context_gl_wait_command_fence(context_gl, bo->command_fence_id);
}
map:
if (bo->b.map_ptr)
......
......@@ -173,11 +173,6 @@ static struct wined3d_pipeline_statistics_query *wined3d_pipeline_statistics_que
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,
struct wined3d_device *device, DWORD flags)
{
......
......@@ -633,7 +633,8 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
gl_info->gl_ops.wgl.p_wglSwapBuffers(context_gl->dc);
}
wined3d_context_gl_submit_command_fence(context_gl);
if (context->d3d_info->fences)
wined3d_context_gl_submit_command_fence(context_gl);
wined3d_swapchain_gl_rotate(swapchain, context);
......
......@@ -242,6 +242,7 @@ struct wined3d_d3d_info
uint32_t scaled_resolve : 1;
uint32_t pbo : 1;
uint32_t subpixel_viewport : 1;
uint32_t fences : 1;
enum wined3d_feature_level feature_level;
DWORD multisample_draw_location;
......@@ -3282,6 +3283,11 @@ struct wined3d_gl_info
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
* by a certain driver, so DRIVER_AMD_R300 supports
* R3xx, R4xx and R5xx GPUs. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment