Commit 084e6e21 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Retrieve the FFP projection control flag from the d3d info in get_texture_matrix().

parent 9a45a637
...@@ -286,7 +286,6 @@ struct shader_arb_priv ...@@ -286,7 +286,6 @@ struct shader_arb_priv
const struct wined3d_vertex_pipe_ops *vertex_pipe; const struct wined3d_vertex_pipe_ops *vertex_pipe;
const struct wined3d_fragment_pipe_ops *fragment_pipe; const struct wined3d_fragment_pipe_ops *fragment_pipe;
BOOL ffp_proj_control;
}; };
/* Context activation for state handlers is done by the caller. */ /* Context activation for state handlers is done by the caller. */
...@@ -4843,7 +4842,6 @@ static HRESULT shader_arb_alloc(struct wined3d_device *device, const struct wine ...@@ -4843,7 +4842,6 @@ static HRESULT shader_arb_alloc(struct wined3d_device *device, const struct wine
const struct wined3d_fragment_pipe_ops *fragment_pipe) const struct wined3d_fragment_pipe_ops *fragment_pipe)
{ {
const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
struct fragment_caps fragment_caps;
void *vertex_priv, *fragment_priv; void *vertex_priv, *fragment_priv;
struct shader_arb_priv *priv; struct shader_arb_priv *priv;
...@@ -4874,8 +4872,6 @@ static HRESULT shader_arb_alloc(struct wined3d_device *device, const struct wine ...@@ -4874,8 +4872,6 @@ static HRESULT shader_arb_alloc(struct wined3d_device *device, const struct wine
priv->vertex_pipe = vertex_pipe; priv->vertex_pipe = vertex_pipe;
priv->fragment_pipe = fragment_pipe; priv->fragment_pipe = fragment_pipe;
fragment_pipe->get_caps(device->adapter, &fragment_caps);
priv->ffp_proj_control = fragment_caps.proj_control;
device->vertex_priv = vertex_priv; device->vertex_priv = vertex_priv;
device->fragment_priv = fragment_priv; device->fragment_priv = fragment_priv;
...@@ -5695,13 +5691,6 @@ static void shader_arb_handle_instruction(const struct wined3d_shader_instructio ...@@ -5695,13 +5691,6 @@ static void shader_arb_handle_instruction(const struct wined3d_shader_instructio
shader_arb_add_instruction_modifiers(ins); shader_arb_add_instruction_modifiers(ins);
} }
static BOOL shader_arb_has_ffp_proj_control(void *shader_priv)
{
struct shader_arb_priv *priv = shader_priv;
return priv->ffp_proj_control;
}
static void shader_arb_precompile(void *shader_priv, struct wined3d_shader *shader) {} static void shader_arb_precompile(void *shader_priv, struct wined3d_shader *shader) {}
static uint64_t shader_arb_shader_compile(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc, static uint64_t shader_arb_shader_compile(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc,
...@@ -5729,7 +5718,6 @@ const struct wined3d_shader_backend_ops arb_program_shader_backend = ...@@ -5729,7 +5718,6 @@ const struct wined3d_shader_backend_ops arb_program_shader_backend =
shader_arb_init_context_state, shader_arb_init_context_state,
shader_arb_get_caps, shader_arb_get_caps,
shader_arb_color_fixup_supported, shader_arb_color_fixup_supported,
shader_arb_has_ffp_proj_control,
shader_arb_shader_compile, shader_arb_shader_compile,
}; };
......
...@@ -137,7 +137,6 @@ struct shader_glsl_priv ...@@ -137,7 +137,6 @@ struct shader_glsl_priv
const struct wined3d_fragment_pipe_ops *fragment_pipe; const struct wined3d_fragment_pipe_ops *fragment_pipe;
struct wine_rb_tree ffp_vertex_shaders; struct wine_rb_tree ffp_vertex_shaders;
struct wine_rb_tree ffp_fragment_shaders; struct wine_rb_tree ffp_fragment_shaders;
BOOL ffp_proj_control;
BOOL legacy_lighting; BOOL legacy_lighting;
}; };
...@@ -11060,7 +11059,6 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win ...@@ -11060,7 +11059,6 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
const struct wined3d_fragment_pipe_ops *fragment_pipe) const struct wined3d_fragment_pipe_ops *fragment_pipe)
{ {
SIZE_T stack_size = wined3d_log2i(max(WINED3D_MAX_VS_CONSTS_F, WINED3D_MAX_PS_CONSTS_F)) + 1; SIZE_T stack_size = wined3d_log2i(max(WINED3D_MAX_VS_CONSTS_F, WINED3D_MAX_PS_CONSTS_F)) + 1;
struct fragment_caps fragment_caps;
void *vertex_priv, *fragment_priv; void *vertex_priv, *fragment_priv;
struct shader_glsl_priv *priv; struct shader_glsl_priv *priv;
...@@ -11113,8 +11111,6 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win ...@@ -11113,8 +11111,6 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
priv->next_constant_version = 1; priv->next_constant_version = 1;
priv->vertex_pipe = vertex_pipe; priv->vertex_pipe = vertex_pipe;
priv->fragment_pipe = fragment_pipe; priv->fragment_pipe = fragment_pipe;
fragment_pipe->get_caps(device->adapter, &fragment_caps);
priv->ffp_proj_control = fragment_caps.proj_control;
priv->legacy_lighting = device->wined3d->flags & WINED3D_LEGACY_FFP_LIGHTING; priv->legacy_lighting = device->wined3d->flags & WINED3D_LEGACY_FFP_LIGHTING;
device->vertex_priv = vertex_priv; device->vertex_priv = vertex_priv;
...@@ -11524,13 +11520,6 @@ static void shader_glsl_handle_instruction(const struct wined3d_shader_instructi ...@@ -11524,13 +11520,6 @@ static void shader_glsl_handle_instruction(const struct wined3d_shader_instructi
shader_glsl_add_instruction_modifiers(ins); shader_glsl_add_instruction_modifiers(ins);
} }
static BOOL shader_glsl_has_ffp_proj_control(void *shader_priv)
{
struct shader_glsl_priv *priv = shader_priv;
return priv->ffp_proj_control;
}
static uint64_t shader_glsl_shader_compile(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc, static uint64_t shader_glsl_shader_compile(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc,
enum wined3d_shader_type shader_type) enum wined3d_shader_type shader_type)
{ {
...@@ -11556,7 +11545,6 @@ const struct wined3d_shader_backend_ops glsl_shader_backend = ...@@ -11556,7 +11545,6 @@ const struct wined3d_shader_backend_ops glsl_shader_backend =
shader_glsl_init_context_state, shader_glsl_init_context_state,
shader_glsl_get_caps, shader_glsl_get_caps,
shader_glsl_color_fixup_supported, shader_glsl_color_fixup_supported,
shader_glsl_has_ffp_proj_control,
shader_glsl_shader_compile, shader_glsl_shader_compile,
}; };
......
...@@ -1922,7 +1922,6 @@ struct shader_none_priv ...@@ -1922,7 +1922,6 @@ struct shader_none_priv
{ {
const struct wined3d_vertex_pipe_ops *vertex_pipe; const struct wined3d_vertex_pipe_ops *vertex_pipe;
const struct wined3d_fragment_pipe_ops *fragment_pipe; const struct wined3d_fragment_pipe_ops *fragment_pipe;
BOOL ffp_proj_control;
}; };
static void shader_none_handle_instruction(const struct wined3d_shader_instruction *ins) {} static void shader_none_handle_instruction(const struct wined3d_shader_instruction *ins) {}
...@@ -1966,7 +1965,6 @@ static void shader_none_disable(void *shader_priv, struct wined3d_context *conte ...@@ -1966,7 +1965,6 @@ static void shader_none_disable(void *shader_priv, struct wined3d_context *conte
static HRESULT shader_none_alloc(struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe, static HRESULT shader_none_alloc(struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe,
const struct wined3d_fragment_pipe_ops *fragment_pipe) const struct wined3d_fragment_pipe_ops *fragment_pipe)
{ {
struct fragment_caps fragment_caps;
void *vertex_priv, *fragment_priv; void *vertex_priv, *fragment_priv;
struct shader_none_priv *priv; struct shader_none_priv *priv;
...@@ -1990,8 +1988,6 @@ static HRESULT shader_none_alloc(struct wined3d_device *device, const struct win ...@@ -1990,8 +1988,6 @@ static HRESULT shader_none_alloc(struct wined3d_device *device, const struct win
priv->vertex_pipe = vertex_pipe; priv->vertex_pipe = vertex_pipe;
priv->fragment_pipe = fragment_pipe; priv->fragment_pipe = fragment_pipe;
fragment_pipe->get_caps(device->adapter, &fragment_caps);
priv->ffp_proj_control = fragment_caps.proj_control;
device->vertex_priv = vertex_priv; device->vertex_priv = vertex_priv;
device->fragment_priv = fragment_priv; device->fragment_priv = fragment_priv;
...@@ -2027,13 +2023,6 @@ static BOOL shader_none_color_fixup_supported(struct color_fixup_desc fixup) ...@@ -2027,13 +2023,6 @@ static BOOL shader_none_color_fixup_supported(struct color_fixup_desc fixup)
return TRUE; return TRUE;
} }
static BOOL shader_none_has_ffp_proj_control(void *shader_priv)
{
struct shader_none_priv *priv = shader_priv;
return priv->ffp_proj_control;
}
static uint64_t shader_none_shader_compile(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc, static uint64_t shader_none_shader_compile(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc,
enum wined3d_shader_type shader_type) enum wined3d_shader_type shader_type)
{ {
...@@ -2058,7 +2047,6 @@ const struct wined3d_shader_backend_ops none_shader_backend = ...@@ -2058,7 +2047,6 @@ const struct wined3d_shader_backend_ops none_shader_backend =
shader_none_init_context_state, shader_none_init_context_state,
shader_none_get_caps, shader_none_get_caps,
shader_none_color_fixup_supported, shader_none_color_fixup_supported,
shader_none_has_ffp_proj_control,
shader_none_shader_compile, shader_none_shader_compile,
}; };
......
...@@ -49,7 +49,6 @@ struct shader_spirv_priv ...@@ -49,7 +49,6 @@ struct shader_spirv_priv
{ {
const struct wined3d_vertex_pipe_ops *vertex_pipe; const struct wined3d_vertex_pipe_ops *vertex_pipe;
const struct wined3d_fragment_pipe_ops *fragment_pipe; const struct wined3d_fragment_pipe_ops *fragment_pipe;
bool ffp_proj_control;
struct shader_spirv_resource_bindings bindings; struct shader_spirv_resource_bindings bindings;
}; };
...@@ -968,7 +967,6 @@ static void shader_spirv_destroy(struct wined3d_shader *shader) ...@@ -968,7 +967,6 @@ static void shader_spirv_destroy(struct wined3d_shader *shader)
static HRESULT shader_spirv_alloc(struct wined3d_device *device, static HRESULT shader_spirv_alloc(struct wined3d_device *device,
const struct wined3d_vertex_pipe_ops *vertex_pipe, const struct wined3d_fragment_pipe_ops *fragment_pipe) const struct wined3d_vertex_pipe_ops *vertex_pipe, const struct wined3d_fragment_pipe_ops *fragment_pipe)
{ {
struct fragment_caps fragment_caps;
void *vertex_priv, *fragment_priv; void *vertex_priv, *fragment_priv;
struct shader_spirv_priv *priv; struct shader_spirv_priv *priv;
...@@ -992,8 +990,6 @@ static HRESULT shader_spirv_alloc(struct wined3d_device *device, ...@@ -992,8 +990,6 @@ static HRESULT shader_spirv_alloc(struct wined3d_device *device,
priv->vertex_pipe = vertex_pipe; priv->vertex_pipe = vertex_pipe;
priv->fragment_pipe = fragment_pipe; priv->fragment_pipe = fragment_pipe;
fragment_pipe->get_caps(device->adapter, &fragment_caps);
priv->ffp_proj_control = fragment_caps.proj_control;
memset(&priv->bindings, 0, sizeof(priv->bindings)); memset(&priv->bindings, 0, sizeof(priv->bindings));
device->vertex_priv = vertex_priv; device->vertex_priv = vertex_priv;
...@@ -1049,13 +1045,6 @@ static BOOL shader_spirv_color_fixup_supported(struct color_fixup_desc fixup) ...@@ -1049,13 +1045,6 @@ static BOOL shader_spirv_color_fixup_supported(struct color_fixup_desc fixup)
return is_identity_fixup(fixup); return is_identity_fixup(fixup);
} }
static BOOL shader_spirv_has_ffp_proj_control(void *shader_priv)
{
struct shader_spirv_priv *priv = shader_priv;
return priv->ffp_proj_control;
}
static uint64_t shader_spirv_compile(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc, static uint64_t shader_spirv_compile(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc,
enum wined3d_shader_type shader_type) enum wined3d_shader_type shader_type)
{ {
...@@ -1081,7 +1070,6 @@ static const struct wined3d_shader_backend_ops spirv_shader_backend_vk = ...@@ -1081,7 +1070,6 @@ static const struct wined3d_shader_backend_ops spirv_shader_backend_vk =
.shader_init_context_state = shader_spirv_init_context_state, .shader_init_context_state = shader_spirv_init_context_state,
.shader_get_caps = shader_spirv_get_caps, .shader_get_caps = shader_spirv_get_caps,
.shader_color_fixup_supported = shader_spirv_color_fixup_supported, .shader_color_fixup_supported = shader_spirv_color_fixup_supported,
.shader_has_ffp_proj_control = shader_spirv_has_ffp_proj_control,
.shader_compile = shader_spirv_compile, .shader_compile = shader_spirv_compile,
}; };
......
...@@ -5850,7 +5850,6 @@ static void compute_texture_matrix(const struct wined3d_matrix *matrix, uint32_t ...@@ -5850,7 +5850,6 @@ static void compute_texture_matrix(const struct wined3d_matrix *matrix, uint32_t
void get_texture_matrix(const struct wined3d_context *context, const struct wined3d_state *state, void get_texture_matrix(const struct wined3d_context *context, const struct wined3d_state *state,
const unsigned int tex, struct wined3d_matrix *mat) const unsigned int tex, struct wined3d_matrix *mat)
{ {
const struct wined3d_device *device = context->device;
BOOL generated = (state->texture_states[tex][WINED3D_TSS_TEXCOORD_INDEX] & 0xffff0000) BOOL generated = (state->texture_states[tex][WINED3D_TSS_TEXCOORD_INDEX] & 0xffff0000)
!= WINED3DTSS_TCI_PASSTHRU; != WINED3DTSS_TCI_PASSTHRU;
unsigned int coord_idx = min(state->texture_states[tex][WINED3D_TSS_TEXCOORD_INDEX & 0x0000ffff], unsigned int coord_idx = min(state->texture_states[tex][WINED3D_TSS_TEXCOORD_INDEX & 0x0000ffff],
...@@ -5863,7 +5862,7 @@ void get_texture_matrix(const struct wined3d_context *context, const struct wine ...@@ -5863,7 +5862,7 @@ void get_texture_matrix(const struct wined3d_context *context, const struct wine
context->stream_info.use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)) context->stream_info.use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx))
? context->stream_info.elements[WINED3D_FFP_TEXCOORD0 + coord_idx].format->id ? context->stream_info.elements[WINED3D_FFP_TEXCOORD0 + coord_idx].format->id
: WINED3DFMT_UNKNOWN, : WINED3DFMT_UNKNOWN,
device->shader_backend->shader_has_ffp_proj_control(device->shader_priv), mat); context->d3d_info->ffp_fragment_caps.proj_control, mat);
if (texture && !(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT)) if (texture && !(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT))
{ {
......
...@@ -1557,7 +1557,6 @@ struct wined3d_shader_backend_ops ...@@ -1557,7 +1557,6 @@ struct wined3d_shader_backend_ops
void (*shader_init_context_state)(struct wined3d_context *context); void (*shader_init_context_state)(struct wined3d_context *context);
void (*shader_get_caps)(const struct wined3d_adapter *adapter, 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_color_fixup_supported)(struct color_fixup_desc fixup);
BOOL (*shader_has_ffp_proj_control)(void *shader_priv);
uint64_t (*shader_compile)(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc, uint64_t (*shader_compile)(struct wined3d_context *context, const struct wined3d_shader_desc *shader_desc,
enum wined3d_shader_type shader_type); enum wined3d_shader_type shader_type);
}; };
......
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