Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
94967c28
Commit
94967c28
authored
Mar 30, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 30, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add support for half-integer pixel centers.
Like in OpenGL and Direct3D 10+.
parent
d9fbb3f8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
18 deletions
+34
-18
directx.c
dlls/d3d8/directx.c
+2
-1
directx.c
dlls/d3d9/directx.c
+1
-1
ddraw.c
dlls/ddraw/ddraw.c
+2
-5
ddraw_private.h
dlls/ddraw/ddraw_private.h
+3
-0
main.c
dlls/ddraw/main.c
+2
-2
utils.c
dlls/wined3d/utils.c
+14
-7
wined3d_private.h
dlls/wined3d/wined3d_private.h
+9
-2
wined3d.h
include/wine/wined3d.h
+1
-0
No files found.
dlls/d3d8/directx.c
View file @
94967c28
...
...
@@ -402,7 +402,8 @@ static const struct IDirect3D8Vtbl d3d8_vtbl =
BOOL
d3d8_init
(
struct
d3d8
*
d3d8
)
{
DWORD
flags
=
WINED3D_LEGACY_DEPTH_BIAS
|
WINED3D_VIDMEM_ACCOUNTING
|
WINED3D_HANDLE_RESTORE
;
DWORD
flags
=
WINED3D_LEGACY_DEPTH_BIAS
|
WINED3D_VIDMEM_ACCOUNTING
|
WINED3D_HANDLE_RESTORE
|
WINED3D_PIXEL_CENTER_INTEGER
;
d3d8
->
IDirect3D8_iface
.
lpVtbl
=
&
d3d8_vtbl
;
d3d8
->
refcount
=
1
;
...
...
dlls/d3d9/directx.c
View file @
94967c28
...
...
@@ -636,7 +636,7 @@ static const struct IDirect3D9ExVtbl d3d9_vtbl =
BOOL
d3d9_init
(
struct
d3d9
*
d3d9
,
BOOL
extended
)
{
DWORD
flags
=
WINED3D_PRESENT_CONVERSION
|
WINED3D_HANDLE_RESTORE
;
DWORD
flags
=
WINED3D_PRESENT_CONVERSION
|
WINED3D_HANDLE_RESTORE
|
WINED3D_PIXEL_CENTER_INTEGER
;
if
(
!
extended
)
flags
|=
WINED3D_VIDMEM_ACCOUNTING
;
...
...
dlls/ddraw/ddraw.c
View file @
94967c28
...
...
@@ -4835,7 +4835,6 @@ static const struct wined3d_device_parent_ops ddraw_wined3d_device_parent_ops =
HRESULT
ddraw_init
(
struct
ddraw
*
ddraw
,
enum
wined3d_device_type
device_type
)
{
WINED3DCAPS
caps
;
DWORD
flags
;
HRESULT
hr
;
ddraw
->
IDirectDraw7_iface
.
lpVtbl
=
&
ddraw7_vtbl
;
...
...
@@ -4850,11 +4849,9 @@ HRESULT ddraw_init(struct ddraw *ddraw, enum wined3d_device_type device_type)
ddraw
->
numIfaces
=
1
;
ddraw
->
ref7
=
1
;
flags
=
WINED3D_LEGACY_DEPTH_BIAS
|
WINED3D_VIDMEM_ACCOUNTING
|
WINED3D_RESTORE_MODE_ON_ACTIVATE
|
WINED3D_FOCUS_MESSAGES
;
if
(
!
(
ddraw
->
wined3d
=
wined3d_create
(
flags
)))
if
(
!
(
ddraw
->
wined3d
=
wined3d_create
(
DDRAW_WINED3D_FLAGS
)))
{
if
(
!
(
ddraw
->
wined3d
=
wined3d_create
(
flags
|
WINED3D_NO3D
)))
if
(
!
(
ddraw
->
wined3d
=
wined3d_create
(
DDRAW_WINED3D_FLAGS
|
WINED3D_NO3D
)))
{
WARN
(
"Failed to create a wined3d object.
\n
"
);
return
E_FAIL
;
...
...
dlls/ddraw/ddraw_private.h
View file @
94967c28
...
...
@@ -59,6 +59,9 @@ struct FvfToDecl
#define DDRAW_STRIDE_ALIGNMENT 8
#define DDRAW_WINED3D_FLAGS (WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING \
| WINED3D_RESTORE_MODE_ON_ACTIVATE | WINED3D_FOCUS_MESSAGES | WINED3D_PIXEL_CENTER_INTEGER)
enum
ddraw_device_state
{
DDRAW_DEVICE_STATE_OK
,
...
...
dlls/ddraw/main.c
View file @
94967c28
...
...
@@ -405,9 +405,9 @@ HRESULT WINAPI DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA callback, void *contex
FIXME
(
"flags 0x%08x not handled
\n
"
,
flags
&
~
DDENUM_ATTACHEDSECONDARYDEVICES
);
TRACE
(
"Enumerating ddraw interfaces
\n
"
);
if
(
!
(
wined3d
=
wined3d_create
(
WINED3D_LEGACY_DEPTH_BIA
S
)))
if
(
!
(
wined3d
=
wined3d_create
(
DDRAW_WINED3D_FLAG
S
)))
{
if
(
!
(
wined3d
=
wined3d_create
(
WINED3D_LEGACY_DEPTH_BIA
S
|
WINED3D_NO3D
)))
if
(
!
(
wined3d
=
wined3d_create
(
DDRAW_WINED3D_FLAG
S
|
WINED3D_NO3D
)))
{
WARN
(
"Failed to create a wined3d object.
\n
"
);
return
E_FAIL
;
...
...
dlls/wined3d/utils.c
View file @
94967c28
...
...
@@ -3155,6 +3155,8 @@ void get_modelview_matrix(const struct wined3d_context *context, const struct wi
void
get_projection_matrix
(
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
struct
wined3d_matrix
*
mat
)
{
float
center_offset
;
/* There are a couple of additional things we have to take into account
* here besides the projection transformation itself:
* - We need to flip along the y-axis in case of offscreen rendering.
...
...
@@ -3170,6 +3172,11 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
* driver, but small enough to prevent it from interfering with any
* anti-aliasing. */
if
(
context
->
swapchain
->
device
->
wined3d
->
flags
&
WINED3D_PIXEL_CENTER_INTEGER
)
center_offset
=
63
.
0
f
/
64
.
0
f
;
else
center_offset
=
-
1
.
0
f
/
64
.
0
f
;
if
(
context
->
last_was_rhw
)
{
/* Transform D3D RHW coordinates to OpenGL clip coordinates. */
...
...
@@ -3178,11 +3185,11 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
float
w
=
state
->
viewport
.
width
;
float
h
=
state
->
viewport
.
height
;
float
x_scale
=
2
.
0
f
/
w
;
float
x_offset
=
(
float
)((
63
.
0
/
64
.
0
-
(
2
.
0
*
x
)
-
w
)
/
w
)
;
float
x_offset
=
(
center_offset
-
(
2
.
0
f
*
x
)
-
w
)
/
w
;
float
y_scale
=
context
->
render_offscreen
?
2
.
0
f
/
h
:
2
.
0
f
/
-
h
;
float
y_offset
=
(
float
)(
context
->
render_offscreen
?
(
63
.
0
/
64
.
0
-
(
2
.
0
*
y
)
-
h
)
/
h
:
(
63
.
0
/
64
.
0
-
(
2
.
0
*
y
)
-
h
)
/
-
h
)
;
float
y_offset
=
context
->
render_offscreen
?
(
center_offset
-
(
2
.
0
f
*
y
)
-
h
)
/
h
:
(
center_offset
-
(
2
.
0
f
*
y
)
-
h
)
/
-
h
;
enum
wined3d_depth_buffer_type
zenable
=
state
->
fb
->
depth_stencil
?
state
->
render_states
[
WINED3D_RS_ZENABLE
]
:
WINED3D_ZB_FALSE
;
float
z_scale
=
zenable
?
2
.
0
f
:
0
.
0
f
;
...
...
@@ -3200,10 +3207,10 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
else
{
float
y_scale
=
context
->
render_offscreen
?
-
1
.
0
f
:
1
.
0
f
;
float
x_offset
=
63
.
0
f
/
64
.
0
f
*
(
1
.
0
f
/
state
->
viewport
.
width
)
;
float
x_offset
=
center_offset
/
state
->
viewport
.
width
;
float
y_offset
=
context
->
render_offscreen
?
63
.
0
f
/
64
.
0
f
*
(
1
.
0
f
/
state
->
viewport
.
height
)
:
-
63
.
0
f
/
64
.
0
f
*
(
1
.
0
f
/
state
->
viewport
.
height
)
;
?
center_offset
/
state
->
viewport
.
height
:
-
center_offset
/
state
->
viewport
.
height
;
const
struct
wined3d_matrix
projection
=
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
...
...
dlls/wined3d/wined3d_private.h
View file @
94967c28
...
...
@@ -3009,10 +3009,17 @@ static inline BOOL shader_is_scalar(const struct wined3d_shader_register *reg)
static
inline
void
shader_get_position_fixup
(
const
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
float
*
position_fixup
)
{
float
center_offset
;
if
(
context
->
swapchain
->
device
->
wined3d
->
flags
&
WINED3D_PIXEL_CENTER_INTEGER
)
center_offset
=
63
.
0
f
/
64
.
0
f
;
else
center_offset
=
-
1
.
0
f
/
64
.
0
f
;
position_fixup
[
0
]
=
1
.
0
f
;
position_fixup
[
1
]
=
1
.
0
f
;
position_fixup
[
2
]
=
(
63
.
0
f
/
64
.
0
f
)
/
state
->
viewport
.
width
;
position_fixup
[
3
]
=
-
(
63
.
0
f
/
64
.
0
f
)
/
state
->
viewport
.
height
;
position_fixup
[
2
]
=
center_offset
/
state
->
viewport
.
width
;
position_fixup
[
3
]
=
-
center_offset
/
state
->
viewport
.
height
;
if
(
context
->
render_offscreen
)
{
...
...
include/wine/wined3d.h
View file @
94967c28
...
...
@@ -1247,6 +1247,7 @@ enum wined3d_display_rotation
#define WINED3D_RESTORE_MODE_ON_ACTIVATE 0x00000010
#define WINED3D_FOCUS_MESSAGES 0x00000020
#define WINED3D_HANDLE_RESTORE 0x00000040
#define WINED3D_PIXEL_CENTER_INTEGER 0x00000080
#define WINED3D_RESZ_CODE 0x7fa05000
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment