diff options
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 30 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/maxwell_to_gl.h | 8 |
2 files changed, 29 insertions, 9 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index cc1f90de6..5a7cf0107 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -281,14 +281,26 @@ public: | |||
| 281 | }; | 281 | }; |
| 282 | 282 | ||
| 283 | enum class ComparisonOp : u32 { | 283 | enum class ComparisonOp : u32 { |
| 284 | Never = 0, | 284 | // These values are used by Nouveau and most games, they correspond to the OpenGL token |
| 285 | Less = 1, | 285 | // values for these operations. |
| 286 | Equal = 2, | 286 | Never = 0x200, |
| 287 | LessEqual = 3, | 287 | Less = 0x201, |
| 288 | Greater = 4, | 288 | Equal = 0x202, |
| 289 | NotEqual = 5, | 289 | LessEqual = 0x203, |
| 290 | GreaterEqual = 6, | 290 | Greater = 0x204, |
| 291 | Always = 7, | 291 | NotEqual = 0x205, |
| 292 | GreaterEqual = 0x206, | ||
| 293 | Always = 0x207, | ||
| 294 | |||
| 295 | // These values are used by some games, they seem to be NV04 values. | ||
| 296 | NeverOld = 1, | ||
| 297 | LessOld = 2, | ||
| 298 | EqualOld = 3, | ||
| 299 | LessEqualOld = 4, | ||
| 300 | GreaterOld = 5, | ||
| 301 | NotEqualOld = 6, | ||
| 302 | GreaterEqualOld = 7, | ||
| 303 | AlwaysOld = 8, | ||
| 292 | }; | 304 | }; |
| 293 | 305 | ||
| 294 | struct Cull { | 306 | struct Cull { |
| @@ -482,7 +494,7 @@ public: | |||
| 482 | 494 | ||
| 483 | u32 d3d_cull_mode; | 495 | u32 d3d_cull_mode; |
| 484 | 496 | ||
| 485 | BitField<0, 3, ComparisonOp> depth_test_func; | 497 | ComparisonOp depth_test_func; |
| 486 | 498 | ||
| 487 | INSERT_PADDING_WORDS(0xB); | 499 | INSERT_PADDING_WORDS(0xB); |
| 488 | 500 | ||
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h index 6ce53bbd9..e19c3b280 100644 --- a/src/video_core/renderer_opengl/maxwell_to_gl.h +++ b/src/video_core/renderer_opengl/maxwell_to_gl.h | |||
| @@ -211,20 +211,28 @@ inline GLenum SwizzleSource(Tegra::Texture::SwizzleSource source) { | |||
| 211 | inline GLenum ComparisonOp(Maxwell::ComparisonOp comparison) { | 211 | inline GLenum ComparisonOp(Maxwell::ComparisonOp comparison) { |
| 212 | switch (comparison) { | 212 | switch (comparison) { |
| 213 | case Maxwell::ComparisonOp::Never: | 213 | case Maxwell::ComparisonOp::Never: |
| 214 | case Maxwell::ComparisonOp::NeverOld: | ||
| 214 | return GL_NEVER; | 215 | return GL_NEVER; |
| 215 | case Maxwell::ComparisonOp::Less: | 216 | case Maxwell::ComparisonOp::Less: |
| 217 | case Maxwell::ComparisonOp::LessOld: | ||
| 216 | return GL_LESS; | 218 | return GL_LESS; |
| 217 | case Maxwell::ComparisonOp::Equal: | 219 | case Maxwell::ComparisonOp::Equal: |
| 220 | case Maxwell::ComparisonOp::EqualOld: | ||
| 218 | return GL_EQUAL; | 221 | return GL_EQUAL; |
| 219 | case Maxwell::ComparisonOp::LessEqual: | 222 | case Maxwell::ComparisonOp::LessEqual: |
| 223 | case Maxwell::ComparisonOp::LessEqualOld: | ||
| 220 | return GL_LEQUAL; | 224 | return GL_LEQUAL; |
| 221 | case Maxwell::ComparisonOp::Greater: | 225 | case Maxwell::ComparisonOp::Greater: |
| 226 | case Maxwell::ComparisonOp::GreaterOld: | ||
| 222 | return GL_GREATER; | 227 | return GL_GREATER; |
| 223 | case Maxwell::ComparisonOp::NotEqual: | 228 | case Maxwell::ComparisonOp::NotEqual: |
| 229 | case Maxwell::ComparisonOp::NotEqualOld: | ||
| 224 | return GL_NOTEQUAL; | 230 | return GL_NOTEQUAL; |
| 225 | case Maxwell::ComparisonOp::GreaterEqual: | 231 | case Maxwell::ComparisonOp::GreaterEqual: |
| 232 | case Maxwell::ComparisonOp::GreaterEqualOld: | ||
| 226 | return GL_GEQUAL; | 233 | return GL_GEQUAL; |
| 227 | case Maxwell::ComparisonOp::Always: | 234 | case Maxwell::ComparisonOp::Always: |
| 235 | case Maxwell::ComparisonOp::AlwaysOld: | ||
| 228 | return GL_ALWAYS; | 236 | return GL_ALWAYS; |
| 229 | } | 237 | } |
| 230 | LOG_CRITICAL(Render_OpenGL, "Unimplemented comparison op={}", static_cast<u32>(comparison)); | 238 | LOG_CRITICAL(Render_OpenGL, "Unimplemented comparison op={}", static_cast<u32>(comparison)); |