[GPU] Disassemble memexport exports

This commit is contained in:
DrChat 2018-04-08 18:02:39 -05:00
parent 1d4fa80eac
commit e6524aa497
3 changed files with 41 additions and 6 deletions

View File

@ -31,6 +31,10 @@ enum class InstructionStorageTarget {
kPosition,
// Result is stored to the point size export (gl_PointSize).
kPointSize,
// Result is stored as memexport destination address.
kExportAddress,
// Result is stored to memexport destination data.
kExportData,
// Result is stored to a color target export indexed by storage_index [0-3].
kColorTarget,
// Result is stored to the depth export (gl_FragDepth).

View File

@ -1147,14 +1147,15 @@ void ShaderTranslator::ParseAluVectorInstruction(
} else if (is_vertex_shader()) {
switch (dest_num) {
case 32:
i.result.storage_target = InstructionStorageTarget::kExportAddress;
break;
case 33:
case 34:
case 35:
case 36:
case 37:
// TODO: Memexport registers
i.result.storage_target = InstructionStorageTarget::kNone;
i.result.storage_index = 0;
i.result.storage_index = dest_num - 33;
i.result.storage_target = InstructionStorageTarget::kExportData;
break;
case 62:
i.result.storage_target = InstructionStorageTarget::kPosition;
@ -1198,14 +1199,15 @@ void ShaderTranslator::ParseAluVectorInstruction(
i.result.storage_index = 3;
break;
case 32:
i.result.storage_target = InstructionStorageTarget::kExportAddress;
break;
case 33:
case 34:
case 35:
case 36:
case 37:
// TODO: Memexport registers
i.result.storage_target = InstructionStorageTarget::kNone;
i.result.storage_index = 0;
i.result.storage_index = dest_num - 33;
i.result.storage_target = InstructionStorageTarget::kExportData;
break;
case 61:
i.result.storage_target = InstructionStorageTarget::kDepth;
@ -1303,6 +1305,17 @@ void ShaderTranslator::ParseAluScalarInstruction(
: InstructionStorageAddressingMode::kStatic;
} else if (is_vertex_shader()) {
switch (dest_num) {
case 32:
i.result.storage_target = InstructionStorageTarget::kExportAddress;
break;
case 33:
case 34:
case 35:
case 36:
case 37:
i.result.storage_index = dest_num - 33;
i.result.storage_target = InstructionStorageTarget::kExportData;
break;
case 62:
i.result.storage_target = InstructionStorageTarget::kPosition;
break;
@ -1344,6 +1357,17 @@ void ShaderTranslator::ParseAluScalarInstruction(
i.result.storage_target = InstructionStorageTarget::kColorTarget;
i.result.storage_index = 3;
break;
case 32:
i.result.storage_target = InstructionStorageTarget::kExportAddress;
break;
case 33:
case 34:
case 35:
case 36:
case 37:
i.result.storage_index = dest_num - 33;
i.result.storage_target = InstructionStorageTarget::kExportData;
break;
case 61:
i.result.storage_target = InstructionStorageTarget::kDepth;
break;

View File

@ -38,6 +38,13 @@ void DisassembleResultOperand(const InstructionResult& result,
case InstructionStorageTarget::kPointSize:
out->Append("oPts");
break;
case InstructionStorageTarget::kExportAddress:
out->Append("eA");
break;
case InstructionStorageTarget::kExportData:
out->Append("eM");
uses_storage_index = true;
break;
case InstructionStorageTarget::kColorTarget:
out->AppendFormat("oC");
uses_storage_index = true;