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
f5e3b248
Commit
f5e3b248
authored
7 years ago
by
Józef Kucia
Browse files
Options
Downloads
Patches
Plain Diff
libs/vkd3d-shader: Fix SV_Position in pixel shaders.
parent
9880d780
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libs/vkd3d-shader/spirv.c
+12
-4
12 additions, 4 deletions
libs/vkd3d-shader/spirv.c
libs/vkd3d-shader/vkd3d_shader_private.h
+1
-0
1 addition, 0 deletions
libs/vkd3d-shader/vkd3d_shader_private.h
with
13 additions
and
4 deletions
libs/vkd3d-shader/spirv.c
+
12
−
4
View file @
f5e3b248
...
...
@@ -886,6 +886,8 @@ struct vkd3d_dxbc_compiler
uint32_t
temp_id
;
unsigned
int
temp_count
;
uint32_t
position_id
;
enum
vkd3d_shader_type
shader_type
;
};
struct
vkd3d_dxbc_compiler
*
vkd3d_dxbc_compiler_create
(
const
struct
vkd3d_shader_version
*
shader_version
,
...
...
@@ -926,6 +928,8 @@ struct vkd3d_dxbc_compiler *vkd3d_dxbc_compiler_create(const struct vkd3d_shader
ERR
(
"Invalid shader type %#x.
\n
"
,
shader_version
->
type
);
}
compiler
->
shader_type
=
shader_version
->
type
;
return
compiler
;
}
...
...
@@ -1321,15 +1325,19 @@ static void vkd3d_dxbc_compiler_emit_store_reg(struct vkd3d_dxbc_compiler *compi
vkd3d_spirv_build_op_store
(
builder
,
reg_id
,
val_id
,
SpvMemoryAccessMaskNone
);
}
static
void
vkd3d_dxbc_compiler_decorate_sysval
(
struct
vkd3d_
spirv_builder
*
bu
il
d
er
,
static
void
vkd3d_dxbc_compiler_decorate_sysval
(
struct
vkd3d_
dxbc_compiler
*
comp
iler
,
uint32_t
target_id
,
enum
vkd3d_shader_input_sysval_semantic
sysval
)
{
struct
vkd3d_spirv_builder
*
builder
=
&
compiler
->
spirv_builder
;
SpvBuiltIn
builtin
;
switch
(
sysval
)
{
case
VKD3D_SIV_POSITION
:
builtin
=
SpvBuiltInPosition
;
if
(
compiler
->
shader_type
==
VKD3D_SHADER_TYPE_PIXEL
)
builtin
=
SpvBuiltInFragCoord
;
else
builtin
=
SpvBuiltInPosition
;
break
;
case
VKD3D_SIV_VERTEX_ID
:
builtin
=
SpvBuiltInVertexIndex
;
...
...
@@ -1357,7 +1365,7 @@ static void vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compiler,
storage_class
,
component_type
,
component_count
);
vkd3d_spirv_add_iface_variable
(
builder
,
var_id
);
if
(
sysval
)
vkd3d_dxbc_compiler_decorate_sysval
(
bu
il
d
er
,
var_id
,
sysval
);
vkd3d_dxbc_compiler_decorate_sysval
(
comp
iler
,
var_id
,
sysval
);
else
vkd3d_spirv_build_op_decorate1
(
builder
,
var_id
,
SpvDecorationLocation
,
dst
->
reg
.
idx
[
0
].
offset
);
...
...
@@ -1407,7 +1415,7 @@ static uint32_t vkd3d_dxbc_compiler_emit_output(struct vkd3d_dxbc_compiler *comp
storage_class
,
VKD3D_TYPE_FLOAT
,
VKD3D_VEC4_SIZE
);
vkd3d_spirv_add_iface_variable
(
builder
,
id
);
if
(
sysval
)
vkd3d_dxbc_compiler_decorate_sysval
(
bu
il
d
er
,
id
,
sysval
);
vkd3d_dxbc_compiler_decorate_sysval
(
comp
iler
,
id
,
sysval
);
else
vkd3d_spirv_build_op_decorate1
(
builder
,
id
,
SpvDecorationLocation
,
reg
->
idx
[
0
].
offset
);
...
...
This diff is collapsed.
Click to expand it.
libs/vkd3d-shader/vkd3d_shader_private.h
+
1
−
0
View file @
f5e3b248
...
...
@@ -833,6 +833,7 @@ static inline enum vkd3d_component_type vkd3d_component_type_for_semantic(
switch
(
sysval
)
{
case
VKD3D_SIV_NONE
:
case
VKD3D_SIV_POSITION
:
return
VKD3D_TYPE_FLOAT
;
case
VKD3D_SIV_VERTEX_ID
:
return
VKD3D_TYPE_INT
;
...
...
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