Skip to content

Commit

Permalink
Implement IMAGE_GATHER4 and IMAGE_GATHER4_O (#1939)
Browse files Browse the repository at this point in the history
* Implement IMAGE_GATHER4_O

Used by The Last of Us Remastered.

* Fix type on IMAGE_GATHER4_C_LZ

Had a different set of types compared to the other IMAGE_GATHER4 ops.

* IMAGE_GATHER4
  • Loading branch information
StevenMiller123 authored Dec 28, 2024
1 parent 49ffb7b commit 122fe22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/shader_recompiler/frontend/format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3565,8 +3565,8 @@ constexpr std::array<InstFormat, 112> InstructionFormatMIMG = {{
{InstClass::VectorMemImgSmp, InstCategory::VectorMemory, 4, 1, ScalarType::Float32,
ScalarType::Float32},
// 64 = IMAGE_GATHER4
{InstClass::VectorMemImgSmp, InstCategory::VectorMemory, 4, 1, ScalarType::Undefined,
ScalarType::Undefined},
{InstClass::VectorMemImgSmp, InstCategory::VectorMemory, 4, 1, ScalarType::Uint32,
ScalarType::Float32},
// 65 = IMAGE_GATHER4_CL
{InstClass::VectorMemImgSmp, InstCategory::VectorMemory, 4, 1, ScalarType::Undefined,
ScalarType::Undefined},
Expand Down Expand Up @@ -3603,10 +3603,10 @@ constexpr std::array<InstFormat, 112> InstructionFormatMIMG = {{
ScalarType::Undefined},
// 79 = IMAGE_GATHER4_C_LZ
{InstClass::VectorMemImgSmp, InstCategory::VectorMemory, 4, 1, ScalarType::Uint32,
ScalarType::Uint32},
ScalarType::Float32},
// 80 = IMAGE_GATHER4_O
{InstClass::VectorMemImgSmp, InstCategory::VectorMemory, 4, 1, ScalarType::Undefined,
ScalarType::Undefined},
{InstClass::VectorMemImgSmp, InstCategory::VectorMemory, 4, 1, ScalarType::Uint32,
ScalarType::Float32},
// 81 = IMAGE_GATHER4_CL_O
{InstClass::VectorMemImgSmp, InstCategory::VectorMemory, 4, 1, ScalarType::Undefined,
ScalarType::Undefined},
Expand Down
2 changes: 2 additions & 0 deletions src/shader_recompiler/frontend/translate/vector_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ void Translator::EmitVectorMemory(const GcnInst& inst) {
return IMAGE_SAMPLE(inst);

// Image gather operations
case Opcode::IMAGE_GATHER4:
case Opcode::IMAGE_GATHER4_LZ:
case Opcode::IMAGE_GATHER4_C:
case Opcode::IMAGE_GATHER4_O:
case Opcode::IMAGE_GATHER4_C_O:
case Opcode::IMAGE_GATHER4_C_LZ:
case Opcode::IMAGE_GATHER4_LZ_O:
Expand Down

0 comments on commit 122fe22

Please sign in to comment.