maxwell_3d: Flatten cull and front face registers
This commit is contained in:
parent
eed789d0d1
commit
9e74e6988b
8 changed files with 47 additions and 50 deletions
|
@ -945,10 +945,10 @@ void RasterizerOpenGL::SyncClipCoef() {
|
|||
void RasterizerOpenGL::SyncCullMode() {
|
||||
const auto& regs = system.GPU().Maxwell3D().regs;
|
||||
|
||||
oglEnable(GL_CULL_FACE, regs.cull.enabled);
|
||||
glCullFace(MaxwellToGL::CullFace(regs.cull.cull_face));
|
||||
oglEnable(GL_CULL_FACE, regs.cull_test_enabled);
|
||||
glCullFace(MaxwellToGL::CullFace(regs.cull_face));
|
||||
|
||||
glFrontFace(MaxwellToGL::FrontFace(regs.cull.front_face));
|
||||
glFrontFace(MaxwellToGL::FrontFace(regs.front_face));
|
||||
}
|
||||
|
||||
void RasterizerOpenGL::SyncPrimitiveRestart() {
|
||||
|
|
|
@ -401,24 +401,24 @@ inline GLenum StencilOp(Maxwell::StencilOp stencil) {
|
|||
return GL_KEEP;
|
||||
}
|
||||
|
||||
inline GLenum FrontFace(Maxwell::Cull::FrontFace front_face) {
|
||||
inline GLenum FrontFace(Maxwell::FrontFace front_face) {
|
||||
switch (front_face) {
|
||||
case Maxwell::Cull::FrontFace::ClockWise:
|
||||
case Maxwell::FrontFace::ClockWise:
|
||||
return GL_CW;
|
||||
case Maxwell::Cull::FrontFace::CounterClockWise:
|
||||
case Maxwell::FrontFace::CounterClockWise:
|
||||
return GL_CCW;
|
||||
}
|
||||
LOG_ERROR(Render_OpenGL, "Unimplemented front face cull={}", static_cast<u32>(front_face));
|
||||
return GL_CCW;
|
||||
}
|
||||
|
||||
inline GLenum CullFace(Maxwell::Cull::CullFace cull_face) {
|
||||
inline GLenum CullFace(Maxwell::CullFace cull_face) {
|
||||
switch (cull_face) {
|
||||
case Maxwell::Cull::CullFace::Front:
|
||||
case Maxwell::CullFace::Front:
|
||||
return GL_FRONT;
|
||||
case Maxwell::Cull::CullFace::Back:
|
||||
case Maxwell::CullFace::Back:
|
||||
return GL_BACK;
|
||||
case Maxwell::Cull::CullFace::FrontAndBack:
|
||||
case Maxwell::CullFace::FrontAndBack:
|
||||
return GL_FRONT_AND_BACK;
|
||||
}
|
||||
LOG_ERROR(Render_OpenGL, "Unimplemented cull face={}", static_cast<u32>(cull_face));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue