Commit 6fc027e5 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Only create the ARBfp blitter if creating the GLSL blitter failed.

Since the GLSL blitter can do everything the ARBfp one can. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 0b0c0c9a
......@@ -1042,8 +1042,8 @@ static void wined3d_device_create_primary_opengl_context_cs(void *object)
return;
}
wined3d_ffp_blitter_create(&device->blitter, &device->adapter->gl_info);
wined3d_arbfp_blitter_create(&device->blitter, device);
wined3d_glsl_blitter_create(&device->blitter, device);
if (!wined3d_glsl_blitter_create(&device->blitter, device))
wined3d_arbfp_blitter_create(&device->blitter, device);
wined3d_fbo_blitter_create(&device->blitter, &device->adapter->gl_info);
wined3d_raw_blitter_create(&device->blitter, &device->adapter->gl_info);
......
......@@ -13157,21 +13157,22 @@ static const struct wined3d_blitter_ops glsl_blitter_ops =
glsl_blitter_blit,
};
void wined3d_glsl_blitter_create(struct wined3d_blitter **next, const struct wined3d_device *device)
struct wined3d_blitter *wined3d_glsl_blitter_create(struct wined3d_blitter **next,
const struct wined3d_device *device)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct wined3d_glsl_blitter *blitter;
if (device->shader_backend != &glsl_shader_backend)
return;
return NULL;
if (!gl_info->supported[ARB_VERTEX_SHADER] || !gl_info->supported[ARB_FRAGMENT_SHADER])
return;
return NULL;
if (!(blitter = heap_alloc(sizeof(*blitter))))
{
ERR("Failed to allocate blitter.\n");
return;
return NULL;
}
TRACE("Created blitter %p.\n", blitter);
......@@ -13182,4 +13183,6 @@ void wined3d_glsl_blitter_create(struct wined3d_blitter **next, const struct win
wine_rb_init(&blitter->programs, glsl_blitter_args_compare);
blitter->palette_texture = 0;
*next = &blitter->blitter;
return *next;
}
......@@ -2143,7 +2143,7 @@ void wined3d_fbo_blitter_create(struct wined3d_blitter **next,
const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
void wined3d_ffp_blitter_create(struct wined3d_blitter **next,
const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
void wined3d_glsl_blitter_create(struct wined3d_blitter **next,
struct wined3d_blitter *wined3d_glsl_blitter_create(struct wined3d_blitter **next,
const struct wined3d_device *device) DECLSPEC_HIDDEN;
void wined3d_raw_blitter_create(struct wined3d_blitter **next,
const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
......
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