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
Lorenzo Ferrillo
wine
Commits
472fed41
Commit
472fed41
authored
13 years ago
by
Matteo Bruni
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
wined3d: Improve invalid TEXTURETRANSFORMFLAGS handling.
parent
9d662928
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/wined3d/shader.c
+32
-5
32 additions, 5 deletions
dlls/wined3d/shader.c
with
32 additions
and
5 deletions
dlls/wined3d/shader.c
+
32
−
5
View file @
472fed41
...
...
@@ -1911,20 +1911,46 @@ void find_ps_compile_args(const struct wined3d_state *state,
for
(
i
=
0
;
i
<
4
;
++
i
)
{
DWORD
flags
=
state
->
texture_states
[
i
][
WINED3DTSS_TEXTURETRANSFORMFLAGS
];
DWORD
count
,
tex_transform
;
DWORD
count
,
tex_transform
=
0
;
/* Filter some invalid flags */
count
=
flags
&
~
WINED3DTTFF_PROJECTED
;
if
(
count
>
WINED3DTTFF_COUNT4
)
if
(
count
>
WINED3DTTFF_COUNT4
||
(
!
(
flags
&
WINED3DTTFF_PROJECTED
)
&&
count
!=
0
)
)
{
WARN
(
"The application set an invalid TEXTURETRANSFORMFLAGS value.
\n
"
);
flags
=
count
=
0
;
WARN
(
"The application set an invalid
%#x
TEXTURETRANSFORMFLAGS value.
\n
"
,
flags
);
count
=
0
;
}
tex_transform
=
count
;
if
(
flags
&
WINED3DTTFF_PROJECTED
)
{
enum
wined3d_sampler_texture_type
sampler_type
=
shader
->
reg_maps
.
sampler_type
[
i
];
DWORD
max_valid
=
WINED3DTTFF_COUNT4
;
if
(
!
count
)
count
=
WINED3DTTFF_COUNT4
;
if
(
!
state
->
vertex_shader
)
{
unsigned
int
j
;
unsigned
int
index
=
state
->
texture_states
[
i
][
WINED3DTSS_TEXCOORDINDEX
];
for
(
j
=
0
;
j
<
state
->
vertex_declaration
->
element_count
;
++
j
)
{
struct
wined3d_vertex_declaration_element
*
element
=
&
state
->
vertex_declaration
->
elements
[
j
];
if
(
element
->
usage
==
WINED3DDECLUSAGE_TEXCOORD
&&
element
->
usage_idx
==
index
)
{
max_valid
=
element
->
format
->
component_count
;
break
;
}
}
}
tex_transform
=
min
(
count
,
max_valid
);
if
(
tex_transform
!=
(
flags
&
~
WINED3DTTFF_PROJECTED
))
WARN
(
"Fixing up %#x projected texture transform flag to %#x.
\n
"
,
flags
&
~
WINED3DTTFF_PROJECTED
,
tex_transform
);
if
((
sampler_type
==
WINED3DSTT_1D
&&
tex_transform
>
WINED3DTTFF_COUNT1
)
||
(
sampler_type
==
WINED3DSTT_2D
&&
tex_transform
>
WINED3DTTFF_COUNT2
)
...
...
@@ -1933,6 +1959,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
else
WARN
(
"Application requested projected texture with unsuitable texture coordinates.
\n
"
);
}
tex_transform
&=
WINED3D_PSARGS_TEXTRANSFORM_MASK
;
args
->
tex_transform
|=
tex_transform
<<
i
*
WINED3D_PSARGS_TEXTRANSFORM_SHIFT
;
}
}
...
...
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