Added patch to revert changes to offset the pixel center in the ARB_clip_control case.

This commit is contained in:
Sebastian Lackner 2016-10-15 05:55:42 +02:00
parent dd53426bfd
commit 07c920f32d
6 changed files with 109 additions and 23 deletions

View File

@ -370,6 +370,7 @@ patch_enable_all ()
enable_wined3d_DXTn="$1"
enable_wined3d_Limit_Vram="$1"
enable_wined3d_QUERY_Stubs="$1"
enable_wined3d_Revert_Pixel_Center_Offset="$1"
enable_wined3d_Revert_Texture_Upload="$1"
enable_wined3d_Silence_FIXMEs="$1"
enable_wined3d_WINED3DFMT_R32G32_UINT="$1"
@ -1289,6 +1290,9 @@ patch_enable ()
wined3d-QUERY_Stubs)
enable_wined3d_QUERY_Stubs="$2"
;;
wined3d-Revert_Pixel_Center_Offset)
enable_wined3d_Revert_Pixel_Center_Offset="$2"
;;
wined3d-Revert_Texture_Upload)
enable_wined3d_Revert_Texture_Upload="$2"
;;
@ -2020,6 +2024,9 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then
if test "$enable_wined3d_QUERY_Stubs" -gt 1; then
abort "Patchset wined3d-QUERY_Stubs disabled, but wined3d-CSMT_Helper depends on that."
fi
if test "$enable_wined3d_Revert_Pixel_Center_Offset" -gt 1; then
abort "Patchset wined3d-Revert_Pixel_Center_Offset disabled, but wined3d-CSMT_Helper depends on that."
fi
if test "$enable_wined3d_Silence_FIXMEs" -gt 1; then
abort "Patchset wined3d-Silence_FIXMEs disabled, but wined3d-CSMT_Helper depends on that."
fi
@ -2029,6 +2036,7 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then
enable_wined3d_Accounting=1
enable_wined3d_DXTn=1
enable_wined3d_QUERY_Stubs=1
enable_wined3d_Revert_Pixel_Center_Offset=1
enable_wined3d_Silence_FIXMEs=1
fi
@ -7425,6 +7433,18 @@ if test "$enable_wined3d_QUERY_Stubs" -eq 1; then
) >> "$patchlist"
fi
# Patchset wined3d-Revert_Pixel_Center_Offset
# |
# | Modified files:
# | * dlls/wined3d/directx.c, dlls/wined3d/state.c, dlls/wined3d/utils.c
# |
if test "$enable_wined3d_Revert_Pixel_Center_Offset" -eq 1; then
patch_apply wined3d-Revert_Pixel_Center_Offset/0001-Revert-wined3d-Slightly-offset-the-viewport-in-the-A.patch
(
echo '+ { "Sebastian Lackner", "Revert \"wined3d: Slightly offset the viewport in the ARB_clip_control case.\".", 1 },';
) >> "$patchlist"
fi
# Patchset wined3d-Silence_FIXMEs
# |
# | Modified files:
@ -7453,7 +7473,8 @@ fi
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * makedep-PARENTSPEC, ntdll-Attach_Process_DLLs, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects,
# | wined3d-1DTextures, wined3d-Accounting, wined3d-DXTn, wined3d-QUERY_Stubs, wined3d-Silence_FIXMEs
# | wined3d-1DTextures, wined3d-Accounting, wined3d-DXTn, wined3d-QUERY_Stubs, wined3d-Revert_Pixel_Center_Offset, wined3d-
# | Silence_FIXMEs
# |
# | Modified files:
# | * configure.ac, dlls/wined3d-csmt/Makefile.in, dlls/wined3d-csmt/version.rc
@ -7521,7 +7542,8 @@ fi
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * makedep-PARENTSPEC, ntdll-Attach_Process_DLLs, ntdll-DllOverrides_WOW64, ntdll-Loader_Machine_Type, ntdll-DllRedirects,
# | wined3d-1DTextures, wined3d-Accounting, wined3d-DXTn, wined3d-QUERY_Stubs, wined3d-Silence_FIXMEs, wined3d-CSMT_Helper
# | wined3d-1DTextures, wined3d-Accounting, wined3d-DXTn, wined3d-QUERY_Stubs, wined3d-Revert_Pixel_Center_Offset, wined3d-
# | Silence_FIXMEs, wined3d-CSMT_Helper
# |
# | This patchset fixes the following Wine bugs:
# | * [#11674] Support for CSMT (command stream) to increase graphic performance

View File

@ -3,5 +3,6 @@ Depends: wined3d-DXTn
Depends: wined3d-QUERY_Stubs
Depends: wined3d-1DTextures
Depends: wined3d-Silence_FIXMEs
Depends: wined3d-Revert_Pixel_Center_Offset
Depends: makedep-PARENTSPEC
Depends: ntdll-DllRedirects

View File

@ -1,4 +1,4 @@
From cb9504f39ea96c130f77483275831c0435f745a2 Mon Sep 17 00:00:00 2001
From 244b077b597e99f5a68b9c905114ee6a82781c73 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 20 Dec 2012 13:09:17 +0100
Subject: wined3d: Move the framebuffer into wined3d_state
@ -20,7 +20,7 @@ Subject: wined3d: Move the framebuffer into wined3d_state
13 files changed, 194 insertions(+), 135 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 2edac17..dbcbbb0 100644
index cbdc871..5a0bb65 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -704,7 +704,7 @@ static void shader_arb_load_constants_internal(struct shader_arb_priv *priv,
@ -32,7 +32,7 @@ index 2edac17..dbcbbb0 100644
/* Load DirectX 9 float constants for pixel shader */
priv->highest_dirty_ps_const = shader_arb_load_constants_f(pshader, gl_info, GL_FRAGMENT_PROGRAM_ARB,
@@ -4736,7 +4736,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context
@@ -4739,7 +4739,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context
}
else
{
@ -281,7 +281,7 @@ index b4cbcab..0beb6c2 100644
HeapFree(GetProcessHeap(), 0, cs);
}
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 0e41966..6ec7705 100644
index c08dda6..6356b64 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1004,7 +1004,7 @@ static void device_init_swapchain_state(struct wined3d_device *device, struct wi
@ -607,7 +607,7 @@ index e5b30db..1188009 100644
struct wined3d_event_query *ib_query = NULL;
struct wined3d_stream_info si_emulated;
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 7befe07..d594362 100644
index 3fa02c2..35b2abe55 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1514,7 +1514,7 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
@ -633,7 +633,7 @@ index 61509d9..a2fb749 100644
static unsigned int warned = 0;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 5776995..d3dd978 100644
index 8ac23bc..60e1ea6 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -152,7 +152,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_
@ -715,10 +715,10 @@ index 5776995..d3dd978 100644
- const struct wined3d_rendertarget_view *target = state->fb->render_targets[0];
+ const struct wined3d_rendertarget_view *depth_stencil = state->fb.depth_stencil;
+ const struct wined3d_rendertarget_view *target = state->fb.render_targets[0];
/* See get_projection_matrix() in utils.c for a discussion about those
* values. */
float pixel_center_offset = context->d3d_info->wined3d_creation_flags
@@ -4858,7 +4858,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
& WINED3D_PIXEL_CENTER_INTEGER ? 0.5f : 0.0f;
const struct wined3d_gl_info *gl_info = context->gl_info;
@@ -4856,7 +4856,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
}
else
{
@ -727,7 +727,7 @@ index 5776995..d3dd978 100644
UINT height;
UINT width;
@@ -4934,7 +4934,7 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state
@@ -4932,7 +4932,7 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
@ -837,7 +837,7 @@ index 2fbfa2c..bb3c0cc 100644
if (type == WINED3D_SBT_RECORDED)
return WINED3D_OK;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index e4a430c..1701b2d 100644
index 08f6d10..b87bbab 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -2568,7 +2568,7 @@ static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RE
@ -863,7 +863,7 @@ index d5478f4..f649b2f 100644
struct wined3d_texture *logo_texture;
struct wined3d_context *context;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index e2959bb..8427e37 100644
index cb3ae62..267e884 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4532,7 +4532,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
@ -885,7 +885,7 @@ index e2959bb..8427e37 100644
|| !state->render_states[WINED3D_RS_CLIPPLANEENABLE])
{
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 6d5cb1b..a74a988 100644
index f338c55..8bb5957 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1447,6 +1447,36 @@ struct wined3d_timestamp_query
@ -946,7 +946,7 @@ index 6d5cb1b..a74a988 100644
typedef void (*APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id);
struct StateEntry
@@ -2364,7 +2389,7 @@ struct wined3d_stream_state
@@ -2380,7 +2405,7 @@ struct wined3d_stream_state
struct wined3d_state
{
DWORD flags;
@ -955,7 +955,7 @@ index 6d5cb1b..a74a988 100644
struct wined3d_vertex_declaration *vertex_declaration;
struct wined3d_stream_output stream_output[MAX_STREAM_OUT];
@@ -2469,7 +2494,6 @@ struct wined3d_device
@@ -2485,7 +2510,6 @@ struct wined3d_device
struct wine_rb_tree samplers;
/* Render Target Support */
@ -963,7 +963,7 @@ index 6d5cb1b..a74a988 100644
struct wined3d_surface *onscreen_depth_stencil;
struct wined3d_rendertarget_view *auto_depth_stencil_view;
@@ -3019,9 +3043,8 @@ struct wined3d_stateblock
@@ -3035,9 +3059,8 @@ struct wined3d_stateblock
void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN;
void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN;
@ -975,7 +975,7 @@ index 6d5cb1b..a74a988 100644
void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN;
struct wined3d_cs_ops
@@ -3034,7 +3057,6 @@ struct wined3d_cs
@@ -3050,7 +3073,6 @@ struct wined3d_cs
{
const struct wined3d_cs_ops *ops;
struct wined3d_device *device;

View File

@ -5530,10 +5530,10 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
+ const struct wined3d_rendertarget_view *depth_stencil = state->fb.depth_stencil;
+ const struct wined3d_rendertarget_view *target = state->fb.render_targets[0];
+#endif /* STAGING_CSMT */
/* See get_projection_matrix() in utils.c for a discussion about those
* values. */
float pixel_center_offset = context->d3d_info->wined3d_creation_flags
@@ -4858,7 +4900,11 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
& WINED3D_PIXEL_CENTER_INTEGER ? 0.5f : 0.0f;
const struct wined3d_gl_info *gl_info = context->gl_info;
@@ -4856,7 +4898,11 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
}
else
{
@ -5545,7 +5545,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
UINT height;
UINT width;
@@ -4934,7 +4980,11 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state
@@ -4932,7 +4978,11 @@ void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);

View File

@ -0,0 +1,60 @@
From bee3b5c4faa6a7a0bcc8248a7a10095632b0954f Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 15 Oct 2016 04:23:44 +0200
Subject: Revert "wined3d: Slightly offset the viewport in the ARB_clip_control
case."
This reverts commit 1bed10abee7d2439a5c7358596c860c454f06b53.
---
dlls/wined3d/directx.c | 2 +-
dlls/wined3d/state.c | 4 +---
dlls/wined3d/utils.c | 4 ++--
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index a8c8c9f..8039942 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -3881,7 +3881,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, DWORD
gl_info->gl_ops.gl.p_glGetIntegerv(GL_VIEWPORT_SUBPIXEL_BITS, &subpixel_bits);
TRACE("Viewport supports %d subpixel bits.\n", subpixel_bits);
- if (subpixel_bits < 8)
+ if (!subpixel_bits)
gl_info->supported[ARB_VIEWPORT_ARRAY] = FALSE;
}
if (gl_info->supported[ARB_CLIP_CONTROL] && !gl_info->supported[ARB_VIEWPORT_ARRAY])
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index d462ea5..ddd8d93 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -4653,10 +4653,8 @@ static void viewport_miscpart_cc(struct wined3d_context *context,
{
const struct wined3d_rendertarget_view *depth_stencil = state->fb->depth_stencil;
const struct wined3d_rendertarget_view *target = state->fb->render_targets[0];
- /* See get_projection_matrix() in utils.c for a discussion about those
- * values. */
float pixel_center_offset = context->d3d_info->wined3d_creation_flags
- & WINED3D_PIXEL_CENTER_INTEGER ? 63.0f / 128.0f : -1.0f / 128.0f;
+ & WINED3D_PIXEL_CENTER_INTEGER ? 0.5f : 0.0f;
const struct wined3d_gl_info *gl_info = context->gl_info;
struct wined3d_viewport vp = state->viewport;
unsigned int width, height;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 2171611..38024ba 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -4502,8 +4502,8 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
* here besides the projection transformation itself:
* - We need to flip along the y-axis in case of offscreen rendering.
* - OpenGL Z range is {-Wc,...,Wc} while D3D Z range is {0,...,Wc}.
- * - <= D3D9 coordinates refer to pixel centers while GL coordinates
- * refer to pixel corners.
+ * - D3D coordinates refer to pixel centers while GL coordinates refer
+ * to pixel corners.
* - D3D has a top-left filling convention. We need to maintain this
* even after the y-flip mentioned above.
* In order to handle the last two points, we translate by
--
2.9.0

View File

@ -0,0 +1,3 @@
Fixes: Revert changes to offset the pixel center in the ARB_clip_control case
# The main purpose is to avoid test failures on the development machines.
# FIXME: According to Matteo Bruno it could also be a Nvidia driver bug.