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
0633cfc5
Commit
0633cfc5
authored
7 years ago
by
Józef Kucia
Browse files
Options
Downloads
Patches
Plain Diff
libs/vkd3d-shader: Implement "absneg" source modifiers.
parent
5ae7e3d9
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
+21
-12
21 additions, 12 deletions
libs/vkd3d-shader/spirv.c
with
21 additions
and
12 deletions
libs/vkd3d-shader/spirv.c
+
21
−
12
View file @
0633cfc5
...
...
@@ -1367,6 +1367,23 @@ static uint32_t vkd3d_dxbc_compiler_emit_load_reg(struct vkd3d_dxbc_compiler *co
return
val_id
;
}
static
uint32_t
vkd3d_dxbc_compiler_emit_abs
(
struct
vkd3d_dxbc_compiler
*
compiler
,
const
struct
vkd3d_shader_register
*
reg
,
DWORD
write_mask
,
uint32_t
val_id
)
{
unsigned
int
component_count
=
vkd3d_write_mask_component_count
(
write_mask
);
struct
vkd3d_spirv_builder
*
builder
=
&
compiler
->
spirv_builder
;
uint32_t
type_id
;
if
(
reg
->
data_type
==
VKD3D_DATA_FLOAT
)
{
type_id
=
vkd3d_spirv_get_type_id
(
builder
,
VKD3D_TYPE_FLOAT
,
component_count
);
return
vkd3d_spirv_build_op_glsl_std450_fabs
(
builder
,
type_id
,
val_id
);
}
FIXME
(
"Unhandled data type %#x.
\n
"
,
reg
->
data_type
);
return
val_id
;
}
static
uint32_t
vkd3d_dxbc_compiler_emit_neg
(
struct
vkd3d_dxbc_compiler
*
compiler
,
const
struct
vkd3d_shader_register
*
reg
,
DWORD
write_mask
,
uint32_t
val_id
)
{
...
...
@@ -1389,10 +1406,6 @@ static uint32_t vkd3d_dxbc_compiler_emit_src_modifier(struct vkd3d_dxbc_compiler
const
struct
vkd3d_shader_register
*
reg
,
DWORD
write_mask
,
enum
vkd3d_shader_src_modifier
modifier
,
uint32_t
val_id
)
{
unsigned
int
component_count
=
vkd3d_write_mask_component_count
(
write_mask
);
struct
vkd3d_spirv_builder
*
builder
=
&
compiler
->
spirv_builder
;
uint32_t
type_id
;
switch
(
modifier
)
{
case
VKD3DSPSM_NONE
:
...
...
@@ -1400,14 +1413,10 @@ static uint32_t vkd3d_dxbc_compiler_emit_src_modifier(struct vkd3d_dxbc_compiler
case
VKD3DSPSM_NEG
:
return
vkd3d_dxbc_compiler_emit_neg
(
compiler
,
reg
,
write_mask
,
val_id
);
case
VKD3DSPSM_ABS
:
if
(
reg
->
data_type
!=
VKD3D_DATA_FLOAT
)
{
FIXME
(
"Unhandled data type %#x.
\n
"
,
reg
->
data_type
);
return
val_id
;
}
type_id
=
vkd3d_spirv_get_type_id
(
builder
,
VKD3D_TYPE_FLOAT
,
component_count
);
return
vkd3d_spirv_build_op_glsl_std450_fabs
(
builder
,
type_id
,
val_id
);
break
;
return
vkd3d_dxbc_compiler_emit_abs
(
compiler
,
reg
,
write_mask
,
val_id
);
case
VKD3DSPSM_ABSNEG
:
val_id
=
vkd3d_dxbc_compiler_emit_abs
(
compiler
,
reg
,
write_mask
,
val_id
);
return
vkd3d_dxbc_compiler_emit_neg
(
compiler
,
reg
,
write_mask
,
val_id
);
default:
FIXME
(
"Unhandled src modifier %#x.
\n
"
,
modifier
);
break
;
...
...
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