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: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-05-21 22:44:45 +04:30 committed by Alexandre Julliard
parent 0b0c0c9a19
commit 6fc027e5ac
3 changed files with 10 additions and 7 deletions

View File

@ -1042,8 +1042,8 @@ static void wined3d_device_create_primary_opengl_context_cs(void *object)
return; return;
} }
wined3d_ffp_blitter_create(&device->blitter, &device->adapter->gl_info); wined3d_ffp_blitter_create(&device->blitter, &device->adapter->gl_info);
if (!wined3d_glsl_blitter_create(&device->blitter, device))
wined3d_arbfp_blitter_create(&device->blitter, device); wined3d_arbfp_blitter_create(&device->blitter, device);
wined3d_glsl_blitter_create(&device->blitter, device);
wined3d_fbo_blitter_create(&device->blitter, &device->adapter->gl_info); wined3d_fbo_blitter_create(&device->blitter, &device->adapter->gl_info);
wined3d_raw_blitter_create(&device->blitter, &device->adapter->gl_info); wined3d_raw_blitter_create(&device->blitter, &device->adapter->gl_info);

View File

@ -13157,21 +13157,22 @@ static const struct wined3d_blitter_ops glsl_blitter_ops =
glsl_blitter_blit, 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; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct wined3d_glsl_blitter *blitter; struct wined3d_glsl_blitter *blitter;
if (device->shader_backend != &glsl_shader_backend) if (device->shader_backend != &glsl_shader_backend)
return; return NULL;
if (!gl_info->supported[ARB_VERTEX_SHADER] || !gl_info->supported[ARB_FRAGMENT_SHADER]) if (!gl_info->supported[ARB_VERTEX_SHADER] || !gl_info->supported[ARB_FRAGMENT_SHADER])
return; return NULL;
if (!(blitter = heap_alloc(sizeof(*blitter)))) if (!(blitter = heap_alloc(sizeof(*blitter))))
{ {
ERR("Failed to allocate blitter.\n"); ERR("Failed to allocate blitter.\n");
return; return NULL;
} }
TRACE("Created blitter %p.\n", blitter); 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); wine_rb_init(&blitter->programs, glsl_blitter_args_compare);
blitter->palette_texture = 0; blitter->palette_texture = 0;
*next = &blitter->blitter; *next = &blitter->blitter;
return *next;
} }

View File

@ -2143,7 +2143,7 @@ void wined3d_fbo_blitter_create(struct wined3d_blitter **next,
const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
void wined3d_ffp_blitter_create(struct wined3d_blitter **next, void wined3d_ffp_blitter_create(struct wined3d_blitter **next,
const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; 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; const struct wined3d_device *device) DECLSPEC_HIDDEN;
void wined3d_raw_blitter_create(struct wined3d_blitter **next, void wined3d_raw_blitter_create(struct wined3d_blitter **next,
const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;