#include "tgsi/tgsi_scan.h"
+static bool
+is_memory_file(unsigned file)
+{
+ return file == TGSI_FILE_SAMPLER ||
+ file == TGSI_FILE_SAMPLER_VIEW ||
+ file == TGSI_FILE_IMAGE ||
+ file == TGSI_FILE_BUFFER;
+}
+
static void
scan_instruction(struct tgsi_shader_info *info,
unsigned *current_depth)
{
unsigned i;
+ bool is_mem_inst = false;
assert(fullinst->Instruction.Opcode < TGSI_OPCODE_LAST);
info->opcode_count[fullinst->Instruction.Opcode]++;
info->is_msaa_sampler[src->Register.Index] = TRUE;
}
}
+
+ if (is_memory_file(src->Register.File))
+ is_mem_inst = true;
}
/* check for indirect register writes */
info->indirect_files |= (1 << dst->Register.File);
info->indirect_files_written |= (1 << dst->Register.File);
}
+
+ if (is_memory_file(dst->Register.File))
+ is_mem_inst = true;
}
+ if (is_mem_inst)
+ info->num_memory_instructions++;
+
info->num_instructions++;
}
uint immediate_count; /**< number of immediates declared */
uint num_instructions;
+ uint num_memory_instructions; /**< sampler, buffer, and image instructions */
uint opcode_count[TGSI_OPCODE_LAST]; /**< opcode histogram */