mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-04 23:55:08 +01:00
Implement Maxwell3D Front Face Flip
This commit is contained in:
parent
40a3887695
commit
80ae7b255a
@ -1043,6 +1043,7 @@ namespace skyline::gpu::interconnect {
|
||||
vk::CullModeFlags cullMode{}; //!< The current cull mode regardless of it being enabled or disabled
|
||||
vk::PipelineRasterizationProvokingVertexStateCreateInfoEXT provokingVertexState{};
|
||||
bool depthBiasPoint{}, depthBiasLine{}, depthBiasFill{};
|
||||
bool frontFaceFlip{}; //!< If the front face has to be flipped from what is supplied in SetFrontFace()
|
||||
|
||||
public:
|
||||
void SetDepthClampEnabled(bool enabled) {
|
||||
@ -1078,16 +1079,29 @@ namespace skyline::gpu::interconnect {
|
||||
}
|
||||
|
||||
void SetFrontFace(maxwell3d::FrontFace face) {
|
||||
rasterizerState.get<vk::PipelineRasterizationStateCreateInfo>().frontFace = [face]() {
|
||||
rasterizerState.get<vk::PipelineRasterizationStateCreateInfo>().frontFace = [&]() {
|
||||
switch (face) {
|
||||
case maxwell3d::FrontFace::Clockwise:
|
||||
return vk::FrontFace::eClockwise;
|
||||
return frontFaceFlip ? vk::FrontFace::eCounterClockwise : vk::FrontFace::eClockwise;
|
||||
case maxwell3d::FrontFace::CounterClockwise:
|
||||
return vk::FrontFace::eCounterClockwise;
|
||||
return frontFaceFlip ? vk::FrontFace::eClockwise : vk::FrontFace::eCounterClockwise;
|
||||
}
|
||||
}();
|
||||
}
|
||||
|
||||
void SetFrontFaceFlipEnabled(bool enabled) {
|
||||
if (enabled != frontFaceFlip) {
|
||||
auto &face{rasterizerState.get<vk::PipelineRasterizationStateCreateInfo>().frontFace};
|
||||
if (face == vk::FrontFace::eClockwise)
|
||||
face = vk::FrontFace::eCounterClockwise;
|
||||
else if (face == vk::FrontFace::eCounterClockwise)
|
||||
face = vk::FrontFace::eClockwise;
|
||||
|
||||
UpdateRuntimeInformation(runtimeInfo.y_negate, enabled, maxwell3d::PipelineStage::Vertex, maxwell3d::PipelineStage::Fragment);
|
||||
frontFaceFlip = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
void SetCullFace(maxwell3d::CullFace face) {
|
||||
cullMode = [face]() -> vk::CullModeFlags {
|
||||
switch (face) {
|
||||
|
@ -308,6 +308,7 @@ namespace skyline::soc::gm20b::engine::maxwell3d {
|
||||
|
||||
MAXWELL3D_CASE(windowOriginMode, {
|
||||
context.SetViewportOrigin(windowOriginMode.isOriginLowerLeft);
|
||||
context.SetFrontFaceFlipEnabled(windowOriginMode.flipFrontFace);
|
||||
})
|
||||
|
||||
MAXWELL3D_CASE(independentBlendEnable, {
|
||||
|
Loading…
Reference in New Issue
Block a user