Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
a0b56d9c
Commit
a0b56d9c
authored
11 years ago
by
Stefan Dösinger
Committed by
Alexandre Julliard
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
wined3d: Pass stream info and needed fixups to buffer_find_decl.
parent
66a4e6e3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/wined3d/buffer.c
+35
-28
35 additions, 28 deletions
dlls/wined3d/buffer.c
with
35 additions
and
28 deletions
dlls/wined3d/buffer.c
+
35
−
28
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 need
ed
\n
"
);
TRACE
(
"
No fixup requir
ed
.
\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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment