wined3d: Slightly offset the viewport in the ARB_clip_control case.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7d5bd929e2
commit
1bed10abee
|
@ -3862,7 +3862,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);
|
gl_info->gl_ops.gl.p_glGetIntegerv(GL_VIEWPORT_SUBPIXEL_BITS, &subpixel_bits);
|
||||||
TRACE("Viewport supports %d subpixel bits.\n", subpixel_bits);
|
TRACE("Viewport supports %d subpixel bits.\n", subpixel_bits);
|
||||||
if (!subpixel_bits)
|
if (subpixel_bits < 8)
|
||||||
gl_info->supported[ARB_VIEWPORT_ARRAY] = FALSE;
|
gl_info->supported[ARB_VIEWPORT_ARRAY] = FALSE;
|
||||||
}
|
}
|
||||||
if (gl_info->supported[ARB_CLIP_CONTROL] && !gl_info->supported[ARB_VIEWPORT_ARRAY])
|
if (gl_info->supported[ARB_CLIP_CONTROL] && !gl_info->supported[ARB_VIEWPORT_ARRAY])
|
||||||
|
|
|
@ -4653,8 +4653,10 @@ 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 *depth_stencil = state->fb->depth_stencil;
|
||||||
const struct wined3d_rendertarget_view *target = state->fb->render_targets[0];
|
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->device->wined3d->flags
|
float pixel_center_offset = context->device->wined3d->flags
|
||||||
& WINED3D_PIXEL_CENTER_INTEGER ? 0.5f : 0.0f;
|
& WINED3D_PIXEL_CENTER_INTEGER ? 63.0f / 128.0f : -1.0f / 128.0f;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
struct wined3d_viewport vp = state->viewport;
|
struct wined3d_viewport vp = state->viewport;
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
|
|
|
@ -4502,8 +4502,8 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
|
||||||
* here besides the projection transformation itself:
|
* here besides the projection transformation itself:
|
||||||
* - We need to flip along the y-axis in case of offscreen rendering.
|
* - 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}.
|
* - OpenGL Z range is {-Wc,...,Wc} while D3D Z range is {0,...,Wc}.
|
||||||
* - D3D coordinates refer to pixel centers while GL coordinates refer
|
* - <= D3D9 coordinates refer to pixel centers while GL coordinates
|
||||||
* to pixel corners.
|
* refer to pixel corners.
|
||||||
* - D3D has a top-left filling convention. We need to maintain this
|
* - D3D has a top-left filling convention. We need to maintain this
|
||||||
* even after the y-flip mentioned above.
|
* even after the y-flip mentioned above.
|
||||||
* In order to handle the last two points, we translate by
|
* In order to handle the last two points, we translate by
|
||||||
|
|
Loading…
Reference in New Issue