Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mike Blumenkrantz
mesa
Commits
94696a61
Commit
94696a61
authored
Mar 19, 2021
by
Mike Blumenkrantz
🏋
Browse files
zink: fix multisampled shader image load/store
need to actually pass the sample id here
parent
9cfbc000
Pipeline
#287399
waiting for manual action with stages
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
View file @
94696a61
...
...
@@ -2746,12 +2746,13 @@ emit_intrinsic(struct ntv_context *ctx, nir_intrinsic_instr *intr)
SpvId
img
=
spirv_builder_emit_load
(
&
ctx
->
builder
,
img_type
,
img_var
);
SpvId
coord
=
get_image_coords
(
ctx
,
type
,
&
intr
->
src
[
1
]);
SpvId
texel
=
get_src
(
ctx
,
&
intr
->
src
[
3
]);
SpvId
sample
=
glsl_get_sampler_dim
(
type
)
==
GLSL_SAMPLER_DIM_MS
?
get_src
(
ctx
,
&
intr
->
src
[
2
])
:
0
;
assert
(
nir_src_bit_size
(
intr
->
src
[
3
])
==
glsl_base_type_bit_size
(
glsl_get_sampler_result_type
(
type
)));
/* texel type must match image type */
texel
=
emit_bitcast
(
ctx
,
spirv_builder_type_vector
(
&
ctx
->
builder
,
base_type
,
4
),
texel
);
spirv_builder_emit_image_write
(
&
ctx
->
builder
,
img
,
coord
,
texel
,
0
,
0
,
0
);
spirv_builder_emit_image_write
(
&
ctx
->
builder
,
img
,
coord
,
texel
,
0
,
sample
,
0
);
break
;
}
case
nir_intrinsic_image_deref_load
:
{
...
...
@@ -2762,9 +2763,10 @@ emit_intrinsic(struct ntv_context *ctx, nir_intrinsic_instr *intr)
SpvId
base_type
=
get_glsl_basetype
(
ctx
,
glsl_get_sampler_result_type
(
type
));
SpvId
img
=
spirv_builder_emit_load
(
&
ctx
->
builder
,
img_type
,
img_var
);
SpvId
coord
=
get_image_coords
(
ctx
,
type
,
&
intr
->
src
[
1
]);
SpvId
sample
=
glsl_get_sampler_dim
(
type
)
==
GLSL_SAMPLER_DIM_MS
?
get_src
(
ctx
,
&
intr
->
src
[
2
])
:
0
;
SpvId
result
=
spirv_builder_emit_image_read
(
&
ctx
->
builder
,
spirv_builder_type_vector
(
&
ctx
->
builder
,
base_type
,
nir_dest_num_components
(
intr
->
dest
)),
img
,
coord
,
0
,
0
,
0
);
img
,
coord
,
0
,
sample
,
0
);
store_dest
(
ctx
,
&
intr
->
dest
,
result
,
nir_type_float
);
break
;
}
...
...
bob sang
@webjb
mentioned in issue
#74
·
Mar 22, 2021
mentioned in issue
#74
mentioned in issue #74
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment