Suggested by Henri Verbeet.
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
dlls/wined3d/adapter_gl.c | 2 +-
dlls/wined3d/arb_program_shader.c | 4 +++-
dlls/wined3d/directx.c | 2 +-
dlls/wined3d/glsl_shader.c | 3 ++-
dlls/wined3d/shader.c | 14 ++------------
dlls/wined3d/utils.c | 2 +-
dlls/wined3d/wined3d_private.h | 2 +-
7 files changed, 11 insertions(+), 18 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index 8cf90d59084e..59d035e0ab07 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -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;
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 92c6e4757278..97117dbf7ade 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -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;
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 13014d1272a0..d23691b4cc8e 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -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);
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 5844b0c0b163..9ec570b900c4 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -11336,8 +11336,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);
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 379ca63d2cc6..060b3fd1c432 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -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)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 872b0f7d2d07..ea59d4f5e6fc 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -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);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 88885fe88c4d..1b89affd030d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -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);
};
--
2.19.2