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
e7a71e15
Commit
e7a71e15
authored
Apr 06, 2010
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Apr 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Turn blit_shader color_fixup_supported into blit_supported.
parent
15b959fb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
36 deletions
+84
-36
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+25
-10
directx.c
dlls/wined3d/directx.c
+3
-1
surface.c
dlls/wined3d/surface.c
+48
-24
wined3d_private.h
dlls/wined3d/wined3d_private.h
+8
-1
No files found.
dlls/wined3d/arb_program_shader.c
View file @
e7a71e15
...
...
@@ -6840,31 +6840,46 @@ static void arbfp_blit_unset(IWineD3DDevice *iface) {
LEAVE_GL
();
}
static
BOOL
arbfp_blit_color_fixup_supported
(
const
struct
wined3d_gl_info
*
gl_info
,
struct
color_fixup_desc
fixup
)
static
BOOL
arbfp_blit_supported
(
const
struct
wined3d_gl_info
*
gl_info
,
enum
blit_operation
blit_op
,
const
RECT
*
src_rect
,
DWORD
src_usage
,
WINED3DPOOL
src_pool
,
const
struct
wined3d_format_desc
*
src_format_desc
,
const
RECT
*
dst_rect
,
DWORD
dst_usage
,
WINED3DPOOL
dst_pool
,
const
struct
wined3d_format_desc
*
dst_format_desc
)
{
enum
complex_fixup
complex_fixup
;
enum
complex_fixup
src_fixup
=
get_complex_fixup
(
src_format_desc
->
color_fixup
)
;
if
(
TRACE_ON
(
d3d_shader
)
&&
TRACE_ON
(
d3d
))
{
TRACE
(
"Checking support for fixup:
\n
"
);
dump_color_fixup_desc
(
fixup
);
dump_color_fixup_desc
(
src_format_desc
->
color_fixup
);
}
if
(
blit_op
!=
BLIT_OP_BLIT
)
{
TRACE
(
"Unsupported blit_op=%d
\n
"
,
blit_op
);
return
FALSE
;
}
if
(
is_identity_fixup
(
fixup
))
if
(
!
is_identity_fixup
(
dst_format_desc
->
color_fixup
))
{
TRACE
(
"Destination fixups are not supported
\n
"
);
return
FALSE
;
}
if
(
is_identity_fixup
(
src_format_desc
->
color_fixup
))
{
TRACE
(
"[OK]
\n
"
);
return
TRUE
;
}
/* We only support YUV conversions. */
if
(
!
is_complex_fixup
(
fixup
))
/* We only support YUV conversions. */
if
(
!
is_complex_fixup
(
src_format_desc
->
color_
fixup
))
{
TRACE
(
"[FAILED]
\n
"
);
return
FALSE
;
}
complex_fixup
=
get_complex_fixup
(
fixup
);
switch
(
complex_fixup
)
switch
(
src_fixup
)
{
case
COMPLEX_FIXUP_YUY2
:
case
COMPLEX_FIXUP_UYVY
:
...
...
@@ -6874,7 +6889,7 @@ static BOOL arbfp_blit_color_fixup_supported(const struct wined3d_gl_info *gl_in
return
TRUE
;
default:
FIXME
(
"Unsupported YUV fixup %#x
\n
"
,
complex
_fixup
);
FIXME
(
"Unsupported YUV fixup %#x
\n
"
,
src
_fixup
);
TRACE
(
"[FAILED]
\n
"
);
return
FALSE
;
}
...
...
@@ -6891,7 +6906,7 @@ const struct blit_shader arbfp_blit = {
arbfp_blit_free
,
arbfp_blit_set
,
arbfp_blit_unset
,
arbfp_blit_
color_fixup_
supported
,
arbfp_blit_supported
,
arbfp_blit_color_fill
};
...
...
dlls/wined3d/directx.c
View file @
e7a71e15
...
...
@@ -3643,7 +3643,9 @@ static BOOL CheckSurfaceCapability(struct wined3d_adapter *adapter,
if
(
CheckDepthStencilCapability
(
adapter
,
adapter_format_desc
,
check_format_desc
))
return
TRUE
;
/* If opengl can't process the format natively, the blitter may be able to convert it */
if
(
adapter
->
blitter
->
color_fixup_supported
(
&
adapter
->
gl_info
,
check_format_desc
->
color_fixup
))
if
(
adapter
->
blitter
->
blit_supported
(
&
adapter
->
gl_info
,
BLIT_OP_BLIT
,
NULL
,
WINED3DPOOL_DEFAULT
,
0
,
check_format_desc
,
NULL
,
WINED3DPOOL_DEFAULT
,
0
,
adapter_format_desc
))
{
TRACE_
(
d3d_caps
)(
"[OK]
\n
"
);
return
TRUE
;
...
...
dlls/wined3d/surface.c
View file @
e7a71e15
...
...
@@ -2120,6 +2120,8 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
const
struct
wined3d_format_desc
*
glDesc
=
This
->
resource
.
format_desc
;
IWineD3DDeviceImpl
*
device
=
This
->
resource
.
device
;
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
BOOL
blit_supported
=
FALSE
;
RECT
rect
=
{
0
,
0
,
This
->
pow2Width
,
This
->
pow2Height
};
/* Default values: From the surface */
*
format
=
glDesc
->
glFormat
;
...
...
@@ -2146,14 +2148,18 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
Paletted Texture
**************** */
blit_supported
=
device
->
blitter
->
blit_supported
(
&
device
->
adapter
->
gl_info
,
BLIT_OP_BLIT
,
&
rect
,
This
->
resource
.
usage
,
This
->
resource
.
pool
,
This
->
resource
.
format_desc
,
&
rect
,
This
->
resource
.
usage
,
This
->
resource
.
pool
,
This
->
resource
.
format_desc
);
/* Use conversion when the blit_shader backend supports it. It only supports this in case of
* texturing. Further also use conversion in case of color keying.
* Paletted textures can be emulated using shaders but only do that for 2D purposes e.g. situations
* in which the main render target uses p8. Some games like GTA Vice City use P8 for texturing which
* conflicts with this.
*/
if
(
!
((
device
->
blitter
->
color_fixup_supported
(
gl_info
,
This
->
resource
.
format_desc
->
color_fixup
)
&&
device
->
render_targets
&&
This
==
(
IWineD3DSurfaceImpl
*
)
device
->
render_targets
[
0
]))
if
(
!
((
blit_supported
&&
device
->
render_targets
&&
This
==
(
IWineD3DSurfaceImpl
*
)
device
->
render_targets
[
0
]))
||
colorkey_active
||
!
use_texturing
)
{
*
format
=
GL_RGBA
;
...
...
@@ -4028,18 +4034,17 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
dst_rect
.
top
+=
This
->
currentDesc
.
Height
-
h
;
dst_rect
.
bottom
+=
This
->
currentDesc
.
Height
-
h
;
}
if
(
!
is_identity_fixup
(
This
->
resource
.
format_desc
->
color_fixup
))
if
(
!
myDevice
->
blitter
->
blit_supported
(
&
myDevice
->
adapter
->
gl_info
,
BLIT_OP_BLIT
,
&
src_rect
,
Src
->
resource
.
usage
,
Src
->
resource
.
pool
,
Src
->
resource
.
format_desc
,
&
dst_rect
,
This
->
resource
.
usage
,
This
->
resource
.
pool
,
This
->
resource
.
format_desc
))
{
FIXME
(
"Destination format %s has a fixup, this is not supported.
\n
"
,
debug_d3dformat
(
This
->
resource
.
format_desc
->
format
));
dump_color_fixup_desc
(
This
->
resource
.
format_desc
->
color_fixup
);
}
FIXME
(
"Unsupported blit operation falling back to software
\n
"
);
if
(
!
myDevice
->
blitter
->
color_fixup_supported
(
&
myDevice
->
adapter
->
gl_info
,
Src
->
resource
.
format_desc
->
color_fixup
))
{
FIXME
(
"Source format %s has an unsupported fixup:
\n
"
,
debug_d3dformat
(
Src
->
resource
.
format_desc
->
format
));
dump_color_fixup_desc
(
Src
->
resource
.
format_desc
->
color_fixup
)
;
/* Clear the palette as the surface didn't have a palette attached, it would confuse GetPalette and other calls */
if
(
paletteOverride
)
Src
->
palette
=
NULL
;
return
WINED3DERR_INVALIDCALL
;
}
myDevice
->
blitter
->
set_shader
((
IWineD3DDevice
*
)
myDevice
,
Src
);
...
...
@@ -5126,30 +5131,45 @@ static void ffp_blit_unset(IWineD3DDevice *iface)
LEAVE_GL
();
}
static
BOOL
ffp_blit_color_fixup_supported
(
const
struct
wined3d_gl_info
*
gl_info
,
struct
color_fixup_desc
fixup
)
static
BOOL
ffp_blit_supported
(
const
struct
wined3d_gl_info
*
gl_info
,
enum
blit_operation
blit_op
,
const
RECT
*
src_rect
,
DWORD
src_usage
,
WINED3DPOOL
src_pool
,
const
struct
wined3d_format_desc
*
src_format_desc
,
const
RECT
*
dst_rect
,
DWORD
dst_usage
,
WINED3DPOOL
dst_pool
,
const
struct
wined3d_format_desc
*
dst_format_desc
)
{
enum
complex_fixup
complex_fixup
;
enum
complex_fixup
src_fixup
=
get_complex_fixup
(
src_format_desc
->
color_fixup
)
;
if
(
TRACE_ON
(
d3d_surface
)
&&
TRACE_ON
(
d3d
))
{
TRACE
(
"Checking support for fixup:
\n
"
);
dump_color_fixup_desc
(
fixup
);
dump_color_fixup_desc
(
src_format_desc
->
color_
fixup
);
}
/* We only support identity conversions. */
if
(
is_identity_fixup
(
fixup
))
if
(
blit_op
!=
BLIT_OP_BLIT
)
{
TRACE
(
"[OK]
\n
"
);
return
TRUE
;
TRACE
(
"Unsupported blit_op=%d
\n
"
,
blit_op
);
return
FALSE
;
}
if
(
!
is_identity_fixup
(
dst_format_desc
->
color_fixup
))
{
TRACE
(
"Destination fixups are not supported
\n
"
);
return
FALSE
;
}
complex_fixup
=
get_complex_fixup
(
fixup
);
if
(
complex_fixup
==
COMPLEX_FIXUP_P8
&&
gl_info
->
supported
[
EXT_PALETTED_TEXTURE
])
if
(
src_fixup
==
COMPLEX_FIXUP_P8
&&
gl_info
->
supported
[
EXT_PALETTED_TEXTURE
])
{
TRACE
(
"P8 fixup supported
\n
"
);
return
TRUE
;
}
/* We only support identity conversions. */
if
(
is_identity_fixup
(
src_format_desc
->
color_fixup
))
{
TRACE
(
"[OK]
\n
"
);
return
TRUE
;
}
TRACE
(
"[FAILED]
\n
"
);
return
FALSE
;
}
...
...
@@ -5165,7 +5185,7 @@ const struct blit_shader ffp_blit = {
ffp_blit_free
,
ffp_blit_set
,
ffp_blit_unset
,
ffp_blit_
color_fixup_
supported
,
ffp_blit_supported
,
ffp_blit_color_fill
};
...
...
@@ -5190,7 +5210,11 @@ static void cpu_blit_unset(IWineD3DDevice *iface)
{
}
static
BOOL
cpu_blit_color_fixup_supported
(
const
struct
wined3d_gl_info
*
gl_info
,
struct
color_fixup_desc
fixup
)
static
BOOL
cpu_blit_supported
(
const
struct
wined3d_gl_info
*
gl_info
,
enum
blit_operation
blit_op
,
const
RECT
*
src_rect
,
DWORD
src_usage
,
WINED3DPOOL
src_pool
,
const
struct
wined3d_format_desc
*
src_format_desc
,
const
RECT
*
dst_rect
,
DWORD
dst_usage
,
WINED3DPOOL
dst_pool
,
const
struct
wined3d_format_desc
*
dst_format_desc
)
{
return
FALSE
;
}
...
...
@@ -5209,6 +5233,6 @@ const struct blit_shader cpu_blit = {
cpu_blit_free
,
cpu_blit_set
,
cpu_blit_unset
,
cpu_blit_
color_fixup_
supported
,
cpu_blit_supported
,
cpu_blit_color_fill
};
dlls/wined3d/wined3d_private.h
View file @
e7a71e15
...
...
@@ -1168,6 +1168,11 @@ HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_
const
struct
wined3d_gl_info
*
gl_info
,
const
struct
StateEntryTemplate
*
vertex
,
const
struct
fragment_pipeline
*
fragment
,
const
struct
StateEntryTemplate
*
misc
)
DECLSPEC_HIDDEN
;
enum
blit_operation
{
BLIT_OP_BLIT
};
/* Shaders for color conversions in blits */
struct
blit_shader
{
...
...
@@ -1175,7 +1180,9 @@ struct blit_shader
void
(
*
free_private
)(
IWineD3DDevice
*
iface
);
HRESULT
(
*
set_shader
)(
IWineD3DDevice
*
iface
,
IWineD3DSurfaceImpl
*
surface
);
void
(
*
unset_shader
)(
IWineD3DDevice
*
iface
);
BOOL
(
*
color_fixup_supported
)(
const
struct
wined3d_gl_info
*
gl_info
,
struct
color_fixup_desc
fixup
);
BOOL
(
*
blit_supported
)(
const
struct
wined3d_gl_info
*
gl_info
,
enum
blit_operation
blit_op
,
const
RECT
*
src_rect
,
DWORD
src_usage
,
WINED3DPOOL
src_pool
,
const
struct
wined3d_format_desc
*
src_format_desc
,
const
RECT
*
dst_rect
,
DWORD
dst_usage
,
WINED3DPOOL
dst_pool
,
const
struct
wined3d_format_desc
*
dst_format_desc
);
HRESULT
(
*
color_fill
)(
IWineD3DDeviceImpl
*
device
,
IWineD3DSurfaceImpl
*
dst_surface
,
const
RECT
*
dst_rect
,
DWORD
fill_color
);
};
...
...
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