diff options
author | Kenneth Graunke <[email protected]> | 2015-07-01 20:13:00 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2015-07-07 16:44:22 -0700 |
commit | 73d0e7f3451eaeb62ac039d2dcee1e1c6787e3db (patch) | |
tree | 299eacb2b966d8fc4267d8e88b064818c2d571f1 | |
parent | 6611f65047575054a38ce83ebfe0331e39e1774f (diff) |
i965/vs: Fix matNxM vertex attributes where M != 4.
Matrix vertex attributes have their columns padded out to vec4s, which
I was failing to account for. Scalar NIR expects them to be packed,
however.
Fixes 1256 dEQP tests on Broadwell.
Cc: [email protected]
Signed-off-by: Kenneth Graunke <[email protected]>
Tested-by: Mark Janes <[email protected]>
Reviewed-by: Chris Forbes <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index e01dfa88d52..5d1ea21884a 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -91,12 +91,19 @@ fs_visitor::nir_setup_inputs(nir_shader *shader) * So, we need to copy from fs_reg(ATTR, var->location) to * offset(nir_inputs, var->data.driver_location). */ - unsigned components = var->type->without_array()->components(); + const glsl_type *const t = var->type->without_array(); + const unsigned components = t->components(); + const unsigned cols = t->matrix_columns; + const unsigned elts = t->vector_elements; unsigned array_length = var->type->is_array() ? var->type->length : 1; for (unsigned i = 0; i < array_length; i++) { - for (unsigned j = 0; j < components; j++) { - bld.MOV(retype(offset(input, bld, components * i + j), type), - offset(fs_reg(ATTR, var->data.location + i, type), bld, j)); + for (unsigned j = 0; j < cols; j++) { + for (unsigned k = 0; k < elts; k++) { + bld.MOV(offset(retype(input, type), bld, + components * i + elts * j + k), + offset(fs_reg(ATTR, var->data.location + i, type), + bld, 4 * j + k)); + } } } break; |