r600_bytecode_tex tex;
memset(&tex, 0, sizeof(struct r600_bytecode_tex));
tex.op = tex_instr.opcode();
- tex.sampler_id = tex_instr.resource_base();
- tex.resource_id = tex_instr.resource_id();
+ tex.sampler_id = tex_instr.resource_id();
+ tex.resource_id = tex_instr.texture_id();
tex.src_gpr = tex_instr.src().sel();
tex.dst_gpr = tex_instr.dst().sel();
tex.dst_sel_x = tex_instr.dest_swizzle(0);
struct r600_bytecode_vtx vtx;
memset(&vtx, 0, sizeof(vtx));
vtx.op = fetch_instr.opcode();
- vtx.buffer_id = fetch_instr.resource_base();
+ vtx.buffer_id = fetch_instr.resource_id();
vtx.fetch_type = fetch_instr.fetch_type();
vtx.src_gpr = fetch_instr.src().sel();
vtx.src_sel_x = fetch_instr.src().chan();
EBufferIndexMode index_mode = get_index_mode(instr, 1);
- int rat_idx = instr.resource_base();
+ int rat_idx = instr.resource_id();
memset(&gds, 0, sizeof(struct r600_bytecode_gds));
memset(&gds, 0, sizeof(struct r600_bytecode_gds));
gds.op = ds_opcode_map.at(instr.opcode());
- gds.uav_id = instr.resource_base();
+ gds.uav_id = instr.resource_id();
gds.uav_index_mode = index_mode;
gds.src_gpr = instr.src().sel();
EBufferIndexMode AssamblerVisitor::get_index_mode(const Resource& res,
unsigned idx)
{
- EBufferIndexMode index_mode = res.buffer_index_mode();
+ EBufferIndexMode index_mode = res.resource_index_mode();
if (index_mode == bim_none && res.resource_offset())
index_mode = emit_index_reg(*res.resource_offset(), idx);
return !m_offset && !other.m_offset;
}
- auto resource_base() const { return m_base; }
+ auto resource_id() const { return m_base; }
auto resource_offset() const { return m_offset; }
- auto buffer_index_mode() const -> EBufferIndexMode
+ auto resource_index_mode() const -> EBufferIndexMode
{
if (!m_offset || !m_offset->has_flag(Register::addr_or_idx))
return bim_none;
m_num_format == rhs.m_num_format && m_endian_swap == rhs.m_endian_swap &&
m_mega_fetch_count == rhs.m_mega_fetch_count &&
m_array_base == rhs.m_array_base && m_array_size == rhs.m_array_size &&
- m_elm_size == rhs.m_elm_size && resource_base() == rhs.resource_base();
+ m_elm_size == rhs.m_elm_size && resource_id() == rhs.resource_id();
}
bool
}
if (m_opcode != vc_read_scratch)
- os << " RID:" << resource_base();
+ os << " RID:" << resource_id();
print_resource_offset(os);
else
os << "___";
os << " " << m_src;
- os << " BASE:" << resource_base();
+ os << " BASE:" << resource_id();
print_resource_offset(os);
}
void
RatInstr::do_print(std::ostream& os) const
{
- os << "MEM_RAT RAT " << resource_base();
+ os << "MEM_RAT RAT " << resource_id();
print_resource_offset(os);
os << " @" << m_index;
os << " OP:" << m_rat_op << " " << m_data;
if (m_coord_offset[i] != lhs.m_coord_offset[i])
return false;
}
- return m_inst_mode == lhs.m_inst_mode && resource_base() == lhs.resource_base() &&
+ return m_inst_mode == lhs.m_inst_mode && resource_id() == lhs.resource_id() &&
m_resource_id == lhs.m_resource_id;
}
os << " : ";
m_src.print(os);
- os << " RID:" << m_resource_id << " SID:" << resource_base();
+ os << " RID:" << m_resource_id << " SID:" << resource_id();
if (resource_offset())
os << " SO:" << *resource_offset();
auto& src() { return m_src; }
unsigned opcode() const { return m_opcode; }
- unsigned resource_id() const { return m_resource_id; }
+ unsigned texture_id() const { return m_resource_id; }
void set_offset(unsigned index, int32_t val);
int get_offset(unsigned index) const;
EXPECT_EQ(tex.dest_swizzle(i), i);
}
- EXPECT_EQ(tex.resource_base(), 1);
- EXPECT_EQ(tex.resource_id(), 17);
+ EXPECT_EQ(tex.resource_id(), 1);
+ EXPECT_EQ(tex.texture_id(), 17);
EXPECT_TRUE(tex.end_group());
EXPECT_EQ(tex.dest_swizzle(i), i);
}
- EXPECT_EQ(tex.resource_base(), 2);
- EXPECT_EQ(tex.resource_id(), 19);
+ EXPECT_EQ(tex.resource_id(), 2);
+ EXPECT_EQ(tex.texture_id(), 19);
for (int i = 0; i < 3; ++i)
EXPECT_EQ(tex.get_offset(i), 0);
EXPECT_EQ(fetch.src(), Register(201, 2, pin_none));
EXPECT_EQ(fetch.src_offset(), 0);
- EXPECT_EQ(fetch.resource_base(), 1);
+ EXPECT_EQ(fetch.resource_id(), 1);
EXPECT_FALSE(fetch.resource_offset());
EXPECT_EQ(fetch.fetch_type(), vertex_data);
EXPECT_EQ(fetch.src(), Register(202, 3, pin_none));
EXPECT_EQ(fetch.src_offset(), 1);
- EXPECT_EQ(fetch.resource_base(), 3);
+ EXPECT_EQ(fetch.resource_id(), 3);
EXPECT_EQ(*fetch.resource_offset(), Register(300, 1, pin_none));
EXPECT_EQ(fetch.fetch_type(), no_index_offset);