Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/wined3d/adapter_gl.c | 2 +- dlls/wined3d/arb_program_shader.c | 6 ++++-- dlls/wined3d/ati_fragment_shader.c | 2 +- dlls/wined3d/directx.c | 2 +- dlls/wined3d/glsl_shader.c | 7 ++++--- dlls/wined3d/nvidia_texture_shader.c | 4 +++- dlls/wined3d/shader.c | 2 +- dlls/wined3d/state.c | 6 ++++-- dlls/wined3d/utils.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 10 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index d88236e5d47b..873971ed25b5 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -3729,7 +3729,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, d3d_info->limits.active_light_count = vertex_caps.max_active_lights; d3d_info->emulated_flatshading = vertex_caps.emulated_flatshading;
- adapter->fragment_pipe->get_caps(gl_info, &fragment_caps); + adapter->fragment_pipe->get_caps(adapter, &fragment_caps); d3d_info->limits.ffp_blend_stages = fragment_caps.MaxTextureBlendStages; d3d_info->limits.ffp_textures = fragment_caps.MaxSimultaneousTextures; d3d_info->shader_color_key = !!(fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_COLOR_KEY); diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 97117dbf7ade..a05bb2f38c9b 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4812,7 +4812,7 @@ static HRESULT shader_arb_alloc(struct wined3d_device *device, const struct wine
priv->vertex_pipe = vertex_pipe; priv->fragment_pipe = fragment_pipe; - fragment_pipe->get_caps(&device->adapter->gl_info, &fragment_caps); + fragment_pipe->get_caps(device->adapter, &fragment_caps); priv->ffp_proj_control = fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_PROJ_CONTROL;
device->vertex_priv = vertex_priv; @@ -5736,8 +5736,10 @@ static void arbfp_free(struct wined3d_device *device, struct wined3d_context *co heap_free(device->fragment_priv); }
-static void arbfp_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps) +static void arbfp_get_caps(const struct wined3d_adapter *adapter, struct fragment_caps *caps) { + const struct wined3d_gl_info *gl_info = &adapter->gl_info; + caps->wined3d_caps = WINED3D_FRAGMENT_CAP_PROJ_CONTROL | WINED3D_FRAGMENT_CAP_SRGB_WRITE | WINED3D_FRAGMENT_CAP_COLOR_KEY; diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index 283732299d10..959f4f80e1df 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -1263,7 +1263,7 @@ static void atifs_enable(const struct wined3d_gl_info *gl_info, BOOL enable) } }
-static void atifs_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps) +static void atifs_get_caps(const struct wined3d_adapter *adapter, struct fragment_caps *caps) { caps->wined3d_caps = WINED3D_FRAGMENT_CAP_PROJ_CONTROL; caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP | diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index a3a8486200bc..0676dcad9e38 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1968,7 +1968,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, unsigned in caps->VertexTextureFilterCaps = 0;
adapter->shader_backend->shader_get_caps(adapter, &shader_caps); - adapter->fragment_pipe->get_caps(gl_info, &fragment_caps); + adapter->fragment_pipe->get_caps(adapter, &fragment_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 */ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index c5182c39cb8f..c1c32304b680 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -11188,7 +11188,6 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win const struct fragment_pipeline *fragment_pipe) { SIZE_T stack_size = wined3d_log2i(max(WINED3D_MAX_VS_CONSTS_F, WINED3D_MAX_PS_CONSTS_F)) + 1; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; struct fragment_caps fragment_caps; void *vertex_priv, *fragment_priv; struct shader_glsl_priv *priv; @@ -11242,7 +11241,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win priv->next_constant_version = 1; priv->vertex_pipe = vertex_pipe; priv->fragment_pipe = fragment_pipe; - fragment_pipe->get_caps(gl_info, &fragment_caps); + fragment_pipe->get_caps(device->adapter, &fragment_caps); priv->ffp_proj_control = fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_PROJ_CONTROL; priv->legacy_lighting = device->wined3d->flags & WINED3D_LEGACY_FFP_LIGHTING;
@@ -12170,8 +12169,10 @@ static void glsl_fragment_pipe_enable(const struct wined3d_gl_info *gl_info, BOO /* Nothing to do. */ }
-static void glsl_fragment_pipe_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps) +static void glsl_fragment_pipe_get_caps(const struct wined3d_adapter *adapter, struct fragment_caps *caps) { + const struct wined3d_gl_info *gl_info = &adapter->gl_info; + caps->wined3d_caps = WINED3D_FRAGMENT_CAP_PROJ_CONTROL | WINED3D_FRAGMENT_CAP_SRGB_WRITE | WINED3D_FRAGMENT_CAP_COLOR_KEY; diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c index f5dbb254fb9f..fd8022433cce 100644 --- a/dlls/wined3d/nvidia_texture_shader.c +++ b/dlls/wined3d/nvidia_texture_shader.c @@ -687,8 +687,10 @@ static void nvts_enable(const struct wined3d_gl_info *gl_info, BOOL enable) } }
-static void nvrc_fragment_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps) +static void nvrc_fragment_get_caps(const struct wined3d_adapter *adapter, struct fragment_caps *caps) { + const struct wined3d_gl_info *gl_info = &adapter->gl_info; + caps->wined3d_caps = 0; caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP;
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 060b3fd1c432..8fae8e22131e 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -3236,7 +3236,7 @@ static HRESULT shader_none_alloc(struct wined3d_device *device, const struct win
priv->vertex_pipe = vertex_pipe; priv->fragment_pipe = fragment_pipe; - fragment_pipe->get_caps(&device->adapter->gl_info, &fragment_caps); + fragment_pipe->get_caps(device->adapter, &fragment_caps); priv->ffp_proj_control = fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_PROJ_CONTROL;
device->vertex_priv = vertex_priv; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 98be4cfff908..d995fe89b0aa 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -5238,8 +5238,10 @@ const struct wined3d_vertex_pipe_ops ffp_vertex_pipe = vp_ffp_states, };
-static void ffp_fragment_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps) +static void ffp_fragment_get_caps(const struct wined3d_adapter *adapter, struct fragment_caps *caps) { + const struct wined3d_gl_info *gl_info = &adapter->gl_info; + caps->wined3d_caps = 0; caps->PrimitiveMiscCaps = 0; caps->TextureOpCaps = WINED3DTEXOPCAPS_ADD @@ -5340,7 +5342,7 @@ const struct wined3d_vertex_pipe_ops none_vertex_pipe = NULL, };
-static void fp_none_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps) +static void fp_none_get_caps(const struct wined3d_adapter *adapter, struct fragment_caps *caps) { memset(caps, 0, sizeof(*caps)); } diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index ea59d4f5e6fc..a2422839e046 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -3138,7 +3138,7 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win unsigned int i, j; BOOL srgb_write;
- adapter->fragment_pipe->get_caps(gl_info, &fragment_caps); + adapter->fragment_pipe->get_caps(adapter, &fragment_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 253b3950ea7c..f5bf96f62583 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2060,7 +2060,7 @@ struct fragment_caps struct fragment_pipeline { void (*enable_extension)(const struct wined3d_gl_info *gl_info, BOOL enable); - void (*get_caps)(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps); + void (*get_caps)(const struct wined3d_adapter *adapter, struct fragment_caps *caps); DWORD (*get_emul_mask)(const struct wined3d_gl_info *gl_info); void *(*alloc_private)(const struct wined3d_shader_backend_ops *shader_backend, void *shader_priv); void (*free_private)(struct wined3d_device *device, struct wined3d_context *context);