Revert "Revert "moved SkSL FloatLiteral data into IRNode""
This reverts commit a0c82f08df58dcd0e1d143db9ccab38f8d823b95.
Change-Id: Ic2e93591c64992ec22e477bd0975d71954bef1c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321469
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/SkSLSPIRVCodeGenerator.h b/src/sksl/SkSLSPIRVCodeGenerator.h
index 9bbc805..76d00dd 100644
--- a/src/sksl/SkSLSPIRVCodeGenerator.h
+++ b/src/sksl/SkSLSPIRVCodeGenerator.h
@@ -45,17 +45,21 @@
union ConstantValue {
ConstantValue(int64_t i)
- : fInt(i) {}
+ : fInt(i) {
+ SkASSERT(sizeof(*this) == sizeof(int64_t));
+ }
- ConstantValue(double d)
- : fDouble(d) {}
+ ConstantValue(SKSL_FLOAT f) {
+ memset(this, 0, sizeof(*this));
+ fFloat = f;
+ }
bool operator==(const ConstantValue& other) const {
return fInt == other.fInt;
}
int64_t fInt;
- double fDouble;
+ SKSL_FLOAT fFloat;
};
enum class ConstantType {