diff options
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/renderer_opengl/maxwell_to_gl.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h index 2155fb019..392041a1c 100644 --- a/src/video_core/renderer_opengl/maxwell_to_gl.h +++ b/src/video_core/renderer_opengl/maxwell_to_gl.h | |||
| @@ -201,4 +201,54 @@ inline GLenum SwizzleSource(Tegra::Texture::SwizzleSource source) { | |||
| 201 | return {}; | 201 | return {}; |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | inline GLenum ComparisonOp(Maxwell::ComparisonOp comparison) { | ||
| 205 | switch (comparison) { | ||
| 206 | case Maxwell::ComparisonOp::Never: | ||
| 207 | return GL_NEVER; | ||
| 208 | case Maxwell::ComparisonOp::Less: | ||
| 209 | return GL_LESS; | ||
| 210 | case Maxwell::ComparisonOp::Equal: | ||
| 211 | return GL_EQUAL; | ||
| 212 | case Maxwell::ComparisonOp::LessEqual: | ||
| 213 | return GL_LEQUAL; | ||
| 214 | case Maxwell::ComparisonOp::Greater: | ||
| 215 | return GL_GREATER; | ||
| 216 | case Maxwell::ComparisonOp::NotEqual: | ||
| 217 | return GL_NOTEQUAL; | ||
| 218 | case Maxwell::ComparisonOp::GreaterEqual: | ||
| 219 | return GL_GEQUAL; | ||
| 220 | case Maxwell::ComparisonOp::Always: | ||
| 221 | return GL_ALWAYS; | ||
| 222 | } | ||
| 223 | NGLOG_CRITICAL(Render_OpenGL, "Unimplemented comparison op={}", static_cast<u32>(comparison)); | ||
| 224 | UNREACHABLE(); | ||
| 225 | return {}; | ||
| 226 | } | ||
| 227 | |||
| 228 | inline GLenum FrontFace(Maxwell::Cull::FrontFace front_face) { | ||
| 229 | switch (front_face) { | ||
| 230 | case Maxwell::Cull::FrontFace::ClockWise: | ||
| 231 | return GL_CW; | ||
| 232 | case Maxwell::Cull::FrontFace::CounterClockWise: | ||
| 233 | return GL_CCW; | ||
| 234 | } | ||
| 235 | NGLOG_CRITICAL(Render_OpenGL, "Unimplemented front face cull={}", static_cast<u32>(front_face)); | ||
| 236 | UNREACHABLE(); | ||
| 237 | return {}; | ||
| 238 | } | ||
| 239 | |||
| 240 | inline GLenum CullFace(Maxwell::Cull::CullFace cull_face) { | ||
| 241 | switch (cull_face) { | ||
| 242 | case Maxwell::Cull::CullFace::Front: | ||
| 243 | return GL_FRONT; | ||
| 244 | case Maxwell::Cull::CullFace::Back: | ||
| 245 | return GL_BACK; | ||
| 246 | case Maxwell::Cull::CullFace::FrontAndBack: | ||
| 247 | return GL_FRONT_AND_BACK; | ||
| 248 | } | ||
| 249 | NGLOG_CRITICAL(Render_OpenGL, "Unimplemented cull face={}", static_cast<u32>(cull_face)); | ||
| 250 | UNREACHABLE(); | ||
| 251 | return {}; | ||
| 252 | } | ||
| 253 | |||
| 204 | } // namespace MaxwellToGL | 254 | } // namespace MaxwellToGL |