[GPU] Disassemble memexport exports
This commit is contained in:
@@ -31,6 +31,10 @@ enum class InstructionStorageTarget {
|
|||||||
kPosition,
|
kPosition,
|
||||||
// Result is stored to the point size export (gl_PointSize).
|
// Result is stored to the point size export (gl_PointSize).
|
||||||
kPointSize,
|
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].
|
// Result is stored to a color target export indexed by storage_index [0-3].
|
||||||
kColorTarget,
|
kColorTarget,
|
||||||
// Result is stored to the depth export (gl_FragDepth).
|
// Result is stored to the depth export (gl_FragDepth).
|
||||||
|
|||||||
@@ -1147,14 +1147,15 @@ void ShaderTranslator::ParseAluVectorInstruction(
|
|||||||
} else if (is_vertex_shader()) {
|
} else if (is_vertex_shader()) {
|
||||||
switch (dest_num) {
|
switch (dest_num) {
|
||||||
case 32:
|
case 32:
|
||||||
|
i.result.storage_target = InstructionStorageTarget::kExportAddress;
|
||||||
|
break;
|
||||||
case 33:
|
case 33:
|
||||||
case 34:
|
case 34:
|
||||||
case 35:
|
case 35:
|
||||||
case 36:
|
case 36:
|
||||||
case 37:
|
case 37:
|
||||||
// TODO: Memexport registers
|
i.result.storage_index = dest_num - 33;
|
||||||
i.result.storage_target = InstructionStorageTarget::kNone;
|
i.result.storage_target = InstructionStorageTarget::kExportData;
|
||||||
i.result.storage_index = 0;
|
|
||||||
break;
|
break;
|
||||||
case 62:
|
case 62:
|
||||||
i.result.storage_target = InstructionStorageTarget::kPosition;
|
i.result.storage_target = InstructionStorageTarget::kPosition;
|
||||||
@@ -1198,14 +1199,15 @@ void ShaderTranslator::ParseAluVectorInstruction(
|
|||||||
i.result.storage_index = 3;
|
i.result.storage_index = 3;
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
|
i.result.storage_target = InstructionStorageTarget::kExportAddress;
|
||||||
|
break;
|
||||||
case 33:
|
case 33:
|
||||||
case 34:
|
case 34:
|
||||||
case 35:
|
case 35:
|
||||||
case 36:
|
case 36:
|
||||||
case 37:
|
case 37:
|
||||||
// TODO: Memexport registers
|
i.result.storage_index = dest_num - 33;
|
||||||
i.result.storage_target = InstructionStorageTarget::kNone;
|
i.result.storage_target = InstructionStorageTarget::kExportData;
|
||||||
i.result.storage_index = 0;
|
|
||||||
break;
|
break;
|
||||||
case 61:
|
case 61:
|
||||||
i.result.storage_target = InstructionStorageTarget::kDepth;
|
i.result.storage_target = InstructionStorageTarget::kDepth;
|
||||||
@@ -1303,6 +1305,17 @@ void ShaderTranslator::ParseAluScalarInstruction(
|
|||||||
: InstructionStorageAddressingMode::kStatic;
|
: InstructionStorageAddressingMode::kStatic;
|
||||||
} else if (is_vertex_shader()) {
|
} else if (is_vertex_shader()) {
|
||||||
switch (dest_num) {
|
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:
|
case 62:
|
||||||
i.result.storage_target = InstructionStorageTarget::kPosition;
|
i.result.storage_target = InstructionStorageTarget::kPosition;
|
||||||
break;
|
break;
|
||||||
@@ -1344,6 +1357,17 @@ void ShaderTranslator::ParseAluScalarInstruction(
|
|||||||
i.result.storage_target = InstructionStorageTarget::kColorTarget;
|
i.result.storage_target = InstructionStorageTarget::kColorTarget;
|
||||||
i.result.storage_index = 3;
|
i.result.storage_index = 3;
|
||||||
break;
|
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:
|
case 61:
|
||||||
i.result.storage_target = InstructionStorageTarget::kDepth;
|
i.result.storage_target = InstructionStorageTarget::kDepth;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -38,6 +38,13 @@ void DisassembleResultOperand(const InstructionResult& result,
|
|||||||
case InstructionStorageTarget::kPointSize:
|
case InstructionStorageTarget::kPointSize:
|
||||||
out->Append("oPts");
|
out->Append("oPts");
|
||||||
break;
|
break;
|
||||||
|
case InstructionStorageTarget::kExportAddress:
|
||||||
|
out->Append("eA");
|
||||||
|
break;
|
||||||
|
case InstructionStorageTarget::kExportData:
|
||||||
|
out->Append("eM");
|
||||||
|
uses_storage_index = true;
|
||||||
|
break;
|
||||||
case InstructionStorageTarget::kColorTarget:
|
case InstructionStorageTarget::kColorTarget:
|
||||||
out->AppendFormat("oC");
|
out->AppendFormat("oC");
|
||||||
uses_storage_index = true;
|
uses_storage_index = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user