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
a0b56d9c
Commit
a0b56d9c
authored
Sep 12, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass stream info and needed fixups to buffer_find_decl.
parent
66a4e6e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
28 deletions
+35
-28
buffer.c
dlls/wined3d/buffer.c
+35
-28
No files found.
dlls/wined3d/buffer.c
View file @
a0b56d9c
...
...
@@ -269,9 +269,11 @@ static BOOL buffer_process_converted_attribute(struct wined3d_buffer *This,
return
ret
;
}
#define WINED3D_BUFFER_FIXUP_D3DCOLOR 0x01
#define WINED3D_BUFFER_FIXUP_XYZRHW 0x02
static
BOOL
buffer_check_attribute
(
struct
wined3d_buffer
*
This
,
const
struct
wined3d_stream_info
*
si
,
UINT
attrib_idx
,
const
BOOL
check_d3dcolor
,
const
BOOL
check_position
,
const
BOOL
is_ffp_color
,
DWORD
*
stride_this_run
)
UINT
attrib_idx
,
DWORD
fixup_flags
,
DWORD
*
stride_this_run
)
{
const
struct
wined3d_stream_info_element
*
attrib
=
&
si
->
elements
[
attrib_idx
];
enum
wined3d_format_id
format
;
...
...
@@ -286,13 +288,11 @@ static BOOL buffer_check_attribute(struct wined3d_buffer *This, const struct win
format
=
attrib
->
format
->
id
;
/* Look for newly appeared conversion */
if
(
check_d3dcolor
&&
format
==
WINED3DFMT_B8G8R8A8_UNORM
)
if
(
fixup_flags
&
WINED3D_BUFFER_FIXUP_D3DCOLOR
&&
format
==
WINED3DFMT_B8G8R8A8_UNORM
)
{
ret
=
buffer_process_converted_attribute
(
This
,
CONV_D3DCOLOR
,
attrib
,
stride_this_run
);
if
(
!
is_ffp_color
)
FIXME
(
"Test for non-color fixed function WINED3DFMT_B8G8R8A8_UNORM format
\n
"
);
}
else
if
(
check_position
&&
si
->
position_transformed
)
else
if
(
fixup_flags
&
WINED3D_BUFFER_FIXUP_XYZRHW
&&
si
->
position_transformed
)
{
if
(
format
!=
WINED3DFMT_R32G32B32A32_FLOAT
)
{
...
...
@@ -310,14 +310,9 @@ static BOOL buffer_check_attribute(struct wined3d_buffer *This, const struct win
return
ret
;
}
static
BOOL
buffer_find_decl
(
struct
wined3d_buffer
*
This
)
static
BOOL
buffer_find_decl
(
struct
wined3d_buffer
*
This
,
const
struct
wined3d_stream_info
*
si
,
DWORD
fixup_flags
)
{
struct
wined3d_device
*
device
=
This
->
resource
.
device
;
const
struct
wined3d_adapter
*
adapter
=
device
->
adapter
;
const
struct
wined3d_stream_info
*
si
=
&
device
->
stream_info
;
const
struct
wined3d_state
*
state
=
&
device
->
state
;
BOOL
support_d3dcolor
=
adapter
->
gl_info
.
supported
[
ARB_VERTEX_ARRAY_BGRA
];
BOOL
support_xyzrhw
=
adapter
->
d3d_info
.
xyzrhw
;
UINT
stride_this_run
=
0
;
BOOL
ret
=
FALSE
;
...
...
@@ -330,9 +325,9 @@ static BOOL buffer_find_decl(struct wined3d_buffer *This)
if
(
This
->
resource
.
usage
&
WINED3DUSAGE_STATICDECL
)
return
FALSE
;
}
if
(
use_vs
(
state
)
)
if
(
!
fixup_flags
)
{
TRACE
(
"
Vertex shaders used, no VBO conversion is needed
\n
"
);
TRACE
(
"
No fixup required.
\n
"
);
if
(
This
->
conversion_map
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
conversion_map
);
...
...
@@ -391,29 +386,31 @@ static BOOL buffer_find_decl(struct wined3d_buffer *This)
*/
ret
=
buffer_check_attribute
(
This
,
si
,
WINED3D_FFP_POSITION
,
TRUE
,
!
support_xyzrhw
,
FALSE
,
&
stride_this_run
)
||
ret
;
fixup_flags
,
&
stride_this_run
)
||
ret
;
fixup_flags
&=
~
WINED3D_BUFFER_FIXUP_XYZRHW
;
ret
=
buffer_check_attribute
(
This
,
si
,
WINED3D_FFP_NORMAL
,
TRUE
,
FALSE
,
FALSE
,
&
stride_this_run
)
||
ret
;
fixup_flags
,
&
stride_this_run
)
||
ret
;
ret
=
buffer_check_attribute
(
This
,
si
,
WINED3D_FFP_DIFFUSE
,
!
support_d3dcolor
,
FALSE
,
TRUE
,
&
stride_this_run
)
||
ret
;
fixup_flags
,
&
stride_this_run
)
||
ret
;
ret
=
buffer_check_attribute
(
This
,
si
,
WINED3D_FFP_SPECULAR
,
!
support_d3dcolor
,
FALSE
,
TRUE
,
&
stride_this_run
)
||
ret
;
fixup_flags
,
&
stride_this_run
)
||
ret
;
ret
=
buffer_check_attribute
(
This
,
si
,
WINED3D_FFP_TEXCOORD0
,
TRUE
,
FALSE
,
FALSE
,
&
stride_this_run
)
||
ret
;
fixup_flags
,
&
stride_this_run
)
||
ret
;
ret
=
buffer_check_attribute
(
This
,
si
,
WINED3D_FFP_TEXCOORD1
,
TRUE
,
FALSE
,
FALSE
,
&
stride_this_run
)
||
ret
;
fixup_flags
,
&
stride_this_run
)
||
ret
;
ret
=
buffer_check_attribute
(
This
,
si
,
WINED3D_FFP_TEXCOORD2
,
TRUE
,
FALSE
,
FALSE
,
&
stride_this_run
)
||
ret
;
fixup_flags
,
&
stride_this_run
)
||
ret
;
ret
=
buffer_check_attribute
(
This
,
si
,
WINED3D_FFP_TEXCOORD3
,
TRUE
,
FALSE
,
FALSE
,
&
stride_this_run
)
||
ret
;
fixup_flags
,
&
stride_this_run
)
||
ret
;
ret
=
buffer_check_attribute
(
This
,
si
,
WINED3D_FFP_TEXCOORD4
,
TRUE
,
FALSE
,
FALSE
,
&
stride_this_run
)
||
ret
;
fixup_flags
,
&
stride_this_run
)
||
ret
;
ret
=
buffer_check_attribute
(
This
,
si
,
WINED3D_FFP_TEXCOORD5
,
TRUE
,
FALSE
,
FALSE
,
&
stride_this_run
)
||
ret
;
fixup_flags
,
&
stride_this_run
)
||
ret
;
ret
=
buffer_check_attribute
(
This
,
si
,
WINED3D_FFP_TEXCOORD6
,
TRUE
,
FALSE
,
FALSE
,
&
stride_this_run
)
||
ret
;
fixup_flags
,
&
stride_this_run
)
||
ret
;
ret
=
buffer_check_attribute
(
This
,
si
,
WINED3D_FFP_TEXCOORD7
,
TRUE
,
FALSE
,
FALSE
,
&
stride_this_run
)
||
ret
;
fixup_flags
,
&
stride_this_run
)
||
ret
;
if
(
!
stride_this_run
&&
This
->
conversion_map
)
{
...
...
@@ -769,7 +766,17 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte
/* Reading the declaration makes only sense if the stateblock is finalized and the buffer bound to a stream */
if
(
device
->
isInDraw
&&
buffer
->
resource
.
bind_count
>
0
)
{
decl_changed
=
buffer_find_decl
(
buffer
);
DWORD
fixup_flags
=
0
;
if
(
!
use_vs
(
&
device
->
state
))
{
if
(
!
context
->
gl_info
->
supported
[
ARB_VERTEX_ARRAY_BGRA
])
fixup_flags
|=
WINED3D_BUFFER_FIXUP_D3DCOLOR
;
if
(
!
context
->
d3d_info
->
xyzrhw
)
fixup_flags
|=
WINED3D_BUFFER_FIXUP_XYZRHW
;
}
decl_changed
=
buffer_find_decl
(
buffer
,
&
device
->
stream_info
,
fixup_flags
);
buffer
->
flags
|=
WINED3D_BUFFER_HASDESC
;
}
...
...
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