mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-26 21:54:16 +01:00
Implement depth clamp rasterisation state
Used in SMO for shadows.
This commit is contained in:
parent
1cfc4278f9
commit
90466b8830
@ -340,6 +340,10 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
// Vulkan enum values match 1-1 with hades
|
||||
return static_cast<Shader::CompareFunction>(alphaFunc);
|
||||
}
|
||||
|
||||
void PackedPipelineState::SetDepthClampEnable(engine::ViewportClipControl::GeometryClip clip) {
|
||||
depthClampEnable = (clip != engine::ViewportClipControl::GeometryClip::Passthru) && (clip != engine::ViewportClipControl::GeometryClip::FrustrumXYZClip) && (clip != engine::ViewportClipControl::GeometryClip::FrustrumZClip);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma clang diagnostic pop
|
@ -57,6 +57,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
bool transformFeedbackEnable : 1;
|
||||
u8 alphaFunc : 3; //!< Use {Set,Get}AlphaFunc
|
||||
bool alphaTestEnable : 1;
|
||||
bool depthClampEnable : 1; // Use SetDepthClampEnable
|
||||
};
|
||||
|
||||
u32 patchSize;
|
||||
@ -141,6 +142,8 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
|
||||
Shader::CompareFunction GetAlphaFunc() const;
|
||||
|
||||
void SetDepthClampEnable(engine::ViewportClipControl::GeometryClip clip);
|
||||
|
||||
bool operator==(const PackedPipelineState &other) const {
|
||||
// Only hash transform feedback state if it's enabled
|
||||
if (other.transformFeedbackEnable && transformFeedbackEnable)
|
||||
|
@ -493,6 +493,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
rasterizationCreateInfo.cullMode = vk::CullModeFlags{packedState.cullMode};
|
||||
rasterizationCreateInfo.frontFace = packedState.frontFaceClockwise ? vk::FrontFace::eClockwise : vk::FrontFace::eCounterClockwise;
|
||||
rasterizationCreateInfo.depthBiasEnable = packedState.depthBiasEnable;
|
||||
rasterizationCreateInfo.depthClampEnable = packedState.depthClampEnable;
|
||||
rasterizationState.get<vk::PipelineRasterizationProvokingVertexStateCreateInfoEXT>().provokingVertexMode = ConvertProvokingVertex(packedState.provokingVertex);
|
||||
|
||||
constexpr vk::PipelineMultisampleStateCreateInfo multisampleState{
|
||||
@ -651,7 +652,6 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
|
||||
view.GetBuffer()->BlockSequencedCpuBackingWrites();
|
||||
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -446,6 +446,7 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
packedState.provokingVertex = engine->provokingVertex.value;
|
||||
packedState.pointSize = engine->pointSize;
|
||||
packedState.openGlNdc = engine->zClipRange == engine::ZClipRange::NegativeWToPositiveW;
|
||||
packedState.SetDepthClampEnable(engine->viewportClipControl.geometryClip);
|
||||
}
|
||||
|
||||
/* Depth Stencil State */
|
||||
|
Loading…
Reference in New Issue
Block a user