Commit 0dc39f48 authored by Ian Romanick's avatar Ian Romanick

glsl2: Use MIN2 from macros.h instead of open coding it

parent 261bbc01
......@@ -25,11 +25,7 @@
#include "ast.h"
#include "glsl_types.h"
#include "ir.h"
inline unsigned min(unsigned a, unsigned b)
{
return (a < b) ? a : b;
}
#include "main/macros.h"
static ir_rvalue *
convert_component(ir_rvalue *src, const glsl_type *desired_type);
......@@ -781,7 +777,7 @@ emit_inline_matrix_constructor(const glsl_type *type,
{ 1, 1, 1, 0 }
};
const unsigned cols_to_init = min(type->matrix_columns,
const unsigned cols_to_init = MIN2(type->matrix_columns,
type->vector_elements);
for (unsigned i = 0; i < cols_to_init; i++) {
ir_constant *const col_idx = new(ctx) ir_constant(i);
......@@ -875,7 +871,7 @@ emit_inline_matrix_constructor(const glsl_type *type,
for (unsigned i = 1; i < src_matrix->type->vector_elements; i++)
swiz[i] = i;
const unsigned last_col = min(src_matrix->type->matrix_columns,
const unsigned last_col = MIN2(src_matrix->type->matrix_columns,
var->type->matrix_columns);
const unsigned write_mask = (1U << var->type->vector_elements) - 1;
......@@ -938,7 +934,7 @@ emit_inline_matrix_constructor(const glsl_type *type,
* single vec4, for example, can completely fill a mat2.
*/
if (rhs_components >= components_remaining_this_column) {
const unsigned count = min(rhs_components,
const unsigned count = MIN2(rhs_components,
components_remaining_this_column);
rhs_var_ref = new(ctx) ir_dereference_variable(rhs_var);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment