Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
19a532ca
Commit
19a532ca
authored
Sep 10, 2018
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Derive format component counts from the component info.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9781ef76
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
38 deletions
+40
-38
utils.c
dlls/wined3d/utils.c
+39
-37
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/utils.c
View file @
19a532ca
...
...
@@ -600,48 +600,47 @@ struct wined3d_format_vertex_info
{
enum
wined3d_format_id
id
;
enum
wined3d_ffp_emit_idx
emit_idx
;
unsigned
int
component_count
;
GLenum
gl_vtx_type
;
enum
wined3d_gl_extension
extension
;
};
static
const
struct
wined3d_format_vertex_info
format_vertex_info
[]
=
{
{
WINED3DFMT_R32_FLOAT
,
WINED3D_FFP_EMIT_FLOAT1
,
1
,
GL_FLOAT
},
{
WINED3DFMT_R32G32_FLOAT
,
WINED3D_FFP_EMIT_FLOAT2
,
2
,
GL_FLOAT
},
{
WINED3DFMT_R32G32B32_FLOAT
,
WINED3D_FFP_EMIT_FLOAT3
,
3
,
GL_FLOAT
},
{
WINED3DFMT_R32G32B32A32_FLOAT
,
WINED3D_FFP_EMIT_FLOAT4
,
4
,
GL_FLOAT
},
{
WINED3DFMT_B8G8R8A8_UNORM
,
WINED3D_FFP_EMIT_D3DCOLOR
,
4
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_R8G8B8A8_UINT
,
WINED3D_FFP_EMIT_UBYTE4
,
4
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_R16G16_UINT
,
WINED3D_FFP_EMIT_INVALID
,
2
,
GL_UNSIGNED_SHORT
},
{
WINED3DFMT_R16G16_SINT
,
WINED3D_FFP_EMIT_SHORT2
,
2
,
GL_SHORT
},
{
WINED3DFMT_R16G16B16A16_SINT
,
WINED3D_FFP_EMIT_SHORT4
,
4
,
GL_SHORT
},
{
WINED3DFMT_R8G8B8A8_UNORM
,
WINED3D_FFP_EMIT_UBYTE4N
,
4
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_R16G16_SNORM
,
WINED3D_FFP_EMIT_SHORT2N
,
2
,
GL_SHORT
},
{
WINED3DFMT_R16G16B16A16_SNORM
,
WINED3D_FFP_EMIT_SHORT4N
,
4
,
GL_SHORT
},
{
WINED3DFMT_R16G16_UNORM
,
WINED3D_FFP_EMIT_USHORT2N
,
2
,
GL_UNSIGNED_SHORT
},
{
WINED3DFMT_R16G16B16A16_UNORM
,
WINED3D_FFP_EMIT_USHORT4N
,
4
,
GL_UNSIGNED_SHORT
},
{
WINED3DFMT_R10G10B10X2_UINT
,
WINED3D_FFP_EMIT_UDEC3
,
3
,
GL_UNSIGNED_SHORT
},
{
WINED3DFMT_R10G10B10X2_SNORM
,
WINED3D_FFP_EMIT_DEC3N
,
3
,
GL_SHORT
},
{
WINED3DFMT_R10G10B10A2_UNORM
,
WINED3D_FFP_EMIT_INVALID
,
4
,
GL_UNSIGNED_INT_2_10_10_10_REV
,
{
WINED3DFMT_R32_FLOAT
,
WINED3D_FFP_EMIT_FLOAT1
,
GL_FLOAT
},
{
WINED3DFMT_R32G32_FLOAT
,
WINED3D_FFP_EMIT_FLOAT2
,
GL_FLOAT
},
{
WINED3DFMT_R32G32B32_FLOAT
,
WINED3D_FFP_EMIT_FLOAT3
,
GL_FLOAT
},
{
WINED3DFMT_R32G32B32A32_FLOAT
,
WINED3D_FFP_EMIT_FLOAT4
,
GL_FLOAT
},
{
WINED3DFMT_B8G8R8A8_UNORM
,
WINED3D_FFP_EMIT_D3DCOLOR
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_R8G8B8A8_UINT
,
WINED3D_FFP_EMIT_UBYTE4
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_R16G16_UINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_UNSIGNED_SHORT
},
{
WINED3DFMT_R16G16_SINT
,
WINED3D_FFP_EMIT_SHORT2
,
GL_SHORT
},
{
WINED3DFMT_R16G16B16A16_SINT
,
WINED3D_FFP_EMIT_SHORT4
,
GL_SHORT
},
{
WINED3DFMT_R8G8B8A8_UNORM
,
WINED3D_FFP_EMIT_UBYTE4N
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_R16G16_SNORM
,
WINED3D_FFP_EMIT_SHORT2N
,
GL_SHORT
},
{
WINED3DFMT_R16G16B16A16_SNORM
,
WINED3D_FFP_EMIT_SHORT4N
,
GL_SHORT
},
{
WINED3DFMT_R16G16_UNORM
,
WINED3D_FFP_EMIT_USHORT2N
,
GL_UNSIGNED_SHORT
},
{
WINED3DFMT_R16G16B16A16_UNORM
,
WINED3D_FFP_EMIT_USHORT4N
,
GL_UNSIGNED_SHORT
},
{
WINED3DFMT_R10G10B10X2_UINT
,
WINED3D_FFP_EMIT_UDEC3
,
GL_UNSIGNED_SHORT
},
{
WINED3DFMT_R10G10B10X2_SNORM
,
WINED3D_FFP_EMIT_DEC3N
,
GL_SHORT
},
{
WINED3DFMT_R10G10B10A2_UNORM
,
WINED3D_FFP_EMIT_INVALID
,
GL_UNSIGNED_INT_2_10_10_10_REV
,
ARB_VERTEX_TYPE_2_10_10_10_REV
},
{
WINED3DFMT_R16G16_FLOAT
,
WINED3D_FFP_EMIT_FLOAT16_2
,
2
,
GL_HALF_FLOAT
},
{
WINED3DFMT_R16G16B16A16_FLOAT
,
WINED3D_FFP_EMIT_FLOAT16_4
,
4
,
GL_HALF_FLOAT
},
{
WINED3DFMT_R8G8B8A8_SNORM
,
WINED3D_FFP_EMIT_INVALID
,
4
,
GL_BYTE
},
{
WINED3DFMT_R8G8B8A8_SINT
,
WINED3D_FFP_EMIT_INVALID
,
4
,
GL_BYTE
},
{
WINED3DFMT_R16G16B16A16_UINT
,
WINED3D_FFP_EMIT_INVALID
,
4
,
GL_UNSIGNED_SHORT
},
{
WINED3DFMT_R8_UNORM
,
WINED3D_FFP_EMIT_INVALID
,
1
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_R8_UINT
,
WINED3D_FFP_EMIT_INVALID
,
1
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_R8_SINT
,
WINED3D_FFP_EMIT_INVALID
,
1
,
GL_BYTE
},
{
WINED3DFMT_R16_UINT
,
WINED3D_FFP_EMIT_INVALID
,
1
,
GL_UNSIGNED_SHORT
},
{
WINED3DFMT_R16_SINT
,
WINED3D_FFP_EMIT_INVALID
,
1
,
GL_SHORT
},
{
WINED3DFMT_R32_UINT
,
WINED3D_FFP_EMIT_INVALID
,
1
,
GL_UNSIGNED_INT
},
{
WINED3DFMT_R32_SINT
,
WINED3D_FFP_EMIT_INVALID
,
1
,
GL_INT
},
{
WINED3DFMT_R32G32_UINT
,
WINED3D_FFP_EMIT_INVALID
,
2
,
GL_UNSIGNED_INT
},
{
WINED3DFMT_R32G32_SINT
,
WINED3D_FFP_EMIT_INVALID
,
2
,
GL_INT
},
{
WINED3DFMT_R32G32B32_UINT
,
WINED3D_FFP_EMIT_INVALID
,
3
,
GL_UNSIGNED_INT
},
{
WINED3DFMT_R32G32B32A32_UINT
,
WINED3D_FFP_EMIT_INVALID
,
4
,
GL_UNSIGNED_INT
},
{
WINED3DFMT_R32G32B32A32_SINT
,
WINED3D_FFP_EMIT_INVALID
,
4
,
GL_INT
},
{
WINED3DFMT_R16G16_FLOAT
,
WINED3D_FFP_EMIT_FLOAT16_2
,
GL_HALF_FLOAT
},
{
WINED3DFMT_R16G16B16A16_FLOAT
,
WINED3D_FFP_EMIT_FLOAT16_4
,
GL_HALF_FLOAT
},
{
WINED3DFMT_R8G8B8A8_SNORM
,
WINED3D_FFP_EMIT_INVALID
,
GL_BYTE
},
{
WINED3DFMT_R8G8B8A8_SINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_BYTE
},
{
WINED3DFMT_R16G16B16A16_UINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_UNSIGNED_SHORT
},
{
WINED3DFMT_R8_UNORM
,
WINED3D_FFP_EMIT_INVALID
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_R8_UINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_R8_SINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_BYTE
},
{
WINED3DFMT_R16_UINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_UNSIGNED_SHORT
},
{
WINED3DFMT_R16_SINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_SHORT
},
{
WINED3DFMT_R32_UINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_UNSIGNED_INT
},
{
WINED3DFMT_R32_SINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_INT
},
{
WINED3DFMT_R32G32_UINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_UNSIGNED_INT
},
{
WINED3DFMT_R32G32_SINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_INT
},
{
WINED3DFMT_R32G32B32_UINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_UNSIGNED_INT
},
{
WINED3DFMT_R32G32B32A32_UINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_UNSIGNED_INT
},
{
WINED3DFMT_R32G32B32A32_SINT
,
WINED3D_FFP_EMIT_INVALID
,
GL_INT
},
};
struct
wined3d_format_texture_info
...
...
@@ -2038,6 +2037,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
typed_formats
);
++
i
)
{
const
struct
wined3d_format
*
typeless_format
;
unsigned
int
component_count
=
0
;
DWORD
flags
=
0
;
if
(
!
(
format
=
get_format_internal
(
adapter
,
typed_formats
[
i
].
id
)))
...
...
@@ -2073,6 +2073,8 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter)
flags
|=
WINED3DFMT_FLAG_INTEGER
;
if
(
channel_type
==
WINED3D_CHANNEL_TYPE_FLOAT
)
flags
|=
WINED3DFMT_FLAG_FLOAT
;
if
(
channel_type
!=
WINED3D_CHANNEL_TYPE_UNUSED
)
++
component_count
;
if
(
channel_type
==
WINED3D_CHANNEL_TYPE_DEPTH
&&
!
format
->
depth_size
)
{
...
...
@@ -2081,6 +2083,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter)
}
}
format
->
component_count
=
component_count
;
format_set_flag
(
format
,
flags
);
}
...
...
@@ -3683,9 +3686,8 @@ static BOOL init_format_vertex_info(const struct wined3d_adapter *adapter,
continue
;
format
->
emit_idx
=
format_vertex_info
[
i
].
emit_idx
;
format
->
component_count
=
format_vertex_info
[
i
].
component_count
;
format
->
gl_vtx_type
=
format_vertex_info
[
i
].
gl_vtx_type
;
format
->
gl_vtx_format
=
format
_vertex_info
[
i
].
component_count
;
format
->
gl_vtx_format
=
format
->
component_count
;
}
return
TRUE
;
...
...
dlls/wined3d/wined3d_private.h
View file @
19a532ca
...
...
@@ -4326,6 +4326,7 @@ struct wined3d_format
enum
wined3d_format_id
id
;
D3DDDIFORMAT
ddi_format
;
unsigned
int
component_count
;
DWORD
red_size
;
DWORD
green_size
;
DWORD
blue_size
;
...
...
@@ -4343,7 +4344,6 @@ struct wined3d_format
UINT
block_byte_count
;
enum
wined3d_ffp_emit_idx
emit_idx
;
GLint
component_count
;
GLenum
gl_vtx_type
;
GLint
gl_vtx_format
;
...
...
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