mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-01-19 13:08:27 +00:00
renderer_vulkan: Disable culling for RectList. (#1749)
This commit is contained in:
parent
856d2d1bfa
commit
0908d69002
|
@ -65,6 +65,33 @@ vk::CompareOp CompareOp(Liverpool::CompareFunc func) {
|
|||
}
|
||||
}
|
||||
|
||||
bool IsPrimitiveCulled(AmdGpu::PrimitiveType type) {
|
||||
switch (type) {
|
||||
case AmdGpu::PrimitiveType::TriangleList:
|
||||
case AmdGpu::PrimitiveType::TriangleFan:
|
||||
case AmdGpu::PrimitiveType::TriangleStrip:
|
||||
case AmdGpu::PrimitiveType::PatchPrimitive:
|
||||
case AmdGpu::PrimitiveType::AdjTriangleList:
|
||||
case AmdGpu::PrimitiveType::AdjTriangleStrip:
|
||||
case AmdGpu::PrimitiveType::QuadList:
|
||||
case AmdGpu::PrimitiveType::QuadStrip:
|
||||
case AmdGpu::PrimitiveType::Polygon:
|
||||
return true;
|
||||
case AmdGpu::PrimitiveType::None:
|
||||
case AmdGpu::PrimitiveType::PointList:
|
||||
case AmdGpu::PrimitiveType::LineList:
|
||||
case AmdGpu::PrimitiveType::LineStrip:
|
||||
case AmdGpu::PrimitiveType::AdjLineList:
|
||||
case AmdGpu::PrimitiveType::AdjLineStrip:
|
||||
case AmdGpu::PrimitiveType::RectList: // Screen-aligned rectangles that are not culled
|
||||
case AmdGpu::PrimitiveType::LineLoop:
|
||||
return false;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
vk::PrimitiveTopology PrimitiveType(AmdGpu::PrimitiveType type) {
|
||||
switch (type) {
|
||||
case AmdGpu::PrimitiveType::PointList:
|
||||
|
|
|
@ -18,6 +18,8 @@ vk::StencilOp StencilOp(Liverpool::StencilFunc op);
|
|||
|
||||
vk::CompareOp CompareOp(Liverpool::CompareFunc func);
|
||||
|
||||
bool IsPrimitiveCulled(AmdGpu::PrimitiveType type);
|
||||
|
||||
vk::PrimitiveTopology PrimitiveType(AmdGpu::PrimitiveType type);
|
||||
|
||||
vk::PolygonMode PolygonMode(Liverpool::PolygonMode mode);
|
||||
|
|
|
@ -110,7 +110,9 @@ GraphicsPipeline::GraphicsPipeline(const Instance& instance_, Scheduler& schedul
|
|||
.depthClampEnable = false,
|
||||
.rasterizerDiscardEnable = false,
|
||||
.polygonMode = LiverpoolToVK::PolygonMode(key.polygon_mode),
|
||||
.cullMode = LiverpoolToVK::CullMode(key.cull_mode),
|
||||
.cullMode = LiverpoolToVK::IsPrimitiveCulled(key.prim_type)
|
||||
? LiverpoolToVK::CullMode(key.cull_mode)
|
||||
: vk::CullModeFlagBits::eNone,
|
||||
.frontFace = key.front_face == Liverpool::FrontFace::Clockwise
|
||||
? vk::FrontFace::eClockwise
|
||||
: vk::FrontFace::eCounterClockwise,
|
||||
|
|
Loading…
Reference in a new issue