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
1e968480
Commit
1e968480
authored
Dec 31, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a texture_binding_might_invalidate_ps() helper.
Make a complex conditional a bit easier to read.
parent
707198ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
9 deletions
+29
-9
cs.c
dlls/wined3d/cs.c
+29
-9
No files found.
dlls/wined3d/cs.c
View file @
1e968480
...
...
@@ -1454,6 +1454,34 @@ void wined3d_device_context_emit_set_constant_buffers(struct wined3d_device_cont
wined3d_device_context_submit
(
context
,
WINED3D_CS_QUEUE_DEFAULT
);
}
static
bool
texture_binding_might_invalidate_ps
(
struct
wined3d_texture
*
texture
,
struct
wined3d_texture
*
prev
,
const
struct
wined3d_d3d_info
*
d3d_info
)
{
const
struct
wined3d_format
*
old_format
,
*
new_format
;
unsigned
int
old_caps
,
new_caps
;
if
(
!
prev
)
return
true
;
if
(
wined3d_texture_gl
(
texture
)
->
target
!=
wined3d_texture_gl
(
prev
)
->
target
)
return
true
;
old_format
=
prev
->
resource
.
format
;
new_format
=
texture
->
resource
.
format
;
old_caps
=
prev
->
resource
.
format_caps
;
new_caps
=
texture
->
resource
.
format_caps
;
if
((
old_caps
&
WINED3D_FORMAT_CAP_SHADOW
)
!=
(
new_caps
&
WINED3D_FORMAT_CAP_SHADOW
))
return
true
;
if
(
is_same_fixup
(
old_format
->
color_fixup
,
new_format
->
color_fixup
))
return
false
;
if
(
can_use_texture_swizzle
(
d3d_info
,
new_format
)
&&
can_use_texture_swizzle
(
d3d_info
,
old_format
))
return
false
;
return
true
;
}
static
void
wined3d_cs_exec_set_texture
(
struct
wined3d_cs
*
cs
,
const
void
*
data
)
{
const
struct
wined3d_d3d_info
*
d3d_info
=
&
cs
->
c
.
device
->
adapter
->
d3d_info
;
...
...
@@ -1466,18 +1494,10 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
if
(
op
->
texture
)
{
const
struct
wined3d_format
*
new_format
=
op
->
texture
->
resource
.
format
;
const
struct
wined3d_format
*
old_format
=
prev
?
prev
->
resource
.
format
:
NULL
;
unsigned
int
old_fmt_caps
=
prev
?
prev
->
resource
.
format_caps
:
0
;
unsigned
int
new_fmt_caps
=
op
->
texture
->
resource
.
format_caps
;
if
(
InterlockedIncrement
(
&
op
->
texture
->
resource
.
bind_count
)
==
1
)
op
->
texture
->
sampler
=
op
->
stage
;
if
(
!
prev
||
wined3d_texture_gl
(
op
->
texture
)
->
target
!=
wined3d_texture_gl
(
prev
)
->
target
||
(
!
is_same_fixup
(
new_format
->
color_fixup
,
old_format
->
color_fixup
)
&&
!
(
can_use_texture_swizzle
(
d3d_info
,
new_format
)
&&
can_use_texture_swizzle
(
d3d_info
,
old_format
)))
||
(
new_fmt_caps
&
WINED3D_FORMAT_CAP_SHADOW
)
!=
(
old_fmt_caps
&
WINED3D_FORMAT_CAP_SHADOW
))
if
(
texture_binding_might_invalidate_ps
(
op
->
texture
,
prev
,
d3d_info
))
device_invalidate_state
(
cs
->
c
.
device
,
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
));
if
(
!
prev
&&
op
->
stage
<
d3d_info
->
ffp_fragment_caps
.
max_blend_stages
)
...
...
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