mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 21:01:48 +01:00
Setup minimal viewport Vulkan pipeline state
This commit is contained in:
parent
fe51db366b
commit
a04d8fb5cf
@ -196,6 +196,9 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
ViewportState::ViewportState(dirty::Handle dirtyHandle, DirtyManager &manager, const EngineRegisters &engine, u32 index) : engine{manager, dirtyHandle, engine}, index{index} {}
|
||||
|
||||
void ViewportState::Flush(InterconnectContext &ctx, StateUpdateBuilder &builder) {
|
||||
if (index != 0 && !ctx.gpu.traits.supportsMultipleViewports)
|
||||
return;
|
||||
|
||||
if (!engine->viewportScaleOffsetEnable)
|
||||
// https://github.com/Ryujinx/Ryujinx/pull/3328
|
||||
Logger::Warn("Viewport scale/offset disable is unimplemented");
|
||||
|
@ -475,16 +475,28 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
.pDynamicStates = dynamicStates.data()
|
||||
};
|
||||
|
||||
// Dynamic state will be used instead of these
|
||||
std::array<vk::Rect2D, engine::ViewportCount> emptyScissors{};
|
||||
std::array<vk::Viewport, engine::ViewportCount> emptyViewports{};
|
||||
|
||||
vk::PipelineViewportStateCreateInfo viewportState{
|
||||
.viewportCount = static_cast<u32>(ctx.gpu.traits.supportsMultipleViewports ? engine::ViewportCount : 1),
|
||||
.pViewports = emptyViewports.data(),
|
||||
.scissorCount = static_cast<u32>(ctx.gpu.traits.supportsMultipleViewports ? engine::ViewportCount : 1),
|
||||
.pScissors = emptyScissors.data(),
|
||||
};
|
||||
|
||||
return ctx.gpu.graphicsPipelineCache.GetCompiledPipeline(cache::GraphicsPipelineCache::PipelineState{
|
||||
.shaderStages = shaderStageInfos,
|
||||
.vertexState = vertexInputState,
|
||||
.inputAssemblyState = inputAssemblyState,
|
||||
.tessellationState = tessellationState,
|
||||
.viewportState = {},
|
||||
.viewportState = viewportState,
|
||||
.rasterizationState = rasterizationState,
|
||||
.multisampleState = multisampleState,
|
||||
.depthStencilState = depthStencilState,
|
||||
.colorBlendState = colorBlendState,
|
||||
.dynamicState = dynamicState,
|
||||
.colorAttachments = colorAttachments,
|
||||
.depthStencilAttachment = depthAttachment,
|
||||
}, layoutBindings);
|
||||
|
Loading…
Reference in New Issue
Block a user