nir: Add 64-bit integer constant support
v2: Rebase on 19a541f
(nir: Get rid of nir_constant_data)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com> [v1]
This commit is contained in:
@@ -254,6 +254,22 @@ constant_copy(ir_constant *ir, void *mem_ctx)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GLSL_TYPE_UINT64:
|
||||||
|
/* Only float base types can be matrices. */
|
||||||
|
assert(cols == 1);
|
||||||
|
|
||||||
|
for (unsigned r = 0; r < rows; r++)
|
||||||
|
ret->values[0].u64[r] = ir->value.u64[r];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GLSL_TYPE_INT64:
|
||||||
|
/* Only float base types can be matrices. */
|
||||||
|
assert(cols == 1);
|
||||||
|
|
||||||
|
for (unsigned r = 0; r < rows; r++)
|
||||||
|
ret->values[0].i64[r] = ir->value.i64[r];
|
||||||
|
break;
|
||||||
|
|
||||||
case GLSL_TYPE_BOOL:
|
case GLSL_TYPE_BOOL:
|
||||||
/* Only float base types can be matrices. */
|
/* Only float base types can be matrices. */
|
||||||
assert(cols == 1);
|
assert(cols == 1);
|
||||||
|
@@ -846,6 +846,8 @@ nir_deref_get_const_initializer_load(nir_shader *shader, nir_deref_var *deref)
|
|||||||
case GLSL_TYPE_INT:
|
case GLSL_TYPE_INT:
|
||||||
case GLSL_TYPE_UINT:
|
case GLSL_TYPE_UINT:
|
||||||
case GLSL_TYPE_DOUBLE:
|
case GLSL_TYPE_DOUBLE:
|
||||||
|
case GLSL_TYPE_UINT64:
|
||||||
|
case GLSL_TYPE_INT64:
|
||||||
case GLSL_TYPE_BOOL:
|
case GLSL_TYPE_BOOL:
|
||||||
load->value = constant->values[matrix_col];
|
load->value = constant->values[matrix_col];
|
||||||
break;
|
break;
|
||||||
|
@@ -330,6 +330,17 @@ print_constant(nir_constant *c, const struct glsl_type *type, print_state *state
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GLSL_TYPE_UINT64:
|
||||||
|
case GLSL_TYPE_INT64:
|
||||||
|
/* Only float base types can be matrices. */
|
||||||
|
assert(cols == 1);
|
||||||
|
|
||||||
|
for (i = 0; i < cols; i++) {
|
||||||
|
if (i > 0) fprintf(fp, ", ");
|
||||||
|
fprintf(fp, "0x%08" PRIx64, c->values[0].u64[i]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case GLSL_TYPE_STRUCT:
|
case GLSL_TYPE_STRUCT:
|
||||||
for (i = 0; i < c->num_elements; i++) {
|
for (i = 0; i < c->num_elements; i++) {
|
||||||
if (i > 0) fprintf(fp, ", ");
|
if (i > 0) fprintf(fp, ", ");
|
||||||
|
Reference in New Issue
Block a user