From 9502b8e843cf3589f7d2786a5d7e21a4f8ecc289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Fri, 29 Mar 2019 13:00:14 +0100 Subject: [PATCH] wined3d: Pass wined3d_adapter to vp_get_caps(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/adapter_gl.c | 2 +- dlls/wined3d/directx.c | 2 +- dlls/wined3d/glsl_shader.c | 4 +++- dlls/wined3d/state.c | 6 ++++-- dlls/wined3d/wined3d_private.h | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 59d035e0ab0..d88236e5d47 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -3722,7 +3722,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, d3d_info->viewport_array_index_any_shader = !!gl_info->supported[ARB_SHADER_VIEWPORT_LAYER_ARRAY]; - adapter->vertex_pipe->vp_get_caps(gl_info, &vertex_caps); + adapter->vertex_pipe->vp_get_caps(adapter, &vertex_caps); d3d_info->xyzrhw = vertex_caps.xyzrhw; d3d_info->ffp_generic_attributes = vertex_caps.ffp_generic_attributes; d3d_info->limits.ffp_vertex_blend_matrices = vertex_caps.max_vertex_blend_matrices; diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index d23691b4cc8..a3a8486200b 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1969,7 +1969,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, unsigned in 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); + adapter->vertex_pipe->vp_get_caps(adapter, &vertex_caps); /* Add shader misc caps. Only some of them belong to the shader parts of the pipeline */ caps->PrimitiveMiscCaps |= fragment_caps.PrimitiveMiscCaps; diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 603ccc617bc..5c0d9ae84ca 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -11677,8 +11677,10 @@ const struct wined3d_shader_backend_ops glsl_shader_backend = static void glsl_vertex_pipe_vp_enable(const struct wined3d_gl_info *gl_info, BOOL enable) {} -static void glsl_vertex_pipe_vp_get_caps(const struct wined3d_gl_info *gl_info, struct wined3d_vertex_caps *caps) +static void glsl_vertex_pipe_vp_get_caps(const struct wined3d_adapter *adapter, struct wined3d_vertex_caps *caps) { + const struct wined3d_gl_info *gl_info = &adapter->gl_info; + caps->xyzrhw = TRUE; caps->emulated_flatshading = !needs_legacy_glsl_syntax(gl_info); caps->ffp_generic_attributes = TRUE; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index fcad10f7a19..98be4cfff90 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -5200,8 +5200,10 @@ static void *ffp_alloc(const struct wined3d_shader_backend_ops *shader_backend, static void ffp_free(struct wined3d_device *device, struct wined3d_context *context) {} -static void vp_ffp_get_caps(const struct wined3d_gl_info *gl_info, struct wined3d_vertex_caps *caps) +static void vp_ffp_get_caps(const struct wined3d_adapter *adapter, struct wined3d_vertex_caps *caps) { + const struct wined3d_gl_info *gl_info = &adapter->gl_info; + caps->xyzrhw = FALSE; caps->ffp_generic_attributes = FALSE; caps->max_active_lights = gl_info->limits.lights; @@ -5318,7 +5320,7 @@ static void *none_alloc(const struct wined3d_shader_backend_ops *shader_backend, static void none_free(struct wined3d_device *device, struct wined3d_context *context) {} -static void vp_none_get_caps(const struct wined3d_gl_info *gl_info, struct wined3d_vertex_caps *caps) +static void vp_none_get_caps(const struct wined3d_adapter *adapter, struct wined3d_vertex_caps *caps) { memset(caps, 0, sizeof(*caps)); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 1b89affd030..253b3950ea7 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2087,7 +2087,7 @@ struct wined3d_vertex_caps struct wined3d_vertex_pipe_ops { void (*vp_enable)(const struct wined3d_gl_info *gl_info, BOOL enable); - void (*vp_get_caps)(const struct wined3d_gl_info *gl_info, struct wined3d_vertex_caps *caps); + void (*vp_get_caps)(const struct wined3d_adapter *adapter, struct wined3d_vertex_caps *caps); DWORD (*vp_get_emul_mask)(const struct wined3d_gl_info *gl_info); void *(*vp_alloc)(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv); void (*vp_free)(struct wined3d_device *device, struct wined3d_context *context);