Prefix all size_t with std::
done automatically by executing regex replace `([^:0-9a-zA-Z_])size_t([^0-9a-zA-Z_])` -> `$1std::size_t$2`
This commit is contained in:
parent
eca98eeb3e
commit
7d8f115185
158 changed files with 669 additions and 634 deletions
|
@ -24,9 +24,9 @@ namespace Shader {
|
|||
void OutputVertex::ValidateSemantics(const RasterizerRegs& regs) {
|
||||
unsigned int num_attributes = regs.vs_output_total;
|
||||
ASSERT(num_attributes <= 7);
|
||||
for (size_t attrib = 0; attrib < num_attributes; ++attrib) {
|
||||
for (std::size_t attrib = 0; attrib < num_attributes; ++attrib) {
|
||||
u32 output_register_map = regs.vs_output_attributes[attrib].raw;
|
||||
for (size_t comp = 0; comp < 4; ++comp) {
|
||||
for (std::size_t comp = 0; comp < 4; ++comp) {
|
||||
u32 semantic = (output_register_map >> (8 * comp)) & 0x1F;
|
||||
ASSERT_MSG(semantic < 24 || semantic == RasterizerRegs::VSOutputAttributes::INVALID,
|
||||
"Invalid/unknown semantic id: {}", semantic);
|
||||
|
@ -50,7 +50,7 @@ OutputVertex OutputVertex::FromAttributeBuffer(const RasterizerRegs& regs,
|
|||
"Struct and array have different sizes.");
|
||||
|
||||
unsigned int num_attributes = regs.vs_output_total & 7;
|
||||
for (size_t attrib = 0; attrib < num_attributes; ++attrib) {
|
||||
for (std::size_t attrib = 0; attrib < num_attributes; ++attrib) {
|
||||
const auto output_register_map = regs.vs_output_attributes[attrib];
|
||||
vertex_slots_overflow[output_register_map.map_x] = input.attr[attrib][0];
|
||||
vertex_slots_overflow[output_register_map.map_y] = input.attr[attrib][1];
|
||||
|
@ -117,7 +117,7 @@ void GSEmitter::Emit(Math::Vec4<float24> (&output_regs)[16]) {
|
|||
if (prim_emit) {
|
||||
if (winding)
|
||||
handlers->winding_setter();
|
||||
for (size_t i = 0; i < buffer.size(); ++i) {
|
||||
for (std::size_t i = 0; i < buffer.size(); ++i) {
|
||||
handlers->vertex_handler(buffer[i]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ struct UnitState {
|
|||
|
||||
GSEmitter* emitter_ptr;
|
||||
|
||||
static size_t InputOffset(const SourceRegister& reg) {
|
||||
static std::size_t InputOffset(const SourceRegister& reg) {
|
||||
switch (reg.GetRegisterType()) {
|
||||
case RegisterType::Input:
|
||||
return offsetof(UnitState, registers.input) +
|
||||
|
@ -134,7 +134,7 @@ struct UnitState {
|
|||
}
|
||||
}
|
||||
|
||||
static size_t OutputOffset(const DestRegister& reg) {
|
||||
static std::size_t OutputOffset(const DestRegister& reg) {
|
||||
switch (reg.GetRegisterType()) {
|
||||
case RegisterType::Output:
|
||||
return offsetof(UnitState, registers.output) +
|
||||
|
@ -182,15 +182,15 @@ struct Uniforms {
|
|||
std::array<bool, 16> b;
|
||||
std::array<Math::Vec4<u8>, 4> i;
|
||||
|
||||
static size_t GetFloatUniformOffset(unsigned index) {
|
||||
static std::size_t GetFloatUniformOffset(unsigned index) {
|
||||
return offsetof(Uniforms, f) + index * sizeof(Math::Vec4<float24>);
|
||||
}
|
||||
|
||||
static size_t GetBoolUniformOffset(unsigned index) {
|
||||
static std::size_t GetBoolUniformOffset(unsigned index) {
|
||||
return offsetof(Uniforms, b) + index * sizeof(bool);
|
||||
}
|
||||
|
||||
static size_t GetIntUniformOffset(unsigned index) {
|
||||
static std::size_t GetIntUniformOffset(unsigned index) {
|
||||
return offsetof(Uniforms, i) + index * sizeof(Math::Vec4<u8>);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -166,7 +166,7 @@ static void LogCritical(const char* msg) {
|
|||
|
||||
void JitShader::Compile_Assert(bool condition, const char* msg) {
|
||||
if (!condition) {
|
||||
mov(ABI_PARAM1, reinterpret_cast<size_t>(msg));
|
||||
mov(ABI_PARAM1, reinterpret_cast<std::size_t>(msg));
|
||||
CallFarFunction(*this, LogCritical);
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ void JitShader::Compile_Assert(bool condition, const char* msg) {
|
|||
void JitShader::Compile_SwizzleSrc(Instruction instr, unsigned src_num, SourceRegister src_reg,
|
||||
Xmm dest) {
|
||||
Reg64 src_ptr;
|
||||
size_t src_offset;
|
||||
std::size_t src_offset;
|
||||
|
||||
if (src_reg.GetRegisterType() == RegisterType::FloatUniform) {
|
||||
src_ptr = UNIFORMS;
|
||||
|
@ -266,7 +266,7 @@ void JitShader::Compile_DestEnable(Instruction instr, Xmm src) {
|
|||
|
||||
SwizzlePattern swiz = {(*swizzle_data)[operand_desc_id]};
|
||||
|
||||
size_t dest_offset_disp = UnitState::OutputOffset(dest);
|
||||
std::size_t dest_offset_disp = UnitState::OutputOffset(dest);
|
||||
|
||||
// If all components are enabled, write the result to the destination register
|
||||
if (swiz.dest_mask == NO_DEST_REG_MASK) {
|
||||
|
@ -354,7 +354,7 @@ void JitShader::Compile_EvaluateCondition(Instruction instr) {
|
|||
}
|
||||
|
||||
void JitShader::Compile_UniformCondition(Instruction instr) {
|
||||
size_t offset = Uniforms::GetBoolUniformOffset(instr.flow_control.bool_uniform_id);
|
||||
std::size_t offset = Uniforms::GetBoolUniformOffset(instr.flow_control.bool_uniform_id);
|
||||
cmp(byte[UNIFORMS + offset], 0);
|
||||
}
|
||||
|
||||
|
@ -733,7 +733,7 @@ void JitShader::Compile_LOOP(Instruction instr) {
|
|||
// This decodes the fields from the integer uniform at index instr.flow_control.int_uniform_id.
|
||||
// The Y (LOOPCOUNT_REG) and Z (LOOPINC) component are kept multiplied by 16 (Left shifted by
|
||||
// 4 bits) to be used as an offset into the 16-byte vector registers later
|
||||
size_t offset = Uniforms::GetIntUniformOffset(instr.flow_control.int_uniform_id);
|
||||
std::size_t offset = Uniforms::GetIntUniformOffset(instr.flow_control.int_uniform_id);
|
||||
mov(LOOPCOUNT, dword[UNIFORMS + offset]);
|
||||
mov(LOOPCOUNT_REG, LOOPCOUNT);
|
||||
shr(LOOPCOUNT_REG, 4);
|
||||
|
@ -789,7 +789,7 @@ void JitShader::Compile_EMIT(Instruction instr) {
|
|||
jnz(have_emitter);
|
||||
|
||||
ABI_PushRegistersAndAdjustStack(*this, PersistentCallerSavedRegs(), 0);
|
||||
mov(ABI_PARAM1, reinterpret_cast<size_t>("Execute EMIT on VS"));
|
||||
mov(ABI_PARAM1, reinterpret_cast<std::size_t>("Execute EMIT on VS"));
|
||||
CallFarFunction(*this, LogCritical);
|
||||
ABI_PopRegistersAndAdjustStack(*this, PersistentCallerSavedRegs(), 0);
|
||||
jmp(end);
|
||||
|
@ -811,7 +811,7 @@ void JitShader::Compile_SETE(Instruction instr) {
|
|||
jnz(have_emitter);
|
||||
|
||||
ABI_PushRegistersAndAdjustStack(*this, PersistentCallerSavedRegs(), 0);
|
||||
mov(ABI_PARAM1, reinterpret_cast<size_t>("Execute SETEMIT on VS"));
|
||||
mov(ABI_PARAM1, reinterpret_cast<std::size_t>("Execute SETEMIT on VS"));
|
||||
CallFarFunction(*this, LogCritical);
|
||||
ABI_PopRegistersAndAdjustStack(*this, PersistentCallerSavedRegs(), 0);
|
||||
jmp(end);
|
||||
|
@ -866,7 +866,7 @@ void JitShader::Compile_NextInstr() {
|
|||
void JitShader::FindReturnOffsets() {
|
||||
return_offsets.clear();
|
||||
|
||||
for (size_t offset = 0; offset < program_code->size(); ++offset) {
|
||||
for (std::size_t offset = 0; offset < program_code->size(); ++offset) {
|
||||
Instruction instr = {(*program_code)[offset]};
|
||||
|
||||
switch (instr.opcode.Value()) {
|
||||
|
@ -922,12 +922,12 @@ void JitShader::Compile(const std::array<u32, MAX_PROGRAM_CODE_LENGTH>* program_
|
|||
|
||||
// Used to set a register to one
|
||||
static const __m128 one = {1.f, 1.f, 1.f, 1.f};
|
||||
mov(rax, reinterpret_cast<size_t>(&one));
|
||||
mov(rax, reinterpret_cast<std::size_t>(&one));
|
||||
movaps(ONE, xword[rax]);
|
||||
|
||||
// Used to negate registers
|
||||
static const __m128 neg = {-0.f, -0.f, -0.f, -0.f};
|
||||
mov(rax, reinterpret_cast<size_t>(&neg));
|
||||
mov(rax, reinterpret_cast<std::size_t>(&neg));
|
||||
movaps(NEGBIT, xword[rax]);
|
||||
|
||||
// Jump to start of the shader program
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace Pica {
|
|||
namespace Shader {
|
||||
|
||||
/// Memory allocated for each compiled shader
|
||||
constexpr size_t MAX_SHADER_SIZE = MAX_PROGRAM_CODE_LENGTH * 64;
|
||||
constexpr std::size_t MAX_SHADER_SIZE = MAX_PROGRAM_CODE_LENGTH * 64;
|
||||
|
||||
/**
|
||||
* This class implements the shader JIT compiler. It recompiles a Pica shader program into x86_64
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue