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
cd07a50b
Commit
cd07a50b
authored
7 years ago
by
Józef Kucia
Browse files
Options
Downloads
Patches
Plain Diff
libs/vkd3d-shader: Implement relative addressing for immediate constant buffers.
parent
2bbba87e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libs/vkd3d-shader/spirv.c
+30
-1
30 additions, 1 deletion
libs/vkd3d-shader/spirv.c
with
30 additions
and
1 deletion
libs/vkd3d-shader/spirv.c
+
30
−
1
View file @
cd07a50b
...
...
@@ -720,6 +720,13 @@ static void vkd3d_spirv_build_op_branch_conditional(struct vkd3d_spirv_builder *
condition
,
true_label
,
false_label
);
}
static
uint32_t
vkd3d_spirv_build_op_iadd
(
struct
vkd3d_spirv_builder
*
builder
,
uint32_t
result_type
,
uint32_t
operand0
,
uint32_t
operand1
)
{
return
vkd3d_spirv_build_op_tr2
(
builder
,
&
builder
->
function_stream
,
SpvOpIAdd
,
result_type
,
operand0
,
operand1
);
}
static
uint32_t
vkd3d_spirv_build_op_isub
(
struct
vkd3d_spirv_builder
*
builder
,
uint32_t
result_type
,
uint32_t
operand0
,
uint32_t
operand1
)
{
...
...
@@ -1249,6 +1256,28 @@ static uint32_t vkd3d_dxbc_compiler_emit_undef(struct vkd3d_dxbc_compiler *compi
return
vkd3d_spirv_build_op_undef
(
builder
,
stream
,
ptr_type_id
);
}
static
uint32_t
vkd3d_dxbc_compiler_emit_load_src
(
struct
vkd3d_dxbc_compiler
*
compiler
,
const
struct
vkd3d_shader_src_param
*
src
,
DWORD
write_mask
);
static
uint32_t
vkd3d_dxbc_compiler_emit_register_addressing
(
struct
vkd3d_dxbc_compiler
*
compiler
,
const
struct
vkd3d_shader_register_index
*
reg_index
)
{
struct
vkd3d_spirv_builder
*
builder
=
&
compiler
->
spirv_builder
;
uint32_t
type_id
,
addr_id
;
if
(
!
reg_index
->
rel_addr
)
return
vkd3d_dxbc_compiler_get_constant_uint
(
compiler
,
reg_index
->
offset
);
addr_id
=
vkd3d_dxbc_compiler_emit_load_src
(
compiler
,
reg_index
->
rel_addr
,
VKD3DSP_WRITEMASK_0
);
if
(
reg_index
->
offset
)
{
type_id
=
vkd3d_spirv_get_type_id
(
builder
,
VKD3D_TYPE_UINT
,
1
);
addr_id
=
vkd3d_spirv_build_op_iadd
(
builder
,
type_id
,
addr_id
,
vkd3d_dxbc_compiler_get_constant_uint
(
compiler
,
reg_index
->
offset
));
}
return
addr_id
;
}
struct
vkd3d_dxbc_register_info
{
uint32_t
id
;
...
...
@@ -1299,7 +1328,7 @@ static void vkd3d_dxbc_compiler_get_register_info(struct vkd3d_dxbc_compiler *co
}
else
if
(
reg
->
type
==
VKD3DSPR_IMMCONSTBUFFER
)
{
uint32_t
indexes
[]
=
{
vkd3d_dxbc_compiler_
get_constant_u
in
t
(
compiler
,
reg
->
idx
[
0
]
.
offset
)};
uint32_t
indexes
[]
=
{
vkd3d_dxbc_compiler_
emit_register_address
in
g
(
compiler
,
&
reg
->
idx
[
0
])};
uint32_t
type_id
,
ptr_type_id
;
type_id
=
vkd3d_spirv_get_type_id
(
builder
,
VKD3D_TYPE_FLOAT
,
VKD3D_VEC4_SIZE
);
...
...
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