|
|
@ -181,10 +181,10 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { |
|
|
const Node value = |
|
|
const Node value = |
|
|
Operation(OperationCode::TextureQueryDimensions, meta, |
|
|
Operation(OperationCode::TextureQueryDimensions, meta, |
|
|
GetRegister(instr.gpr8.Value() + (is_bindless ? 1 : 0))); |
|
|
GetRegister(instr.gpr8.Value() + (is_bindless ? 1 : 0))); |
|
|
SetTemporal(bb, indexer++, value); |
|
|
|
|
|
|
|
|
SetTemporary(bb, indexer++, value); |
|
|
} |
|
|
} |
|
|
for (u32 i = 0; i < indexer; ++i) { |
|
|
for (u32 i = 0; i < indexer; ++i) { |
|
|
SetRegister(bb, instr.gpr0.Value() + i, GetTemporal(i)); |
|
|
|
|
|
|
|
|
SetRegister(bb, instr.gpr0.Value() + i, GetTemporary(i)); |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
@ -238,10 +238,10 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { |
|
|
auto params = coords; |
|
|
auto params = coords; |
|
|
MetaTexture meta{sampler, {}, {}, {}, {}, {}, {}, element}; |
|
|
MetaTexture meta{sampler, {}, {}, {}, {}, {}, {}, element}; |
|
|
const Node value = Operation(OperationCode::TextureQueryLod, meta, std::move(params)); |
|
|
const Node value = Operation(OperationCode::TextureQueryLod, meta, std::move(params)); |
|
|
SetTemporal(bb, indexer++, value); |
|
|
|
|
|
|
|
|
SetTemporary(bb, indexer++, value); |
|
|
} |
|
|
} |
|
|
for (u32 i = 0; i < indexer; ++i) { |
|
|
for (u32 i = 0; i < indexer; ++i) { |
|
|
SetRegister(bb, instr.gpr0.Value() + i, GetTemporal(i)); |
|
|
|
|
|
|
|
|
SetRegister(bb, instr.gpr0.Value() + i, GetTemporary(i)); |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
@ -336,11 +336,11 @@ void ShaderIR::WriteTexInstructionFloat(NodeBlock& bb, Instruction instr, const |
|
|
// Skip disabled components
|
|
|
// Skip disabled components
|
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
SetTemporal(bb, dest_elem++, components[elem]); |
|
|
|
|
|
|
|
|
SetTemporary(bb, dest_elem++, components[elem]); |
|
|
} |
|
|
} |
|
|
// After writing values in temporals, move them to the real registers
|
|
|
// After writing values in temporals, move them to the real registers
|
|
|
for (u32 i = 0; i < dest_elem; ++i) { |
|
|
for (u32 i = 0; i < dest_elem; ++i) { |
|
|
SetRegister(bb, instr.gpr0.Value() + i, GetTemporal(i)); |
|
|
|
|
|
|
|
|
SetRegister(bb, instr.gpr0.Value() + i, GetTemporary(i)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -353,17 +353,17 @@ void ShaderIR::WriteTexsInstructionFloat(NodeBlock& bb, Instruction instr, |
|
|
for (u32 component = 0; component < 4; ++component) { |
|
|
for (u32 component = 0; component < 4; ++component) { |
|
|
if (!instr.texs.IsComponentEnabled(component)) |
|
|
if (!instr.texs.IsComponentEnabled(component)) |
|
|
continue; |
|
|
continue; |
|
|
SetTemporal(bb, dest_elem++, components[component]); |
|
|
|
|
|
|
|
|
SetTemporary(bb, dest_elem++, components[component]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
for (u32 i = 0; i < dest_elem; ++i) { |
|
|
for (u32 i = 0; i < dest_elem; ++i) { |
|
|
if (i < 2) { |
|
|
if (i < 2) { |
|
|
// Write the first two swizzle components to gpr0 and gpr0+1
|
|
|
// Write the first two swizzle components to gpr0 and gpr0+1
|
|
|
SetRegister(bb, instr.gpr0.Value() + i % 2, GetTemporal(i)); |
|
|
|
|
|
|
|
|
SetRegister(bb, instr.gpr0.Value() + i % 2, GetTemporary(i)); |
|
|
} else { |
|
|
} else { |
|
|
ASSERT(instr.texs.HasTwoDestinations()); |
|
|
ASSERT(instr.texs.HasTwoDestinations()); |
|
|
// Write the rest of the swizzle components to gpr28 and gpr28+1
|
|
|
// Write the rest of the swizzle components to gpr28 and gpr28+1
|
|
|
SetRegister(bb, instr.gpr28.Value() + i % 2, GetTemporal(i)); |
|
|
|
|
|
|
|
|
SetRegister(bb, instr.gpr28.Value() + i % 2, GetTemporary(i)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -391,11 +391,11 @@ void ShaderIR::WriteTexsInstructionHalfFloat(NodeBlock& bb, Instruction instr, |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
SetTemporal(bb, 0, first_value); |
|
|
|
|
|
SetTemporal(bb, 1, Operation(OperationCode::HPack2, values[2], values[3])); |
|
|
|
|
|
|
|
|
SetTemporary(bb, 0, first_value); |
|
|
|
|
|
SetTemporary(bb, 1, Operation(OperationCode::HPack2, values[2], values[3])); |
|
|
|
|
|
|
|
|
SetRegister(bb, instr.gpr0, GetTemporal(0)); |
|
|
|
|
|
SetRegister(bb, instr.gpr28, GetTemporal(1)); |
|
|
|
|
|
|
|
|
SetRegister(bb, instr.gpr0, GetTemporary(0)); |
|
|
|
|
|
SetRegister(bb, instr.gpr28, GetTemporary(1)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Node4 ShaderIR::GetTextureCode(Instruction instr, TextureType texture_type, |
|
|
Node4 ShaderIR::GetTextureCode(Instruction instr, TextureType texture_type, |
|
|
|