Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
vkd3d
Manage
Activity
Members
Labels
Plan
Wiki
Bugzilla
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
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
wine
vkd3d
Commits
eb04829e
Commit
eb04829e
authored
2 years ago
by
Elizabeth Figura
Committed by
Alexandre Julliard
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
vkd3d-shader/hlsl: Pass hlsl_constant_value and hlsl_type pointers to fold_cast().
parent
24d4ab7f
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!205
hlsl: Return hlsl_ir_node pointers from instruction constructors, part 5.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libs/vkd3d-shader/hlsl_constant_ops.c
+11
-10
11 additions, 10 deletions
libs/vkd3d-shader/hlsl_constant_ops.c
with
11 additions
and
10 deletions
libs/vkd3d-shader/hlsl_constant_ops.c
+
11
−
10
View file @
eb04829e
...
...
@@ -62,7 +62,8 @@ static bool fold_abs(struct hlsl_ctx *ctx, struct hlsl_ir_constant *dst, struct
return
true
;
}
static
bool
fold_cast
(
struct
hlsl_ctx
*
ctx
,
struct
hlsl_ir_constant
*
dst
,
struct
hlsl_ir_constant
*
src
)
static
bool
fold_cast
(
struct
hlsl_ctx
*
ctx
,
struct
hlsl_constant_value
*
dst
,
const
struct
hlsl_type
*
dst_type
,
const
struct
hlsl_ir_constant
*
src
)
{
unsigned
int
k
;
uint32_t
u
;
...
...
@@ -70,11 +71,11 @@ static bool fold_cast(struct hlsl_ctx *ctx, struct hlsl_ir_constant *dst, struct
double
d
;
float
f
;
if
(
dst
->
node
.
data
_type
->
dimx
!=
src
->
node
.
data_type
->
dimx
||
dst
->
node
.
data
_type
->
dimy
!=
src
->
node
.
data_type
->
dimy
)
if
(
dst_type
->
dimx
!=
src
->
node
.
data_type
->
dimx
||
dst_type
->
dimy
!=
src
->
node
.
data_type
->
dimy
)
{
FIXME
(
"Cast from %s to %s.
\n
"
,
debug_hlsl_type
(
ctx
,
src
->
node
.
data_type
),
debug_hlsl_type
(
ctx
,
dst
->
node
.
data
_type
));
debug_hlsl_type
(
ctx
,
dst_type
));
return
false
;
}
...
...
@@ -122,23 +123,23 @@ static bool fold_cast(struct hlsl_ctx *ctx, struct hlsl_ir_constant *dst, struct
vkd3d_unreachable
();
}
switch
(
dst
->
node
.
data
_type
->
base_type
)
switch
(
dst_type
->
base_type
)
{
case
HLSL_TYPE_FLOAT
:
case
HLSL_TYPE_HALF
:
dst
->
value
.
u
[
k
].
f
=
f
;
dst
->
u
[
k
].
f
=
f
;
break
;
case
HLSL_TYPE_DOUBLE
:
dst
->
value
.
u
[
k
].
d
=
d
;
dst
->
u
[
k
].
d
=
d
;
break
;
case
HLSL_TYPE_INT
:
dst
->
value
.
u
[
k
].
i
=
i
;
dst
->
u
[
k
].
i
=
i
;
break
;
case
HLSL_TYPE_UINT
:
dst
->
value
.
u
[
k
].
u
=
u
;
dst
->
u
[
k
].
u
=
u
;
break
;
case
HLSL_TYPE_BOOL
:
...
...
@@ -578,7 +579,7 @@ bool hlsl_fold_constant_exprs(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr,
break
;
case
HLSL_OP1_CAST
:
success
=
fold_cast
(
ctx
,
res
,
arg1
);
success
=
fold_cast
(
ctx
,
&
res
->
value
,
instr
->
data_type
,
arg1
);
break
;
case
HLSL_OP1_NEG
:
...
...
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