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
d7e1b973
Commit
d7e1b973
authored
Apr 08, 2010
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Apr 09, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Start moving texture format fixups to the formats table.
parent
a4559e76
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
51 deletions
+18
-51
surface.c
dlls/wined3d/surface.c
+17
-51
utils.c
dlls/wined3d/utils.c
+0
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/surface.c
View file @
d7e1b973
...
...
@@ -2235,12 +2235,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
}
break
;
case
WINED3DFMT_R8G8_SNORM
:
if
(
gl_info
->
supported
[
NV_TEXTURE_SHADER
])
break
;
*
convert
=
CONVERT_V8U8
;
desc
->
conv_byte_count
=
3
;
break
;
case
WINED3DFMT_R5G5_SNORM_L6_UNORM
:
*
convert
=
CONVERT_L6V5U5
;
if
(
gl_info
->
supported
[
NV_TEXTURE_SHADER
])
...
...
@@ -2273,12 +2267,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
desc
->
conv_byte_count
=
4
;
break
;
case
WINED3DFMT_R16G16_SNORM
:
if
(
gl_info
->
supported
[
NV_TEXTURE_SHADER
])
break
;
*
convert
=
CONVERT_V16U16
;
desc
->
conv_byte_count
=
6
;
break
;
case
WINED3DFMT_L4A4_UNORM
:
/* WINED3DFMT_L4A4_UNORM exists as an internal gl format, but for some reason there is not
* format+type combination to load it. Thus convert it to A8L8, then load it
...
...
@@ -2575,44 +2563,6 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI
}
break
;
case
CONVERT_V8U8
:
{
unsigned
int
x
,
y
;
const
short
*
Source
;
unsigned
char
*
Dest
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
Source
=
(
const
short
*
)(
src
+
y
*
pitch
);
Dest
=
dst
+
y
*
outpitch
;
for
(
x
=
0
;
x
<
width
;
x
++
)
{
long
color
=
(
*
Source
++
);
/* B */
Dest
[
0
]
=
0xff
;
/* G */
Dest
[
1
]
=
(
color
>>
8
)
+
128
;
/* V */
/* R */
Dest
[
2
]
=
(
color
)
+
128
;
/* U */
Dest
+=
3
;
}
}
break
;
}
case
CONVERT_V16U16
:
{
unsigned
int
x
,
y
;
const
DWORD
*
Source
;
unsigned
short
*
Dest
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
Source
=
(
const
DWORD
*
)(
src
+
y
*
pitch
);
Dest
=
(
unsigned
short
*
)
(
dst
+
y
*
outpitch
);
for
(
x
=
0
;
x
<
width
;
x
++
)
{
DWORD
color
=
(
*
Source
++
);
/* B */
Dest
[
0
]
=
0xffff
;
/* G */
Dest
[
1
]
=
(
color
>>
16
)
+
32768
;
/* V */
/* R */
Dest
[
2
]
=
(
color
)
+
32768
;
/* U */
Dest
+=
3
;
}
}
break
;
}
case
CONVERT_Q8W8V8U8
:
{
unsigned
int
x
,
y
;
...
...
@@ -4890,7 +4840,23 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D
surface_remove_pbo
(
This
,
gl_info
);
}
if
((
convert
!=
NO_CONVERSION
)
&&
This
->
resource
.
allocatedMemory
)
{
if
(
desc
.
convert
)
{
/* This code is entered for texture formats which need a fixup. */
int
height
=
This
->
currentDesc
.
Height
;
/* Stick to the alignment for the converted surface too, makes it easier to load the surface */
outpitch
=
width
*
desc
.
conv_byte_count
;
outpitch
=
(
outpitch
+
device
->
surface_alignment
-
1
)
&
~
(
device
->
surface_alignment
-
1
);
mem
=
HeapAlloc
(
GetProcessHeap
(),
0
,
outpitch
*
height
);
if
(
!
mem
)
{
ERR
(
"Out of memory %d, %d!
\n
"
,
outpitch
,
height
);
if
(
context
)
context_release
(
context
);
return
WINED3DERR_OUTOFVIDEOMEMORY
;
}
desc
.
convert
(
This
->
resource
.
allocatedMemory
,
mem
,
pitch
,
width
,
height
);
}
else
if
((
convert
!=
NO_CONVERSION
)
&&
This
->
resource
.
allocatedMemory
)
{
/* This code is only entered for color keying fixups */
int
height
=
This
->
currentDesc
.
Height
;
/* Stick to the alignment for the converted surface too, makes it easier to load the surface */
...
...
dlls/wined3d/utils.c
View file @
d7e1b973
This diff is collapsed.
Click to expand it.
dlls/wined3d/wined3d_private.h
View file @
d7e1b973
...
...
@@ -3011,6 +3011,7 @@ struct wined3d_format_desc
unsigned
int
Flags
;
float
heightscale
;
struct
color_fixup_desc
color_fixup
;
void
(
*
convert
)(
const
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
);
};
const
struct
wined3d_format_desc
*
getFormatDescEntry
(
WINED3DFORMAT
fmt
,
...
...
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