Commit 89fbb64f authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Pass wined3d_adapter to fragment_pipe->get_caps().

parent 9502b8e8
......@@ -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);
......
......@@ -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;
......
......@@ -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 |
......
......@@ -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 */
......
......@@ -11189,7 +11189,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;
......@@ -11243,7 +11242,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;
......@@ -12171,8 +12170,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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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));
}
......
......@@ -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);
......
......@@ -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);
......
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