fix format; remove unnecessary parameters; rename some spec op mode guard class; remove support of float point comparison and composite type comparison; update the tests.
This commit is contained in:
@@ -41,12 +41,11 @@ const uint sp_uint_shift_left = sp_uint << 2;
|
||||
// Bitwise And, Or, Xor
|
||||
const int sp_sint_or_256 = sp_sint | 0x100;
|
||||
const uint sp_uint_xor_512 = sp_uint ^ 0x200;
|
||||
const int sp_sint_and_sp_uint = sp_sint & int(sp_uint);
|
||||
|
||||
// Scalar comparison
|
||||
/* // Scalar comparison */
|
||||
const bool sp_int_lt_sp_sint = sp_int < sp_sint;
|
||||
const bool sp_uint_lt_sp_sint = sp_uint < sp_sint;
|
||||
const bool sp_sint_lt_sp_uint = sp_sint < sp_uint;
|
||||
const bool sp_uint_equal_sp_uint = sp_uint == sp_uint;
|
||||
const bool sp_int_gt_sp_sint = sp_int > sp_sint;
|
||||
|
||||
//
|
||||
// Vectors
|
||||
@@ -60,7 +59,7 @@ const dvec4 fv_to_dv = dvec4(fv);
|
||||
const vec4 dv_to_fv = vec4(fv_to_dv);
|
||||
|
||||
// Negate and Not
|
||||
const vec4 not_iv = ~iv;
|
||||
const ivec4 not_iv = ~iv;
|
||||
const ivec4 negate_iv = -iv;
|
||||
|
||||
// Add and Subtract
|
||||
@@ -80,7 +79,6 @@ const ivec4 iv_shift_left = iv << 2;
|
||||
// Bitwise And, Or, Xor
|
||||
const ivec4 iv_or_1024 = iv | 0x400;
|
||||
const uvec4 uv_xor_2048 = uv ^ 0x800;
|
||||
const ivec4 iv_and_uv = iv & ivec4(uv);
|
||||
|
||||
// Swizzles
|
||||
const int iv_x = iv.x;
|
||||
@@ -88,40 +86,5 @@ const ivec2 iv_yx = iv.yx;
|
||||
const ivec3 iv_zyx = iv.zyx;
|
||||
const ivec4 iv_yzxw = iv.yzxw;
|
||||
|
||||
// Vector comparison, only == and != are supported and allowd.
|
||||
const bool iv_equal_uv = iv == uv;
|
||||
const bool iv_not_equal_uv = iv != uv;
|
||||
|
||||
//
|
||||
// Composite types other than vectors
|
||||
//
|
||||
|
||||
// Struct
|
||||
struct int_float_double_vec2 {
|
||||
int i;
|
||||
float f;
|
||||
double d;
|
||||
vec2 v;
|
||||
};
|
||||
|
||||
const int_float_double_vec2 sp_struct_a = {
|
||||
sp_int, sp_float, float_to_double,
|
||||
vec2(double_to_float, 1.0)
|
||||
};
|
||||
|
||||
const int_float_double_vec2 sp_struct_b = {
|
||||
sp_int, sp_float, float_to_double,
|
||||
vec2(double_to_float, 1.0)
|
||||
};
|
||||
|
||||
const bool struct_a_equal_struct_b = sp_struct_a == sp_struct_b;
|
||||
const bool struct_a_not_equal_struct_b = sp_struct_a != sp_struct_b;
|
||||
|
||||
// Array
|
||||
const float array_a[2] = {sp_float, sp_float};
|
||||
const float array_b[2] = {sp_float, sp_float};
|
||||
const bool array_a_equal_array_b = array_a == array_b;
|
||||
const bool array_a_not_equal_array_b = array_a != array_b;
|
||||
|
||||
void main() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user