Replace is_integer_base_type macro with glsl_type::is_integer method
This commit is contained in:
@@ -255,8 +255,7 @@ modulus_result_type(const struct glsl_type *type_a,
|
|||||||
* integer vectors. The operand types must both be signed or both be
|
* integer vectors. The operand types must both be signed or both be
|
||||||
* unsigned."
|
* unsigned."
|
||||||
*/
|
*/
|
||||||
if (! is_integer_base_type(type_a->base_type)
|
if (!type_a->is_integer() || !type_b->is_integer()
|
||||||
|| ! is_integer_base_type(type_b->base_type)
|
|
||||||
|| (type_a->base_type != type_b->base_type)) {
|
|| (type_a->base_type != type_b->base_type)) {
|
||||||
return glsl_type::error_type;
|
return glsl_type::error_type;
|
||||||
}
|
}
|
||||||
|
11
glsl_types.h
11
glsl_types.h
@@ -42,9 +42,6 @@
|
|||||||
#define is_numeric_base_type(b) \
|
#define is_numeric_base_type(b) \
|
||||||
(((b) >= GLSL_TYPE_UINT) && ((b) <= GLSL_TYPE_FLOAT))
|
(((b) >= GLSL_TYPE_UINT) && ((b) <= GLSL_TYPE_FLOAT))
|
||||||
|
|
||||||
#define is_integer_base_type(b) \
|
|
||||||
(((b) == GLSL_TYPE_UINT) || ((b) == GLSL_TYPE_INT))
|
|
||||||
|
|
||||||
#define is_error_type(t) ((t)->base_type == GLSL_TYPE_ERROR)
|
#define is_error_type(t) ((t)->base_type == GLSL_TYPE_ERROR)
|
||||||
|
|
||||||
enum glsl_sampler_dim {
|
enum glsl_sampler_dim {
|
||||||
@@ -203,6 +200,14 @@ struct glsl_type {
|
|||||||
return (base_type >= GLSL_TYPE_UINT) && (base_type <= GLSL_TYPE_FLOAT);
|
return (base_type >= GLSL_TYPE_UINT) && (base_type <= GLSL_TYPE_FLOAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query whether or not a type is an integral type
|
||||||
|
*/
|
||||||
|
bool is_integer() const
|
||||||
|
{
|
||||||
|
return (base_type == GLSL_TYPE_UINT) || (base_type == GLSL_TYPE_INT);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query whether or not a type is a non-array boolean type
|
* Query whether or not a type is a non-array boolean type
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user