Parser: Add 64-bit type conversion for specialization constant.

This commit is contained in:
Rex Xu
2016-09-05 16:10:14 +08:00
parent 7d01bd6f0b
commit 64bcfdb632
8 changed files with 183 additions and 96 deletions

View File

@@ -4,12 +4,16 @@ layout(constant_id = 200) const float sp_float = 3.1415926;
layout(constant_id = 201) const int sp_int = 10;
layout(constant_id = 202) const uint sp_uint = 100;
layout(constant_id = 203) const int sp_sint = -10;
layout(constant_id = 204) const double sp_double = 2.718281828459;
//
// Scalars
//
// float <-> double conversion
const float float_from_double = float(sp_double);
const double double_from_float = double(sp_float);
// uint/int <-> bool conversion
const bool bool_from_int = bool(sp_int);
const bool bool_from_uint = bool(sp_uint);