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
240b9424
Commit
240b9424
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 an hlsl_block pointer to append_output_copy().
parent
a04e3a51
No related branches found
No related tags found
1 merge request
!300
hlsl: Replace bare list pointers with hlsl_b;lock, part 8.
Pipeline
#13718
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libs/vkd3d-shader/hlsl_codegen.c
+15
-15
15 additions, 15 deletions
libs/vkd3d-shader/hlsl_codegen.c
with
15 additions
and
15 deletions
libs/vkd3d-shader/hlsl_codegen.c
+
15
−
15
View file @
240b9424
...
...
@@ -429,7 +429,7 @@ static void prepend_input_var_copy(struct hlsl_ctx *ctx, struct hlsl_block *bloc
prepend_input_copy_recurse
(
ctx
,
block
,
load
,
var
->
storage_modifiers
,
&
var
->
semantic
,
var
->
semantic
.
index
);
}
static
void
append_output_copy
(
struct
hlsl_ctx
*
ctx
,
struct
list
*
instrs
,
struct
hlsl_ir_load
*
rhs
,
static
void
append_output_copy
(
struct
hlsl_ctx
*
ctx
,
struct
hlsl_block
*
block
,
struct
hlsl_ir_load
*
rhs
,
unsigned
int
modifiers
,
struct
hlsl_semantic
*
semantic
,
uint32_t
semantic_index
)
{
struct
hlsl_type
*
type
=
rhs
->
node
.
data_type
,
*
vector_type
;
...
...
@@ -464,11 +464,11 @@ static void append_output_copy(struct hlsl_ctx *ctx, struct list *instrs, struct
{
if
(
!
(
c
=
hlsl_new_uint_constant
(
ctx
,
i
,
&
var
->
loc
)))
return
;
list_add_tail
(
instrs
,
&
c
->
entry
);
hlsl_block_add_instr
(
block
,
c
);
if
(
!
(
load
=
hlsl_new_load_index
(
ctx
,
&
rhs
->
src
,
c
,
&
var
->
loc
)))
return
;
list_add_tail
(
instrs
,
&
load
->
node
.
entry
);
hlsl_block_add_instr
(
block
,
&
load
->
node
);
}
else
{
...
...
@@ -476,16 +476,16 @@ static void append_output_copy(struct hlsl_ctx *ctx, struct list *instrs, struct
if
(
!
(
load
=
hlsl_new_load_index
(
ctx
,
&
rhs
->
src
,
NULL
,
&
var
->
loc
)))
return
;
list_add_tail
(
instrs
,
&
load
->
node
.
entry
);
hlsl_block_add_instr
(
block
,
&
load
->
node
);
}
if
(
!
(
store
=
hlsl_new_simple_store
(
ctx
,
output
,
&
load
->
node
)))
return
;
list_add_tail
(
instrs
,
&
store
->
entry
);
hlsl_block_add_instr
(
block
,
store
);
}
}
static
void
append_output_copy_recurse
(
struct
hlsl_ctx
*
ctx
,
struct
list
*
instrs
,
struct
hlsl_ir_load
*
rhs
,
static
void
append_output_copy_recurse
(
struct
hlsl_ctx
*
ctx
,
struct
hlsl_block
*
block
,
struct
hlsl_ir_load
*
rhs
,
unsigned
int
modifiers
,
struct
hlsl_semantic
*
semantic
,
uint32_t
semantic_index
)
{
struct
vkd3d_shader_location
*
loc
=
&
rhs
->
node
.
loc
;
...
...
@@ -520,34 +520,34 @@ static void append_output_copy_recurse(struct hlsl_ctx *ctx, struct list *instrs
if
(
!
(
c
=
hlsl_new_uint_constant
(
ctx
,
i
,
&
var
->
loc
)))
return
;
list_add_tail
(
instrs
,
&
c
->
entry
);
hlsl_block_add_instr
(
block
,
c
);
if
(
!
(
element_load
=
hlsl_new_load_index
(
ctx
,
&
rhs
->
src
,
c
,
loc
)))
return
;
list_add_tail
(
instrs
,
&
element_load
->
node
.
entry
);
hlsl_block_add_instr
(
block
,
&
element_load
->
node
);
append_output_copy_recurse
(
ctx
,
instrs
,
element_load
,
modifiers
,
semantic
,
elem_semantic_index
);
append_output_copy_recurse
(
ctx
,
block
,
element_load
,
modifiers
,
semantic
,
elem_semantic_index
);
}
}
else
{
append_output_copy
(
ctx
,
instrs
,
rhs
,
modifiers
,
semantic
,
semantic_index
);
append_output_copy
(
ctx
,
block
,
rhs
,
modifiers
,
semantic
,
semantic_index
);
}
}
/* Split outputs into two variables representing the temp and semantic
* registers, and copy the former to the latter, so that reads from output
* variables work. */
static
void
append_output_var_copy
(
struct
hlsl_ctx
*
ctx
,
struct
list
*
instrs
,
struct
hlsl_ir_var
*
var
)
static
void
append_output_var_copy
(
struct
hlsl_ctx
*
ctx
,
struct
hlsl_block
*
block
,
struct
hlsl_ir_var
*
var
)
{
struct
hlsl_ir_load
*
load
;
/* This redundant load is expected to be deleted later by DCE. */
if
(
!
(
load
=
hlsl_new_var_load
(
ctx
,
var
,
&
var
->
loc
)))
return
;
list_add_tail
(
instrs
,
&
load
->
node
.
entry
);
hlsl_block_add_instr
(
block
,
&
load
->
node
);
append_output_copy_recurse
(
ctx
,
instrs
,
load
,
var
->
storage_modifiers
,
&
var
->
semantic
,
var
->
semantic
.
index
);
append_output_copy_recurse
(
ctx
,
block
,
load
,
var
->
storage_modifiers
,
&
var
->
semantic
,
var
->
semantic
.
index
);
}
bool
hlsl_transform_ir
(
struct
hlsl_ctx
*
ctx
,
bool
(
*
func
)(
struct
hlsl_ctx
*
ctx
,
struct
hlsl_ir_node
*
,
void
*
),
...
...
@@ -4283,7 +4283,7 @@ int hlsl_emit_bytecode(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry
if
(
var
->
storage_modifiers
&
HLSL_STORAGE_IN
)
prepend_input_var_copy
(
ctx
,
body
,
var
);
if
(
var
->
storage_modifiers
&
HLSL_STORAGE_OUT
)
append_output_var_copy
(
ctx
,
&
body
->
instrs
,
var
);
append_output_var_copy
(
ctx
,
body
,
var
);
}
}
if
(
entry_func
->
return_var
)
...
...
@@ -4292,7 +4292,7 @@ int hlsl_emit_bytecode(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry
hlsl_error
(
ctx
,
&
entry_func
->
loc
,
VKD3D_SHADER_ERROR_HLSL_MISSING_SEMANTIC
,
"Entry point
\"
%s
\"
is missing a return value semantic."
,
entry_func
->
func
->
name
);
append_output_var_copy
(
ctx
,
&
body
->
instrs
,
entry_func
->
return_var
);
append_output_var_copy
(
ctx
,
body
,
entry_func
->
return_var
);
}
for
(
i
=
0
;
i
<
entry_func
->
attr_count
;
++
i
)
...
...
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