Commit 20a94e69 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Pass wined3d_adapter to shader_get_caps().

Suggested by Henri Verbeet. Signed-off-by: 's avatarJózef Kucia <jkucia@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d18f051a
......@@ -3707,7 +3707,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter,
d3d_info->limits.max_rt_count = gl_info->limits.buffers;
d3d_info->limits.max_clip_distances = gl_info->limits.user_clip_distances;
adapter->shader_backend->shader_get_caps(gl_info, &shader_caps);
adapter->shader_backend->shader_get_caps(adapter, &shader_caps);
d3d_info->vs_clipping = shader_caps.wined3d_caps & WINED3D_SHADER_CAP_VS_CLIPPING;
d3d_info->limits.vs_version = shader_caps.vs_version;
d3d_info->limits.hs_version = shader_caps.hs_version;
......
......@@ -4862,8 +4862,10 @@ static void shader_arb_free_context_data(struct wined3d_context *context)
static void shader_arb_init_context_state(struct wined3d_context *context) {}
static void shader_arb_get_caps(const struct wined3d_gl_info *gl_info, struct shader_caps *caps)
static void shader_arb_get_caps(const struct wined3d_adapter *adapter, struct shader_caps *caps)
{
const struct wined3d_gl_info *gl_info = &adapter->gl_info;
if (gl_info->supported[ARB_VERTEX_PROGRAM])
{
DWORD vs_consts;
......
......@@ -1967,7 +1967,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, unsigned in
WINED3DPTFILTERCAPS_MAGFLINEAR;
caps->VertexTextureFilterCaps = 0;
adapter->shader_backend->shader_get_caps(gl_info, &shader_caps);
adapter->shader_backend->shader_get_caps(adapter, &shader_caps);
adapter->fragment_pipe->get_caps(gl_info, &fragment_caps);
adapter->vertex_pipe->vp_get_caps(gl_info, &vertex_caps);
......
......@@ -11337,8 +11337,9 @@ static unsigned int shader_glsl_get_shader_model(const struct wined3d_gl_info *g
return 2;
}
static void shader_glsl_get_caps(const struct wined3d_gl_info *gl_info, struct shader_caps *caps)
static void shader_glsl_get_caps(const struct wined3d_adapter *adapter, struct shader_caps *caps)
{
const struct wined3d_gl_info *gl_info = &adapter->gl_info;
unsigned int shader_model = shader_glsl_get_shader_model(gl_info);
TRACE("Shader model %u.\n", shader_model);
......
......@@ -3260,20 +3260,10 @@ static BOOL shader_none_allocate_context_data(struct wined3d_context *context)
return TRUE;
}
static void shader_none_get_caps(const struct wined3d_gl_info *gl_info, struct shader_caps *caps)
static void shader_none_get_caps(const struct wined3d_adapter *adapter, struct shader_caps *caps)
{
/* Set the shader caps to 0 for the none shader backend */
caps->vs_version = 0;
caps->hs_version = 0;
caps->ds_version = 0;
caps->gs_version = 0;
caps->ps_version = 0;
caps->cs_version = 0;
caps->vs_uniform_count = 0;
caps->ps_uniform_count = 0;
caps->ps_1x_max_value = 0.0f;
caps->varying_count = 0;
caps->wined3d_caps = 0;
memset(caps, 0, sizeof(*caps));
}
static BOOL shader_none_color_fixup_supported(struct color_fixup_desc fixup)
......
......@@ -3139,7 +3139,7 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win
BOOL srgb_write;
adapter->fragment_pipe->get_caps(gl_info, &fragment_caps);
adapter->shader_backend->shader_get_caps(gl_info, &shader_caps);
adapter->shader_backend->shader_get_caps(adapter, &shader_caps);
srgb_write = (fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_SRGB_WRITE)
&& (shader_caps.wined3d_caps & WINED3D_SHADER_CAP_SRGB_WRITE);
......
......@@ -1435,7 +1435,7 @@ struct wined3d_shader_backend_ops
BOOL (*shader_allocate_context_data)(struct wined3d_context *context);
void (*shader_free_context_data)(struct wined3d_context *context);
void (*shader_init_context_state)(struct wined3d_context *context);
void (*shader_get_caps)(const struct wined3d_gl_info *gl_info, struct shader_caps *caps);
void (*shader_get_caps)(const struct wined3d_adapter *adapter, struct shader_caps *caps);
BOOL (*shader_color_fixup_supported)(struct color_fixup_desc fixup);
BOOL (*shader_has_ffp_proj_control)(void *shader_priv);
};
......
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