summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2017-04-28 17:06:56 -0700
committerMatt Turner <[email protected]>2017-05-15 11:42:56 -0700
commitd98e82c77269e98669c883e382682af826bf813d (patch)
tree5046481b5eba241c82c2f3ef93612091f24ddf96
parenta7217e909ce6e7d17eea8fd65191bb87deb3b496 (diff)
i965: Allow brw_eu_validate to handle compact instructions
This will allow the validator to run on shader programs we find in the GPU hang error state. Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
-rw-r--r--src/intel/compiler/brw_eu_validate.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_eu_validate.c b/src/intel/compiler/brw_eu_validate.c
index ba3fe0d85df..e089c1f90f8 100644
--- a/src/intel/compiler/brw_eu_validate.c
+++ b/src/intel/compiler/brw_eu_validate.c
@@ -1036,10 +1036,17 @@ brw_validate_instructions(const struct gen_device_info *devinfo,
{
bool valid = true;
- for (int src_offset = start_offset; src_offset < end_offset;
- src_offset += sizeof(brw_inst)) {
+ 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);
+ 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");
@@ -1056,6 +1063,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;