From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/glsl_shader.c | 1 - dlls/wined3d/shader_spirv.c | 3 +-- dlls/wined3d/utils.c | 19 +++++-------------- dlls/wined3d/wined3d_private.h | 1 - 4 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 13ba1d65d13..ba61fe5a3cd 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -11368,7 +11368,6 @@ static void shader_glsl_get_caps(const struct wined3d_adapter *adapter, struct s /* Ideally we'd only set caps like sRGB writes here if supported by both * the shader backend and the fragment pipe, but we can get called before * shader_glsl_alloc(). */ - caps->wined3d_caps = WINED3D_SHADER_CAP_SRGB_WRITE; if (needs_interpolation_qualifiers_for_shader_outputs(gl_info)) caps->wined3d_caps |= WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION; if (shader_glsl_full_ffp_varyings(gl_info)) diff --git a/dlls/wined3d/shader_spirv.c b/dlls/wined3d/shader_spirv.c index 37fc1cb22d1..110fdfeff39 100644 --- a/dlls/wined3d/shader_spirv.c +++ b/dlls/wined3d/shader_spirv.c @@ -1076,8 +1076,7 @@ static void shader_spirv_get_caps(const struct wined3d_adapter *adapter, struct caps->ps_uniform_count = WINED3D_MAX_PS_CONSTS_F; caps->ps_1x_max_value = FLT_MAX; caps->varying_count = 0; - caps->wined3d_caps = WINED3D_SHADER_CAP_SRGB_WRITE - | WINED3D_SHADER_CAP_FULL_FFP_VARYINGS; + caps->wined3d_caps = WINED3D_SHADER_CAP_FULL_FFP_VARYINGS; }
static BOOL shader_spirv_color_fixup_supported(struct color_fixup_desc fixup) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index ef95c40135a..e4ff36425ab 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -3059,7 +3059,7 @@ static void query_view_class(struct wined3d_format_gl *format)
static void query_internal_format(struct wined3d_adapter *adapter, struct wined3d_format_gl *format, const struct wined3d_format_texture_info *texture_info, - struct wined3d_gl_info *gl_info, BOOL srgb_write_supported, BOOL srgb_format) + struct wined3d_gl_info *gl_info, BOOL srgb_format) { GLint count, multisample_types[8]; unsigned int i, max_log2; @@ -3078,12 +3078,8 @@ static void query_internal_format(struct wined3d_adapter *adapter, { query_format_cap(gl_info, format, format->srgb_internal, GL_SRGB_READ, WINED3D_FORMAT_CAP_SRGB_READ, "sRGB read"); - - if (srgb_write_supported) - query_format_cap(gl_info, format, format->srgb_internal, GL_SRGB_WRITE, - WINED3D_FORMAT_CAP_SRGB_WRITE, "sRGB write"); - else - format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_WRITE); + query_format_cap(gl_info, format, format->srgb_internal, GL_SRGB_WRITE, + WINED3D_FORMAT_CAP_SRGB_WRITE, "sRGB write");
if (!(format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] & (WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE))) @@ -3115,9 +3111,6 @@ static void query_internal_format(struct wined3d_adapter *adapter, format->internal = format->srgb_internal; } } - - if ((format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_SRGB_WRITE) && !srgb_write_supported) - format_clear_caps(&format->f, WINED3D_FORMAT_CAP_SRGB_WRITE); }
if (!gl_info->supported[ARB_DEPTH_TEXTURE] && (format->f.depth_size || format->f.stencil_size)) @@ -3170,11 +3163,9 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win struct fragment_caps fragment_caps; struct shader_caps shader_caps; unsigned int i, j; - BOOL srgb_write;
adapter->fragment_pipe->get_caps(adapter, &fragment_caps); adapter->shader_backend->shader_get_caps(adapter, &shader_caps); - srgb_write = (!shader_caps.ps_version || (shader_caps.wined3d_caps & WINED3D_SHADER_CAP_SRGB_WRITE));
for (i = 0; i < ARRAY_SIZE(format_texture_info); ++i) { @@ -3229,7 +3220,7 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win if (!gl_info->supported[ARB_SHADOW] && (format->f.caps[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3D_FORMAT_CAP_SHADOW)) format_clear_caps(&format->f, WINED3D_FORMAT_CAP_TEXTURE);
- query_internal_format(adapter, format, &format_texture_info[i], gl_info, srgb_write, FALSE); + query_internal_format(adapter, format, &format_texture_info[i], gl_info, FALSE);
/* Texture conversion stuff */ format->f.conv_byte_count = format_texture_info[i].conv_byte_count; @@ -3257,7 +3248,7 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win srgb_format->internal = format_texture_info[i].gl_srgb_internal; srgb_format->srgb_internal = format_texture_info[i].gl_srgb_internal; format_set_caps(&srgb_format->f, WINED3D_FORMAT_CAP_SRGB_READ | WINED3D_FORMAT_CAP_SRGB_WRITE); - query_internal_format(adapter, srgb_format, &format_texture_info[i], gl_info, srgb_write, TRUE); + query_internal_format(adapter, srgb_format, &format_texture_info[i], gl_info, TRUE); } }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 2d1bab87b00..ea45e5ebdb3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1401,7 +1401,6 @@ BOOL shader_get_stream_output_register_info(const struct wined3d_shader *shader,
typedef void (*SHADER_HANDLER)(const struct wined3d_shader_instruction *);
-#define WINED3D_SHADER_CAP_SRGB_WRITE 0x00000002u #define WINED3D_SHADER_CAP_DOUBLE_PRECISION 0x00000004u #define WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION 0x00000008u #define WINED3D_SHADER_CAP_FULL_FFP_VARYINGS 0x00000010u
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/wined3d_gl.h | 2 ++ dlls/wined3d/wined3d_private.h | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 060d92318f8..561de235379 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -358,6 +358,8 @@ struct wined3d_gl_info void (WINE_GLAPI *p_glEnableWINE)(GLenum cap); };
+#define GL_EXTCALL(f) (gl_info->gl_ops.ext.p_##f) + void install_gl_compat_wrapper(struct wined3d_gl_info *gl_info, enum wined3d_gl_extension ext); void print_glsl_info_log(const struct wined3d_gl_info *gl_info, GLuint id, BOOL program); void shader_glsl_validate_link(const struct wined3d_gl_info *gl_info, GLuint program); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index ea45e5ebdb3..8b8d9457a38 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1553,8 +1553,6 @@ extern const struct wined3d_shader_backend_ops none_shader_backend;
const struct wined3d_shader_backend_ops *wined3d_spirv_shader_backend_init_vk(void);
-#define GL_EXTCALL(f) (gl_info->gl_ops.ext.p_##f) - #define D3DCOLOR_B_R(dw) (((dw) >> 16) & 0xff) #define D3DCOLOR_B_G(dw) (((dw) >> 8) & 0xff) #define D3DCOLOR_B_B(dw) (((dw) >> 0) & 0xff)
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/wined3d_private.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 8b8d9457a38..aaa8dc6472f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1906,17 +1906,16 @@ struct wined3d_context DWORD update_compute_shader_resource_bindings : 1; DWORD update_unordered_access_view_bindings : 1; DWORD update_compute_unordered_access_view_bindings : 1; + DWORD update_primitive_type : 1; + DWORD update_patch_vertex_count : 1; DWORD last_was_rhw : 1; /* True iff last draw_primitive was in xyzrhw mode. */ - DWORD last_was_pshader : 1; DWORD last_was_vshader : 1; DWORD last_was_diffuse : 1; DWORD last_was_specular : 1; DWORD last_was_normal : 1; DWORD last_was_ffp_blit : 1; DWORD last_was_blit : 1; - DWORD last_was_ckey : 1; DWORD last_was_dual_source_blend : 1; - DWORD texShaderBumpMap : 8; /* WINED3D_MAX_FFP_TEXTURES, 8 */ DWORD lowest_disabled_stage : 4; /* Max WINED3D_MAX_FFP_TEXTURES, 8 */
DWORD fixed_function_usage_map : 8; /* WINED3D_MAX_FFP_TEXTURES, 8 */ @@ -1927,10 +1926,8 @@ struct wined3d_context DWORD current : 1; DWORD destroyed : 1; DWORD destroy_delayed : 1; - DWORD update_primitive_type : 1; - DWORD update_patch_vertex_count : 1; DWORD update_multisample_state : 1; - DWORD padding : 14; + DWORD padding : 24;
DWORD clip_distance_mask : 8; /* WINED3D_MAX_CLIP_DISTANCES, 8 */
@@ -1940,7 +1937,6 @@ struct wined3d_context
void *shader_backend_data; - void *fragment_pipe_data;
struct wined3d_stream_info stream_info;
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/cs.c | 2 -- dlls/wined3d/stateblock.c | 31 ------------------------------- dlls/wined3d/wined3d_private.h | 2 -- 3 files changed, 35 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index a462f717bdf..958c23d76a7 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -2070,8 +2070,6 @@ static void wined3d_cs_exec_set_light(struct wined3d_cs *cs, const void *data) light_info->OriginalParms = op->light.OriginalParms; light_info->position = op->light.position; light_info->direction = op->light.direction; - light_info->exponent = op->light.exponent; - light_info->cutoff = op->light.cutoff; }
void wined3d_device_context_emit_set_light(struct wined3d_device_context *context, diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index ad5753e5d99..6c44733c8bb 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -2325,7 +2325,6 @@ static void wined3d_device_context_set_light(struct wined3d_device_context *cont unsigned int light_idx, const struct wined3d_light *light) { struct wined3d_light_info *object = NULL; - float rho;
if (FAILED(wined3d_light_state_set_light(&context->state->light_state, light_idx, light, &object))) return; @@ -2348,7 +2347,6 @@ static void wined3d_device_context_set_light(struct wined3d_device_context *cont object->position.y = light->position.y; object->position.z = light->position.z; object->position.w = 1.0f; - object->cutoff = 180.0f; /* FIXME: Range */ break;
@@ -2358,8 +2356,6 @@ static void wined3d_device_context_set_light(struct wined3d_device_context *cont object->direction.y = -light->direction.y; object->direction.z = -light->direction.z; object->direction.w = 0.0f; - object->exponent = 0.0f; - object->cutoff = 180.0f; break;
case WINED3D_LIGHT_SPOT: @@ -2375,33 +2371,6 @@ static void wined3d_device_context_set_light(struct wined3d_device_context *cont object->direction.z = light->direction.z; object->direction.w = 0.0f;
- /* opengl-ish and d3d-ish spot lights use too different models - * for the light "intensity" as a function of the angle towards - * the main light direction, so we only can approximate very - * roughly. However, spot lights are rather rarely used in games - * (if ever used at all). Furthermore if still used, probably - * nobody pays attention to such details. */ - if (!light->falloff) - { - /* Falloff = 0 is easy, because d3d's and opengl's spot light - * equations have the falloff resp. exponent parameter as an - * exponent, so the spot light lighting will always be 1.0 for - * both of them, and we don't have to care for the rest of the - * rather complex calculation. */ - object->exponent = 0.0f; - } - else - { - rho = light->theta + (light->phi - light->theta) / (2 * light->falloff); - if (rho < 0.0001f) - rho = 0.0001f; - object->exponent = -0.3f / logf(cosf(rho / 2)); - } - - if (object->exponent > 128.0f) - object->exponent = 128.0f; - - object->cutoff = (float)(light->phi * 90 / M_PI); /* FIXME: Range */ break;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index aaa8dc6472f..3040e40d5e9 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2080,8 +2080,6 @@ struct wined3d_light_info /* Converted parms to speed up swapping lights */ struct wined3d_vec4 position; struct wined3d_vec4 direction; - float exponent; - float cutoff;
struct rb_entry entry; struct list changed_entry;
From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/utils.c | 9 +++------ dlls/wined3d/wined3d_private.h | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index ba61fe5a3cd..ea79e0361e0 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -10408,7 +10408,7 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl, struct glsl_ffp_fragment_shader *ffp_shader; struct ffp_frag_settings settings;
- wined3d_ffp_get_fs_settings(&context_gl->c, state, &settings, FALSE); + wined3d_ffp_get_fs_settings(&context_gl->c, state, &settings); ffp_shader = shader_glsl_find_ffp_fragment_shader(priv, &settings, context_gl); ps_id = ffp_shader->id; ps_list = &ffp_shader->linked_programs; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index e4ff36425ab..a1c5a00d51f 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -6257,8 +6257,8 @@ void multiply_matrix(struct wined3d_matrix *dst, const struct wined3d_matrix *sr *dst = tmp; }
-void wined3d_ffp_get_fs_settings(const struct wined3d_context *context, const struct wined3d_state *state, - struct ffp_frag_settings *settings, BOOL ignore_textype) +void wined3d_ffp_get_fs_settings(const struct wined3d_context *context, + const struct wined3d_state *state, struct ffp_frag_settings *settings) { #define ARG1 0x01 #define ARG2 0x02 @@ -6324,10 +6324,7 @@ void wined3d_ffp_get_fs_settings(const struct wined3d_context *context, const st settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY; else settings->op[i].color_fixup = texture->resource.format->color_fixup; - if (ignore_textype) - settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_1D; - else - settings->op[i].tex_type = texture->resource.gl_type; + settings->op[i].tex_type = texture->resource.gl_type; } else { settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY; settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_1D; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 3040e40d5e9..67ddf6f88cd 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2678,8 +2678,8 @@ int wined3d_ffp_vertex_program_key_compare(const void *key, const struct wine_rb
extern const struct wined3d_parent_ops wined3d_null_parent_ops;
-void wined3d_ffp_get_fs_settings(const struct wined3d_context *context, const struct wined3d_state *state, - struct ffp_frag_settings *settings, BOOL ignore_textype); +void wined3d_ffp_get_fs_settings(const struct wined3d_context *context, + const struct wined3d_state *state, struct ffp_frag_settings *settings); const struct ffp_frag_desc *find_ffp_frag_shader(const struct wine_rb_tree *fragment_shaders, const struct ffp_frag_settings *settings); void add_ffp_frag_shader(struct wine_rb_tree *shaders, struct ffp_frag_desc *desc);
This merge request was approved by Jan Sikorski.