[Mesa-dev] [PATCH 03/11] i965: Allow brw_eu_validate to handle compact instructions
Pohjolainen, Topi
topi.pohjolainen at gmail.com
Sat May 13 04:16:07 UTC 2017
On Mon, May 01, 2017 at 01:54:47PM -0700, Matt Turner wrote:
> This will allow the validator to run on shader programs we find in the
> GPU hang error state.
> ---
> src/intel/compiler/brw_eu_validate.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/src/intel/compiler/brw_eu_validate.c b/src/intel/compiler/brw_eu_validate.c
> index 39363e4..38564a4 100644
> --- a/src/intel/compiler/brw_eu_validate.c
> +++ b/src/intel/compiler/brw_eu_validate.c
> @@ -1051,6 +1051,14 @@ brw_validate_instructions(const struct gen_device_info *devinfo,
> for (int src_offset = start_offset; src_offset < end_offset;) {
> struct string error_msg = { .str = NULL, .len = 0 };
> const brw_inst *inst = assembly + src_offset;
> + bool is_compact = brw_inst_cmpt_control(devinfo, inst);
Could be const. Either way:
Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> + brw_inst uncompacted;
> +
> + if (is_compact) {
> + brw_compact_inst *compacted = (void *)inst;
> + brw_uncompact_instruction(devinfo, &uncompacted, compacted);
> + inst = &uncompacted;
> + }
>
> if (is_unsupported_inst(devinfo, inst)) {
> ERROR("Instruction not supported on this Gen");
> @@ -1067,6 +1075,12 @@ brw_validate_instructions(const struct gen_device_info *devinfo,
> }
> valid = valid && error_msg.len == 0;
> free(error_msg.str);
> +
> + if (is_compact) {
> + src_offset += sizeof(brw_compact_inst);
> + } else {
> + src_offset += sizeof(brw_inst);
> + }
> }
>
> return valid;
> --
> 2.10.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list