Change ref_analysis to RefAnalysis to follow coding standards. (#4045)

This commit is contained in:
greg-lunarg 2020-12-01 17:16:49 -07:00 committed by GitHub
parent c502a15f25
commit c1d5a045f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 13 deletions

View File

@ -117,7 +117,7 @@ uint32_t InstBindlessCheckPass::CloneOriginalImage(
}
uint32_t InstBindlessCheckPass::CloneOriginalReference(
ref_analysis* ref, InstructionBuilder* builder) {
RefAnalysis* ref, InstructionBuilder* builder) {
// If original is image based, start by cloning descriptor load
uint32_t new_image_id = 0;
if (ref->desc_load_id != 0) {
@ -192,7 +192,7 @@ Instruction* InstBindlessCheckPass::GetPointeeTypeInst(Instruction* ptr_inst) {
}
bool InstBindlessCheckPass::AnalyzeDescriptorReference(Instruction* ref_inst,
ref_analysis* ref) {
RefAnalysis* ref) {
ref->ref_inst = ref_inst;
if (ref_inst->opcode() == SpvOpLoad || ref_inst->opcode() == SpvOpStore) {
ref->desc_load_id = 0;
@ -338,7 +338,7 @@ uint32_t InstBindlessCheckPass::ByteSize(uint32_t ty_id, uint32_t matrix_stride,
return size;
}
uint32_t InstBindlessCheckPass::GenLastByteIdx(ref_analysis* ref,
uint32_t InstBindlessCheckPass::GenLastByteIdx(RefAnalysis* ref,
InstructionBuilder* builder) {
// Find outermost buffer type and its access chain index
Instruction* var_inst = get_def_use_mgr()->GetDef(ref->var_id);
@ -490,7 +490,7 @@ uint32_t InstBindlessCheckPass::GenLastByteIdx(ref_analysis* ref,
void InstBindlessCheckPass::GenCheckCode(
uint32_t check_id, uint32_t error_id, uint32_t offset_id,
uint32_t length_id, uint32_t stage_idx, ref_analysis* ref,
uint32_t length_id, uint32_t stage_idx, RefAnalysis* ref,
std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
BasicBlock* back_blk_ptr = &*new_blocks->back();
InstructionBuilder builder(
@ -567,7 +567,7 @@ void InstBindlessCheckPass::GenDescIdxCheckCode(
std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
// Look for reference through indexed descriptor. If found, analyze and
// save components. If not, return.
ref_analysis ref;
RefAnalysis ref;
if (!AnalyzeDescriptorReference(&*ref_inst_itr, &ref)) return;
Instruction* ptr_inst = get_def_use_mgr()->GetDef(ref.ptr_id);
if (ptr_inst->opcode() != SpvOp::SpvOpAccessChain) return;
@ -626,7 +626,7 @@ void InstBindlessCheckPass::GenDescInitCheckCode(
UptrVectorIterator<BasicBlock> ref_block_itr, uint32_t stage_idx,
std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
// Look for reference through descriptor. If not, return.
ref_analysis ref;
RefAnalysis ref;
if (!AnalyzeDescriptorReference(&*ref_inst_itr, &ref)) return;
// Determine if we can only do initialization check
bool init_check = false;
@ -690,7 +690,7 @@ void InstBindlessCheckPass::GenTexBuffCheckCode(
(op == SpvOpImageWrite && num_in_oprnds == 3)))
return;
// Pull components from descriptor reference
ref_analysis ref;
RefAnalysis ref;
if (!AnalyzeDescriptorReference(ref_inst, &ref)) return;
// Only process if image is texel buffer
Instruction* image_inst = get_def_use_mgr()->GetDef(ref.image_id);

View File

@ -123,7 +123,7 @@ class InstBindlessCheckPass : public InstrumentPass {
// Analysis data for descriptor reference components, generated by
// AnalyzeDescriptorReference. It is necessary and sufficient for further
// analysis and regeneration of the reference.
typedef struct ref_analysis {
typedef struct RefAnalysis {
uint32_t desc_load_id;
uint32_t image_id;
uint32_t load_id;
@ -131,7 +131,7 @@ class InstBindlessCheckPass : public InstrumentPass {
uint32_t var_id;
uint32_t desc_idx_id;
Instruction* ref_inst;
} ref_analysis;
} RefAnalysis;
// Return size of type |ty_id| in bytes. Use |matrix_stride| and |col_major|
// for matrix type, or for vector type if vector is |in_matrix|.
@ -143,7 +143,7 @@ class InstBindlessCheckPass : public InstrumentPass {
uint32_t FindStride(uint32_t ty_id, uint32_t stride_deco);
// Generate index of last byte referenced by buffer reference |ref|
uint32_t GenLastByteIdx(ref_analysis* ref, InstructionBuilder* builder);
uint32_t GenLastByteIdx(RefAnalysis* ref, InstructionBuilder* builder);
// Clone original image computation starting at |image_id| into |builder|.
// This may generate more than one instruction if neccessary.
@ -151,7 +151,7 @@ class InstBindlessCheckPass : public InstrumentPass {
// Clone original original reference encapsulated by |ref| into |builder|.
// This may generate more than one instruction if neccessary.
uint32_t CloneOriginalReference(ref_analysis* ref,
uint32_t CloneOriginalReference(RefAnalysis* ref,
InstructionBuilder* builder);
// If |inst| references through an image, return the id of the image it
@ -163,7 +163,7 @@ class InstBindlessCheckPass : public InstrumentPass {
// Analyze descriptor reference |ref_inst| and save components into |ref|.
// Return true if |ref_inst| is a descriptor reference, false otherwise.
bool AnalyzeDescriptorReference(Instruction* ref_inst, ref_analysis* ref);
bool AnalyzeDescriptorReference(Instruction* ref_inst, RefAnalysis* ref);
// Generate instrumentation code for generic test result |check_id|, starting
// with |builder| of block |new_blk_ptr|, adding new blocks to |new_blocks|.
@ -173,7 +173,7 @@ class InstBindlessCheckPass : public InstrumentPass {
// |stage_idx|. Generate merge block for valid and invalid branches. Kill
// original reference.
void GenCheckCode(uint32_t check_id, uint32_t error_id, uint32_t offset_id,
uint32_t length_id, uint32_t stage_idx, ref_analysis* ref,
uint32_t length_id, uint32_t stage_idx, RefAnalysis* ref,
std::vector<std::unique_ptr<BasicBlock>>* new_blocks);
// Initialize state for instrumenting bindless checking