Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
5e28b0c9
Commit
5e28b0c9
authored
Feb 18, 2013
by
Matteo Bruni
Committed by
Alexandre Julliard
Feb 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add RESZ support.
parent
25d0d087
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
device.c
dlls/wined3d/device.c
+22
-0
utils.c
dlls/wined3d/utils.c
+11
-0
wined3d.h
include/wine/wined3d.h
+3
-0
No files found.
dlls/wined3d/device.c
View file @
5e28b0c9
...
...
@@ -2212,6 +2212,22 @@ void CDECL wined3d_device_get_viewport(const struct wined3d_device *device, stru
*
viewport
=
device
->
stateBlock
->
state
.
viewport
;
}
static
void
resolve_depth_buffer
(
struct
wined3d_state
*
state
)
{
struct
wined3d_texture
*
texture
=
state
->
textures
[
0
];
struct
wined3d_surface
*
depth_stencil
,
*
surface
;
if
(
!
texture
||
texture
->
resource
.
type
!=
WINED3D_RTYPE_TEXTURE
||
!
(
texture
->
resource
.
format
->
flags
&
WINED3DFMT_FLAG_DEPTH
))
return
;
surface
=
surface_from_resource
(
texture
->
sub_resources
[
0
]);
depth_stencil
=
state
->
fb
->
depth_stencil
;
if
(
!
depth_stencil
)
return
;
wined3d_surface_blt
(
surface
,
NULL
,
depth_stencil
,
NULL
,
0
,
NULL
,
WINED3D_TEXF_POINT
);
}
void
CDECL
wined3d_device_set_render_state
(
struct
wined3d_device
*
device
,
enum
wined3d_render_state
state
,
DWORD
value
)
{
...
...
@@ -2234,6 +2250,12 @@ void CDECL wined3d_device_set_render_state(struct wined3d_device *device,
TRACE
(
"Application is setting the old value over, nothing to do.
\n
"
);
else
device_invalidate_state
(
device
,
STATE_RENDER
(
state
));
if
(
state
==
WINED3D_RS_POINTSIZE
&&
value
==
WINED3D_RESZ_CODE
)
{
TRACE
(
"RESZ multisampled depth buffer resolve triggered.
\n
"
);
resolve_depth_buffer
(
&
device
->
stateBlock
->
state
);
}
}
DWORD
CDECL
wined3d_device_get_render_state
(
const
struct
wined3d_device
*
device
,
enum
wined3d_render_state
state
)
...
...
dlls/wined3d/utils.c
View file @
5e28b0c9
...
...
@@ -126,6 +126,7 @@ static const struct wined3d_format_channels formats[] =
{
WINED3DFMT_NVDB
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
WINED3DFMT_INST
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
WINED3DFMT_INTZ
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
4
,
24
,
8
},
{
WINED3DFMT_RESZ
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},
{
WINED3DFMT_NVHU
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
0
,
0
},
{
WINED3DFMT_NVHS
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
0
,
0
},
{
WINED3DFMT_NULL
,
8
,
8
,
8
,
8
,
0
,
8
,
16
,
24
,
4
,
0
,
0
},
...
...
@@ -1712,6 +1713,15 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_
gl_info
->
formats
[
idx
].
flags
|=
WINED3DFMT_FLAG_TEXTURE
;
}
/* RESZ aka AMD DX9-level hack for multisampled depth buffer resolve. You query for RESZ
* support by checking for availability of MAKEFOURCC('R','E','S','Z') surfaces with
* RENDERTARGET usage. */
if
(
gl_info
->
supported
[
ARB_FRAMEBUFFER_OBJECT
])
{
idx
=
getFmtIdx
(
WINED3DFMT_RESZ
);
gl_info
->
formats
[
idx
].
flags
|=
WINED3DFMT_FLAG_TEXTURE
|
WINED3DFMT_FLAG_RENDERTARGET
;
}
for
(
i
=
0
;
i
<
sizeof
(
formats
)
/
sizeof
(
*
formats
);
++
i
)
{
struct
wined3d_format
*
format
=
&
gl_info
->
formats
[
idx
];
...
...
@@ -1975,6 +1985,7 @@ const char *debug_d3dformat(enum wined3d_format_id format_id)
FMT_TO_STR
(
WINED3DFMT_B8G8R8A8_UNORM
);
FMT_TO_STR
(
WINED3DFMT_B8G8R8X8_UNORM
);
FMT_TO_STR
(
WINED3DFMT_INTZ
);
FMT_TO_STR
(
WINED3DFMT_RESZ
);
FMT_TO_STR
(
WINED3DFMT_NULL
);
FMT_TO_STR
(
WINED3DFMT_R16
);
FMT_TO_STR
(
WINED3DFMT_AL16
);
...
...
include/wine/wined3d.h
View file @
5e28b0c9
...
...
@@ -245,6 +245,7 @@ enum wined3d_format_id
WINED3DFMT_NVHU
=
WINEMAKEFOURCC
(
'N'
,
'V'
,
'H'
,
'U'
),
WINED3DFMT_NVHS
=
WINEMAKEFOURCC
(
'N'
,
'V'
,
'H'
,
'S'
),
WINED3DFMT_INTZ
=
WINEMAKEFOURCC
(
'I'
,
'N'
,
'T'
,
'Z'
),
WINED3DFMT_RESZ
=
WINEMAKEFOURCC
(
'R'
,
'E'
,
'S'
,
'Z'
),
WINED3DFMT_NULL
=
WINEMAKEFOURCC
(
'N'
,
'U'
,
'L'
,
'L'
),
WINED3DFMT_R16
=
WINEMAKEFOURCC
(
' '
,
'R'
,
'1'
,
'6'
),
WINED3DFMT_AL16
=
WINEMAKEFOURCC
(
'A'
,
'L'
,
'1'
,
'6'
),
...
...
@@ -1216,6 +1217,8 @@ enum wined3d_display_rotation
#define WINED3D_LEGACY_DEPTH_BIAS 0x00000001
#define WINED3D_NO3D 0x00000002
#define WINED3D_RESZ_CODE 0x7fa05000
/* dwDDFX */
/* arithmetic stretching along y axis */
#define WINEDDBLTFX_ARITHSTRETCHY 0x00000001
...
...
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