mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[spv-out] Fix invalid spirv being generated from integer dot products (#2291)
* Fix invalid spirv generation in int dotprod constants cannot be declared inside of a function block, so instead use `write_constant_null` to produce a correctly-declared constant 0. * autogenerated test snapshots
This commit is contained in:
@@ -1627,12 +1627,7 @@ impl<'w> BlockContext<'w> {
|
||||
size: u32,
|
||||
block: &mut Block,
|
||||
) {
|
||||
let const_null = self.gen_id();
|
||||
block
|
||||
.body
|
||||
.push(Instruction::constant_null(result_type_id, const_null));
|
||||
|
||||
let mut partial_sum = const_null;
|
||||
let mut partial_sum = self.writer.write_constant_null(result_type_id);
|
||||
let last_component = size - 1;
|
||||
for index in 0..=last_component {
|
||||
// compute the product of the current components
|
||||
|
||||
@@ -23,10 +23,10 @@ OpExecutionMode %74 LocalSize 1 1 1
|
||||
%15 = OpTypeVector %7 4
|
||||
%18 = OpTypeFunction %12
|
||||
%26 = OpTypeFunction %7
|
||||
%75 = OpTypeFunction %2
|
||||
%31 = OpConstantNull %7
|
||||
%42 = OpConstantNull %9
|
||||
%57 = OpConstantNull %7
|
||||
%75 = OpTypeFunction %2
|
||||
%17 = OpFunction %12 None %18
|
||||
%16 = OpLabel
|
||||
OpBranch %19
|
||||
|
||||
@@ -24,12 +24,12 @@ OpEntryPoint Vertex %18 "main"
|
||||
%19 = OpTypeFunction %2
|
||||
%27 = OpConstantComposite %14 %5 %5 %5 %5
|
||||
%28 = OpConstantComposite %14 %3 %3 %3 %3
|
||||
%31 = OpConstantNull %7
|
||||
%42 = OpConstant %9 32
|
||||
%50 = OpTypeVector %9 2
|
||||
%53 = OpConstantComposite %50 %42 %42
|
||||
%65 = OpConstant %7 31
|
||||
%71 = OpConstantComposite %15 %65 %65
|
||||
%31 = OpConstantNull %7
|
||||
%18 = OpFunction %2 None %19
|
||||
%17 = OpLabel
|
||||
OpBranch %20
|
||||
|
||||
Reference in New Issue
Block a user