diff options
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 27 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 28 |
2 files changed, 53 insertions, 2 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 2a3ff234a..35773a695 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -147,11 +147,36 @@ void Maxwell3D::ProcessQueryGet() { | |||
| 147 | // VAddr before writing. | 147 | // VAddr before writing. |
| 148 | VAddr address = memory_manager.PhysicalToVirtualAddress(sequence_address); | 148 | VAddr address = memory_manager.PhysicalToVirtualAddress(sequence_address); |
| 149 | 149 | ||
| 150 | // TODO(Subv): Support the other query units. | ||
| 151 | ASSERT_MSG(regs.query.query_get.unit == Regs::QueryUnit::Crop, | ||
| 152 | "Units other than CROP are unimplemented"); | ||
| 153 | ASSERT_MSG(regs.query.query_get.short_query, | ||
| 154 | "Writing the entire query result structure is unimplemented"); | ||
| 155 | |||
| 156 | u32 value = Memory::Read32(address); | ||
| 157 | u32 result = 0; | ||
| 158 | |||
| 159 | // TODO(Subv): Support the other query variables | ||
| 160 | switch (regs.query.query_get.select) { | ||
| 161 | case Regs::QuerySelect::Zero: | ||
| 162 | result = 0; | ||
| 163 | break; | ||
| 164 | default: | ||
| 165 | UNIMPLEMENTED_MSG("Unimplemented query select type %u", | ||
| 166 | static_cast<u32>(regs.query.query_get.select.Value())); | ||
| 167 | } | ||
| 168 | |||
| 169 | // TODO(Subv): Research and implement how query sync conditions work. | ||
| 170 | |||
| 150 | switch (regs.query.query_get.mode) { | 171 | switch (regs.query.query_get.mode) { |
| 151 | case Regs::QueryMode::Write: { | 172 | case Regs::QueryMode::Write: |
| 173 | case Regs::QueryMode::Write2: { | ||
| 152 | // Write the current query sequence to the sequence address. | 174 | // Write the current query sequence to the sequence address. |
| 153 | u32 sequence = regs.query.query_sequence; | 175 | u32 sequence = regs.query.query_sequence; |
| 154 | Memory::Write32(address, sequence); | 176 | Memory::Write32(address, sequence); |
| 177 | |||
| 178 | // TODO(Subv): Write the proper query response structure to the address when not using short | ||
| 179 | // mode. | ||
| 155 | break; | 180 | break; |
| 156 | } | 181 | } |
| 157 | default: | 182 | default: |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 609504795..a022665eb 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -46,6 +46,29 @@ public: | |||
| 46 | enum class QueryMode : u32 { | 46 | enum class QueryMode : u32 { |
| 47 | Write = 0, | 47 | Write = 0, |
| 48 | Sync = 1, | 48 | Sync = 1, |
| 49 | // TODO(Subv): It is currently unknown what the difference between method 2 and method 0 | ||
| 50 | // is. | ||
| 51 | Write2 = 2, | ||
| 52 | }; | ||
| 53 | |||
| 54 | enum class QueryUnit : u32 { | ||
| 55 | VFetch = 1, | ||
| 56 | VP = 2, | ||
| 57 | Rast = 4, | ||
| 58 | StrmOut = 5, | ||
| 59 | GP = 6, | ||
| 60 | ZCull = 7, | ||
| 61 | Prop = 10, | ||
| 62 | Crop = 15, | ||
| 63 | }; | ||
| 64 | |||
| 65 | enum class QuerySelect : u32 { | ||
| 66 | Zero = 0, | ||
| 67 | }; | ||
| 68 | |||
| 69 | enum class QuerySyncCondition : u32 { | ||
| 70 | NotEqual = 0, | ||
| 71 | GreaterThan = 1, | ||
| 49 | }; | 72 | }; |
| 50 | 73 | ||
| 51 | enum class ShaderProgram : u32 { | 74 | enum class ShaderProgram : u32 { |
| @@ -476,7 +499,10 @@ public: | |||
| 476 | u32 raw; | 499 | u32 raw; |
| 477 | BitField<0, 2, QueryMode> mode; | 500 | BitField<0, 2, QueryMode> mode; |
| 478 | BitField<4, 1, u32> fence; | 501 | BitField<4, 1, u32> fence; |
| 479 | BitField<12, 4, u32> unit; | 502 | BitField<12, 4, QueryUnit> unit; |
| 503 | BitField<16, 1, QuerySyncCondition> sync_cond; | ||
| 504 | BitField<23, 5, QuerySelect> select; | ||
| 505 | BitField<28, 1, u32> short_query; | ||
| 480 | } query_get; | 506 | } query_get; |
| 481 | 507 | ||
| 482 | GPUVAddr QueryAddress() const { | 508 | GPUVAddr QueryAddress() const { |