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
60c6294f
Commit
60c6294f
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: Move Q8W8V8U8 conversion to the format table.
parent
d7e1b973
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
28 deletions
+24
-28
surface.c
dlls/wined3d/surface.c
+0
-26
utils.c
dlls/wined3d/utils.c
+24
-2
No files found.
dlls/wined3d/surface.c
View file @
60c6294f
...
...
@@ -2261,12 +2261,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
}
break
;
case
WINED3DFMT_R8G8B8A8_SNORM
:
if
(
gl_info
->
supported
[
NV_TEXTURE_SHADER
])
break
;
*
convert
=
CONVERT_Q8W8V8U8
;
desc
->
conv_byte_count
=
4
;
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
...
...
@@ -2563,26 +2557,6 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI
}
break
;
case
CONVERT_Q8W8V8U8
:
{
unsigned
int
x
,
y
;
const
DWORD
*
Source
;
unsigned
char
*
Dest
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
Source
=
(
const
DWORD
*
)(
src
+
y
*
pitch
);
Dest
=
dst
+
y
*
outpitch
;
for
(
x
=
0
;
x
<
width
;
x
++
)
{
long
color
=
(
*
Source
++
);
/* B */
Dest
[
0
]
=
((
color
>>
16
)
&
0xff
)
+
128
;
/* W */
/* G */
Dest
[
1
]
=
((
color
>>
8
)
&
0xff
)
+
128
;
/* V */
/* R */
Dest
[
2
]
=
(
color
&
0xff
)
+
128
;
/* U */
/* A */
Dest
[
3
]
=
((
color
>>
24
)
&
0xff
)
+
128
;
/* Q */
Dest
+=
4
;
}
}
break
;
}
case
CONVERT_L6V5U5
:
{
unsigned
int
x
,
y
;
...
...
dlls/wined3d/utils.c
View file @
60c6294f
...
...
@@ -263,6 +263,28 @@ static void convert_r8g8_snorm(const BYTE *src, BYTE *dst, UINT pitch, UINT widt
}
}
static
void
convert_r8g8b8a8_snorm
(
const
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
)
{
unsigned
int
x
,
y
;
const
DWORD
*
Source
;
unsigned
char
*
Dest
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
Source
=
(
const
DWORD
*
)(
src
+
y
*
pitch
);
Dest
=
dst
+
y
*
pitch
;
for
(
x
=
0
;
x
<
width
;
x
++
)
{
long
color
=
(
*
Source
++
);
/* B */
Dest
[
0
]
=
((
color
>>
16
)
&
0xff
)
+
128
;
/* W */
/* G */
Dest
[
1
]
=
((
color
>>
8
)
&
0xff
)
+
128
;
/* V */
/* R */
Dest
[
2
]
=
(
color
&
0xff
)
+
128
;
/* U */
/* A */
Dest
[
3
]
=
((
color
>>
24
)
&
0xff
)
+
128
;
/* Q */
Dest
+=
4
;
}
}
}
static
void
convert_r16g16_snorm
(
const
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
)
{
unsigned
int
x
,
y
;
...
...
@@ -493,9 +515,9 @@ static const struct wined3d_format_texture_info format_texture_info[] =
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
NV_TEXTURE_SHADER
,
NULL
},
{
WINED3DFMT_R8G8B8A8_SNORM
,
GL_RGBA8
,
GL_RGBA8
,
0
,
GL_BGRA
,
GL_UNSIGNED_BYTE
,
0
,
GL_BGRA
,
GL_UNSIGNED_BYTE
,
4
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
WINED3D_GL_EXT_NONE
,
NULL
},
WINED3D_GL_EXT_NONE
,
&
convert_r8g8b8a8_snorm
},
{
WINED3DFMT_R8G8B8A8_SNORM
,
GL_SIGNED_RGBA8_NV
,
GL_SIGNED_RGBA8_NV
,
0
,
GL_RGBA
,
GL_BYTE
,
0
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
...
...
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