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
cda78c01
Commit
cda78c01
authored
Apr 14, 2010
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Apr 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move G16R16/R16G16F conversion to the formats table.
parent
d8619de7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
41 deletions
+30
-41
surface.c
dlls/wined3d/surface.c
+0
-37
utils.c
dlls/wined3d/utils.c
+30
-4
No files found.
dlls/wined3d/surface.c
View file @
cda78c01
...
...
@@ -2134,7 +2134,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
{
BOOL
colorkey_active
=
need_alpha_ck
&&
(
This
->
CKeyFlags
&
WINEDDSD_CKSRCBLT
);
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
};
...
...
@@ -2233,17 +2232,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
desc
->
conv_byte_count
=
2
;
break
;
case
WINED3DFMT_R16G16_UNORM
:
*
convert
=
CONVERT_G16R16
;
desc
->
conv_byte_count
=
6
;
break
;
case
WINED3DFMT_R16G16_FLOAT
:
if
(
gl_info
->
supported
[
ARB_TEXTURE_RG
])
break
;
*
convert
=
CONVERT_R16G16F
;
desc
->
conv_byte_count
=
6
;
break
;
default:
break
;
}
...
...
@@ -2505,31 +2493,6 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI
break
;
}
case
CONVERT_G16R16
:
case
CONVERT_R16G16F
:
{
unsigned
int
x
,
y
;
const
WORD
*
Source
;
WORD
*
Dest
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
Source
=
(
const
WORD
*
)(
src
+
y
*
pitch
);
Dest
=
(
WORD
*
)
(
dst
+
y
*
outpitch
);
for
(
x
=
0
;
x
<
width
;
x
++
)
{
WORD
green
=
(
*
Source
++
);
WORD
red
=
(
*
Source
++
);
Dest
[
0
]
=
green
;
Dest
[
1
]
=
red
;
/* Strictly speaking not correct for R16G16F, but it doesn't matter because the
* shader overwrites it anyway
*/
Dest
[
2
]
=
0xffff
;
Dest
+=
3
;
}
}
break
;
}
default:
ERR
(
"Unsupported conversion type %#x.
\n
"
,
convert
);
}
...
...
dlls/wined3d/utils.c
View file @
cda78c01
...
...
@@ -417,6 +417,32 @@ static void convert_r16g16_snorm(const BYTE *src, BYTE *dst, UINT pitch, UINT wi
}
}
static
void
convert_r16g16
(
const
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
)
{
unsigned
int
x
,
y
;
const
WORD
*
Source
;
WORD
*
Dest
;
UINT
outpitch
=
(
pitch
*
3
)
/
2
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
Source
=
(
const
WORD
*
)(
src
+
y
*
pitch
);
Dest
=
(
WORD
*
)
(
dst
+
y
*
outpitch
);
for
(
x
=
0
;
x
<
width
;
x
++
)
{
WORD
green
=
(
*
Source
++
);
WORD
red
=
(
*
Source
++
);
Dest
[
0
]
=
green
;
Dest
[
1
]
=
red
;
/* Strictly speaking not correct for R16G16F, but it doesn't matter because the
* shader overwrites it anyway
*/
Dest
[
2
]
=
0xffff
;
Dest
+=
3
;
}
}
}
static
void
convert_r32g32_float
(
const
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
)
{
unsigned
int
x
,
y
;
...
...
@@ -582,9 +608,9 @@ static const struct wined3d_format_texture_info format_texture_info[] =
WINED3DFMT_FLAG_RENDERTARGET
,
ARB_TEXTURE_RG
,
NULL
},
{
WINED3DFMT_R16G16_FLOAT
,
GL_RGB16F_ARB
,
GL_RGB16F_ARB
,
0
,
GL_RGB
,
GL_HALF_FLOAT_ARB
,
0
,
GL_RGB
,
GL_HALF_FLOAT_ARB
,
6
,
WINED3DFMT_FLAG_RENDERTARGET
,
ARB_TEXTURE_FLOAT
,
NULL
},
ARB_TEXTURE_FLOAT
,
&
convert_r16g16
},
{
WINED3DFMT_R16G16_FLOAT
,
GL_RG16F
,
GL_RG16F
,
0
,
GL_RG
,
GL_HALF_FLOAT_ARB
,
0
,
WINED3DFMT_FLAG_RENDERTARGET
,
...
...
@@ -656,9 +682,9 @@ static const struct wined3d_format_texture_info format_texture_info[] =
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
WINED3D_GL_EXT_NONE
,
NULL
},
{
WINED3DFMT_R16G16_UNORM
,
GL_RGB16
,
GL_RGB16
,
GL_RGBA16
,
GL_RGB
,
GL_UNSIGNED_SHORT
,
0
,
GL_RGB
,
GL_UNSIGNED_SHORT
,
6
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
WINED3D_GL_EXT_NONE
,
NULL
},
WINED3D_GL_EXT_NONE
,
&
convert_r16g16
},
{
WINED3DFMT_B10G10R10A2_UNORM
,
GL_RGB10_A2
,
GL_RGB10_A2
,
0
,
GL_BGRA
,
GL_UNSIGNED_INT_2_10_10_10_REV
,
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