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
27a96e47
Commit
27a96e47
authored
Mar 18, 2010
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Mar 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Start moving paletted texture support to the blit_shader.
parent
fd99ab78
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
13 deletions
+25
-13
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+1
-1
directx.c
dlls/wined3d/directx.c
+1
-1
surface.c
dlls/wined3d/surface.c
+17
-8
utils.c
dlls/wined3d/utils.c
+5
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/arb_program_shader.c
View file @
27a96e47
...
...
@@ -6808,7 +6808,7 @@ static void arbfp_blit_unset(IWineD3DDevice *iface) {
LEAVE_GL
();
}
static
BOOL
arbfp_blit_color_fixup_supported
(
struct
color_fixup_desc
fixup
)
static
BOOL
arbfp_blit_color_fixup_supported
(
const
struct
wined3d_gl_info
*
gl_info
,
struct
color_fixup_desc
fixup
)
{
enum
complex_fixup
complex_fixup
;
...
...
dlls/wined3d/directx.c
View file @
27a96e47
...
...
@@ -3619,7 +3619,7 @@ static BOOL CheckSurfaceCapability(struct wined3d_adapter *adapter, const struct
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
(
check_format_desc
->
color_fixup
))
if
(
adapter
->
blitter
->
color_fixup_supported
(
&
adapter
->
gl_info
,
check_format_desc
->
color_fixup
))
{
TRACE_
(
d3d_caps
)(
"[OK]
\n
"
);
return
TRUE
;
...
...
dlls/wined3d/surface.c
View file @
27a96e47
...
...
@@ -2078,14 +2078,13 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
Paletted Texture
**************** */
/* Use conversion when the paletted texture extension OR fragment shaders are available. When either
* of the two is available make sure texturing is requested as neither of the two works in
* conjunction with calls like glDraw-/glReadPixels. Further also use conversion in case of color keying.
/* 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
(
!
(
gl_info
->
supported
[
EXT_PALETTED_TEXTURE
]
||
(
device
->
blitter
->
color_fixup_supported
(
This
->
resource
.
format_desc
->
color_fixup
)
if
(
!
(
(
device
->
blitter
->
color_fixup_supported
(
gl_info
,
This
->
resource
.
format_desc
->
color_fixup
)
&&
device
->
render_targets
&&
This
==
(
IWineD3DSurfaceImpl
*
)
device
->
render_targets
[
0
]))
||
colorkey_active
||
!
use_texturing
)
{
...
...
@@ -2099,7 +2098,8 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
*
convert
=
CONVERT_PALETTED
;
}
}
else
if
(
!
gl_info
->
supported
[
EXT_PALETTED_TEXTURE
]
&&
device
->
blitter
->
color_fixup_supported
(
This
->
resource
.
format_desc
->
color_fixup
))
/* TODO: this check is evil and should die (it basically checks which blitter backend is used) */
else
if
(
!
gl_info
->
supported
[
EXT_PALETTED_TEXTURE
]
&&
device
->
blitter
->
color_fixup_supported
(
gl_info
,
This
->
resource
.
format_desc
->
color_fixup
))
{
*
format
=
GL_ALPHA
;
*
type
=
GL_UNSIGNED_BYTE
;
...
...
@@ -4062,7 +4062,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
dump_color_fixup_desc
(
This
->
resource
.
format_desc
->
color_fixup
);
}
if
(
!
myDevice
->
blitter
->
color_fixup_supported
(
Src
->
resource
.
format_desc
->
color_fixup
))
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
));
...
...
@@ -4993,7 +4993,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D
d3dfmt_convert_surface
(
This
->
resource
.
allocatedMemory
,
mem
,
pitch
,
width
,
height
,
outpitch
,
convert
,
This
);
}
else
if
(
This
->
resource
.
format_desc
->
format
==
WINED3DFMT_P8_UINT
&&
(
gl_info
->
supported
[
EXT_PALETTED_TEXTURE
]
||
device
->
blitter
->
color_fixup_supported
(
This
->
resource
.
format_desc
->
color_fixup
)))
&&
(
device
->
blitter
->
color_fixup_supported
(
gl_info
,
This
->
resource
.
format_desc
->
color_fixup
)))
{
d3dfmt_p8_upload_palette
(
iface
,
gl_info
,
convert
);
mem
=
This
->
resource
.
allocatedMemory
;
...
...
@@ -5206,8 +5206,10 @@ static void ffp_blit_unset(IWineD3DDevice *iface)
LEAVE_GL
();
}
static
BOOL
ffp_blit_color_fixup_supported
(
struct
color_fixup_desc
fixup
)
static
BOOL
ffp_blit_color_fixup_supported
(
const
struct
wined3d_gl_info
*
gl_info
,
struct
color_fixup_desc
fixup
)
{
enum
complex_fixup
complex_fixup
;
if
(
TRACE_ON
(
d3d_surface
)
&&
TRACE_ON
(
d3d
))
{
TRACE
(
"Checking support for fixup:
\n
"
);
...
...
@@ -5221,6 +5223,13 @@ static BOOL ffp_blit_color_fixup_supported(struct color_fixup_desc fixup)
return
TRUE
;
}
complex_fixup
=
get_complex_fixup
(
fixup
);
if
(
complex_fixup
==
COMPLEX_FIXUP_P8
&&
gl_info
->
supported
[
EXT_PALETTED_TEXTURE
])
{
TRACE
(
"P8 fixup supported
\n
"
);
return
TRUE
;
}
TRACE
(
"[FAILED]
\n
"
);
return
FALSE
;
}
...
...
dlls/wined3d/utils.c
View file @
27a96e47
...
...
@@ -1098,8 +1098,11 @@ static void apply_format_fixups(struct wined3d_gl_info *gl_info)
gl_info
->
gl_formats
[
idx
].
heightscale
=
1
.
5
f
;
gl_info
->
gl_formats
[
idx
].
color_fixup
=
create_complex_fixup_desc
(
COMPLEX_FIXUP_YV12
);
idx
=
getFmtIdx
(
WINED3DFMT_P8_UINT
);
gl_info
->
gl_formats
[
idx
].
color_fixup
=
create_complex_fixup_desc
(
COMPLEX_FIXUP_P8
);
if
(
gl_info
->
supported
[
EXT_PALETTED_TEXTURE
]
||
gl_info
->
supported
[
ARB_FRAGMENT_PROGRAM
])
{
idx
=
getFmtIdx
(
WINED3DFMT_P8_UINT
);
gl_info
->
gl_formats
[
idx
].
color_fixup
=
create_complex_fixup_desc
(
COMPLEX_FIXUP_P8
);
}
if
(
gl_info
->
supported
[
ARB_VERTEX_ARRAY_BGRA
])
{
...
...
dlls/wined3d/wined3d_private.h
View file @
27a96e47
...
...
@@ -1169,7 +1169,7 @@ struct blit_shader
HRESULT
(
*
set_shader
)(
IWineD3DDevice
*
iface
,
const
struct
GlPixelFormatDesc
*
format_desc
,
GLenum
textype
,
UINT
width
,
UINT
height
);
void
(
*
unset_shader
)(
IWineD3DDevice
*
iface
);
BOOL
(
*
color_fixup_supported
)(
struct
color_fixup_desc
fixup
);
BOOL
(
*
color_fixup_supported
)(
const
struct
wined3d_gl_info
*
gl_info
,
struct
color_fixup_desc
fixup
);
};
extern
const
struct
blit_shader
ffp_blit
DECLSPEC_HIDDEN
;
...
...
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