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
3a7df733
Commit
3a7df733
authored
Feb 21, 2017
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store used pixel shader input registers as a bitmap (AFL).
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7ad37a64
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
24 deletions
+12
-24
glsl_shader.c
dlls/wined3d/glsl_shader.c
+3
-8
shader.c
dlls/wined3d/shader.c
+8
-15
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/glsl_shader.c
View file @
3a7df733
...
...
@@ -1856,11 +1856,11 @@ static BOOL glsl_is_color_reg_read(const struct wined3d_shader *shader, unsigned
{
const
struct
wined3d_shader_signature
*
input_signature
=
&
shader
->
input_signature
;
const
struct
wined3d_shader_reg_maps
*
reg_maps
=
&
shader
->
reg_maps
;
const
BOOL
*
input_reg_used
=
shader
->
u
.
ps
.
input_reg_used
;
DWORD
input_reg_used
=
shader
->
u
.
ps
.
input_reg_used
;
unsigned
int
i
;
if
(
reg_maps
->
shader_version
.
major
<
3
)
return
input_reg_used
[
idx
]
;
return
input_reg_used
&
(
1u
<<
idx
)
;
for
(
i
=
0
;
i
<
input_signature
->
element_count
;
++
i
)
{
...
...
@@ -1871,12 +1871,7 @@ static BOOL glsl_is_color_reg_read(const struct wined3d_shader *shader, unsigned
if
(
shader_match_semantic
(
input
->
semantic_name
,
WINED3D_DECL_USAGE_COLOR
)
&&
input
->
semantic_idx
==
idx
)
{
if
(
input_reg_used
[
input
->
register_idx
])
return
TRUE
;
else
return
FALSE
;
}
return
input_reg_used
&
(
1u
<<
input
->
register_idx
);
}
return
FALSE
;
}
...
...
dlls/wined3d/shader.c
View file @
3a7df733
...
...
@@ -709,21 +709,14 @@ static BOOL shader_record_register_usage(struct wined3d_shader *shader, struct w
case
WINED3DSPR_INPUT
:
if
(
shader_type
==
WINED3D_SHADER_TYPE_PIXEL
)
{
/* If relative addressing is used, we must assume that all
* registers are used. Even if it is a construct like v3[aL],
* we can't assume that v0, v1 and v2 aren't read because aL
* can be negative. */
if
(
reg
->
idx
[
0
].
rel_addr
)
{
/* If relative addressing is used, we must assume that all registers
* are used. Even if it is a construct like v3[aL], we can't assume
* that v0, v1 and v2 aren't read because aL can be negative */
unsigned
int
i
;
for
(
i
=
0
;
i
<
MAX_REG_INPUT
;
++
i
)
{
shader
->
u
.
ps
.
input_reg_used
[
i
]
=
TRUE
;
}
}
shader
->
u
.
ps
.
input_reg_used
=
~
0u
;
else
{
shader
->
u
.
ps
.
input_reg_used
[
reg
->
idx
[
0
].
offset
]
=
TRUE
;
}
shader
->
u
.
ps
.
input_reg_used
|=
1u
<<
reg
->
idx
[
0
].
offset
;
}
else
reg_maps
->
input_registers
|=
1u
<<
reg
->
idx
[
0
].
offset
;
...
...
@@ -3493,7 +3486,7 @@ static HRESULT pixel_shader_init(struct wined3d_shader *shader, struct wined3d_d
for
(
i
=
0
;
i
<
MAX_REG_INPUT
;
++
i
)
{
if
(
shader
->
u
.
ps
.
input_reg_used
[
i
]
)
if
(
shader
->
u
.
ps
.
input_reg_used
&
(
1u
<<
i
)
)
{
++
num_regs_used
;
highest_reg_used
=
i
;
...
...
@@ -3526,7 +3519,7 @@ static HRESULT pixel_shader_init(struct wined3d_shader *shader, struct wined3d_d
shader
->
u
.
ps
.
declared_in_count
=
0
;
for
(
i
=
0
;
i
<
MAX_REG_INPUT
;
++
i
)
{
if
(
shader
->
u
.
ps
.
input_reg_used
[
i
]
)
if
(
shader
->
u
.
ps
.
input_reg_used
&
(
1u
<<
i
)
)
shader
->
u
.
ps
.
input_reg_map
[
i
]
=
shader
->
u
.
ps
.
declared_in_count
++
;
else
shader
->
u
.
ps
.
input_reg_map
[
i
]
=
~
0U
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
3a7df733
...
...
@@ -3572,7 +3572,7 @@ struct wined3d_pixel_shader
{
/* Pixel shader input semantics */
DWORD
input_reg_map
[
MAX_REG_INPUT
];
BOOL
input_reg_used
[
MAX_REG_INPUT
];
DWORD
input_reg_used
;
/* MAX_REG_INPUT, 32 */
unsigned
int
declared_in_count
;
/* Some information about the shader behavior */
...
...
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