Fix step & smoothstep on Vulkan
Both of these have variants with mixed scalar/vector parameters. Ensure that all parameters are vectorized, or we fail SPIR-V validation. Bug: skia:10913 Change-Id: I1a5be7fc02695e4c7047b5b9c3c08d12b2071e21 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334896 Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: John Stiles <johnstiles@google.com>
This commit is contained in:
parent
053739dfa8
commit
6ba3be1d96
@ -77,8 +77,8 @@ void SPIRVCodeGenerator::setupIntrinsics() {
|
||||
fIntrinsicMap[String("dot")] = std::make_tuple(kSPIRV_IntrinsicKind, SpvOpDot,
|
||||
SpvOpUndef, SpvOpUndef, SpvOpUndef);
|
||||
fIntrinsicMap[String("mix")] = SPECIAL(Mix);
|
||||
fIntrinsicMap[String("step")] = ALL_GLSL(Step);
|
||||
fIntrinsicMap[String("smoothstep")] = ALL_GLSL(SmoothStep);
|
||||
fIntrinsicMap[String("step")] = SPECIAL(Step);
|
||||
fIntrinsicMap[String("smoothstep")] = SPECIAL(SmoothStep);
|
||||
fIntrinsicMap[String("fma")] = ALL_GLSL(Fma);
|
||||
fIntrinsicMap[String("frexp")] = ALL_GLSL(Frexp);
|
||||
fIntrinsicMap[String("ldexp")] = ALL_GLSL(Ldexp);
|
||||
@ -1019,6 +1019,20 @@ SpvId SPIRVCodeGenerator::writeSpecialIntrinsic(const FunctionCall& c, SpecialIn
|
||||
GLSLstd450UClamp, spvArgs, out);
|
||||
break;
|
||||
}
|
||||
case kSmoothStep_SpecialIntrinsic: {
|
||||
std::vector<SpvId> args = this->vectorize(arguments, out);
|
||||
SkASSERT(args.size() == 3);
|
||||
this->writeGLSLExtendedInstruction(callType, result, GLSLstd450SmoothStep, SpvOpUndef,
|
||||
SpvOpUndef, args, out);
|
||||
break;
|
||||
}
|
||||
case kStep_SpecialIntrinsic: {
|
||||
std::vector<SpvId> args = this->vectorize(arguments, out);
|
||||
SkASSERT(args.size() == 2);
|
||||
this->writeGLSLExtendedInstruction(callType, result, GLSLstd450Step, SpvOpUndef,
|
||||
SpvOpUndef, args, out);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -140,6 +140,8 @@ private:
|
||||
kDFdy_SpecialIntrinsic,
|
||||
kSaturate_SpecialIntrinsic,
|
||||
kSampledImage_SpecialIntrinsic,
|
||||
kSmoothStep_SpecialIntrinsic,
|
||||
kStep_SpecialIntrinsic,
|
||||
kSubpassLoad_SpecialIntrinsic,
|
||||
kTexture_SpecialIntrinsic,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user