This was previously taking the IntLiteral<T> path, resulting in an integer type instead of a bool type.
Bug: b/
128636885
Change-Id: I1a36a7ba0e7009431dc44645f90454d389be721b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27250
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
};
template<class T>
- struct IntLiteral
+ struct BoolLiteral
{
struct type;
};
template<>
- struct IntLiteral<Bool>
+ struct BoolLiteral<Bool>
{
typedef bool type;
};
+ template<class T>
+ struct IntLiteral
+ {
+ struct type;
+ };
+
template<>
struct IntLiteral<Int>
{
explicit RValue(Value *rvalue);
RValue(const T &lvalue);
+ RValue(typename BoolLiteral<T>::type i);
RValue(typename IntLiteral<T>::type i);
RValue(typename FloatLiteral<T>::type f);
RValue(const Reference<T> &rhs);
}
template<class T>
+ RValue<T>::RValue(typename BoolLiteral<T>::type i)
+ {
+ value = Nucleus::createConstantBool(i);
+ }
+
+ template<class T>
RValue<T>::RValue(typename IntLiteral<T>::type i)
{
value = Nucleus::createConstantInt(i);