misc: chore: Use explicit types in Vulkan project

This commit is contained in:
Evan Husted
2025-01-25 14:12:17 -06:00
parent e6b393e420
commit 2d1a4c3ce5
58 changed files with 682 additions and 667 deletions

View File

@@ -333,12 +333,12 @@ namespace Ryujinx.Graphics.Vulkan
ShaderCollection program,
PipelineCache cache)
{
if (program.TryGetComputePipeline(ref SpecializationData, out var pipeline))
if (program.TryGetComputePipeline(ref SpecializationData, out Auto<DisposablePipeline> pipeline))
{
return pipeline;
}
var pipelineCreateInfo = new ComputePipelineCreateInfo
ComputePipelineCreateInfo pipelineCreateInfo = new ComputePipelineCreateInfo
{
SType = StructureType.ComputePipelineCreateInfo,
Stage = Stages[0],
@@ -350,7 +350,7 @@ namespace Ryujinx.Graphics.Vulkan
bool hasSpec = program.SpecDescriptions != null;
var desc = hasSpec ? program.SpecDescriptions[0] : SpecDescription.Empty;
SpecDescription desc = hasSpec ? program.SpecDescriptions[0] : SpecDescription.Empty;
if (hasSpec && SpecializationData.Length < (int)desc.Info.DataSize)
{
@@ -386,7 +386,7 @@ namespace Ryujinx.Graphics.Vulkan
RenderPass renderPass,
bool throwOnError = false)
{
if (program.TryGetGraphicsPipeline(ref Internal, out var pipeline))
if (program.TryGetGraphicsPipeline(ref Internal, out Auto<DisposablePipeline> pipeline))
{
return pipeline;
}
@@ -405,7 +405,7 @@ namespace Ryujinx.Graphics.Vulkan
fixed (VertexInputBindingDescription* pVertexBindingDescriptions = &Internal.VertexBindingDescriptions[0])
fixed (PipelineColorBlendAttachmentState* pColorBlendAttachmentState = &Internal.ColorBlendAttachmentState[0])
{
var vertexInputState = new PipelineVertexInputStateCreateInfo
PipelineVertexInputStateCreateInfo vertexInputState = new PipelineVertexInputStateCreateInfo
{
SType = StructureType.PipelineVertexInputStateCreateInfo,
VertexAttributeDescriptionCount = VertexAttributeDescriptionsCount,
@@ -442,20 +442,20 @@ namespace Ryujinx.Graphics.Vulkan
primitiveRestartEnable &= topologySupportsRestart;
var inputAssemblyState = new PipelineInputAssemblyStateCreateInfo
PipelineInputAssemblyStateCreateInfo inputAssemblyState = new PipelineInputAssemblyStateCreateInfo
{
SType = StructureType.PipelineInputAssemblyStateCreateInfo,
PrimitiveRestartEnable = primitiveRestartEnable,
Topology = HasTessellationControlShader ? PrimitiveTopology.PatchList : Topology,
};
var tessellationState = new PipelineTessellationStateCreateInfo
PipelineTessellationStateCreateInfo tessellationState = new PipelineTessellationStateCreateInfo
{
SType = StructureType.PipelineTessellationStateCreateInfo,
PatchControlPoints = PatchControlPoints,
};
var rasterizationState = new PipelineRasterizationStateCreateInfo
PipelineRasterizationStateCreateInfo rasterizationState = new PipelineRasterizationStateCreateInfo
{
SType = StructureType.PipelineRasterizationStateCreateInfo,
DepthClampEnable = DepthClampEnable,
@@ -467,7 +467,7 @@ namespace Ryujinx.Graphics.Vulkan
DepthBiasEnable = DepthBiasEnable,
};
var viewportState = new PipelineViewportStateCreateInfo
PipelineViewportStateCreateInfo viewportState = new PipelineViewportStateCreateInfo
{
SType = StructureType.PipelineViewportStateCreateInfo,
ViewportCount = ViewportsCount,
@@ -476,7 +476,7 @@ namespace Ryujinx.Graphics.Vulkan
if (gd.Capabilities.SupportsDepthClipControl)
{
var viewportDepthClipControlState = new PipelineViewportDepthClipControlCreateInfoEXT
PipelineViewportDepthClipControlCreateInfoEXT viewportDepthClipControlState = new PipelineViewportDepthClipControlCreateInfoEXT
{
SType = StructureType.PipelineViewportDepthClipControlCreateInfoExt,
NegativeOneToOne = DepthMode,
@@ -485,7 +485,7 @@ namespace Ryujinx.Graphics.Vulkan
viewportState.PNext = &viewportDepthClipControlState;
}
var multisampleState = new PipelineMultisampleStateCreateInfo
PipelineMultisampleStateCreateInfo multisampleState = new PipelineMultisampleStateCreateInfo
{
SType = StructureType.PipelineMultisampleStateCreateInfo,
SampleShadingEnable = false,
@@ -495,19 +495,19 @@ namespace Ryujinx.Graphics.Vulkan
AlphaToOneEnable = AlphaToOneEnable,
};
var stencilFront = new StencilOpState(
StencilOpState stencilFront = new StencilOpState(
StencilFrontFailOp,
StencilFrontPassOp,
StencilFrontDepthFailOp,
StencilFrontCompareOp);
var stencilBack = new StencilOpState(
StencilOpState stencilBack = new StencilOpState(
StencilBackFailOp,
StencilBackPassOp,
StencilBackDepthFailOp,
StencilBackCompareOp);
var depthStencilState = new PipelineDepthStencilStateCreateInfo
PipelineDepthStencilStateCreateInfo depthStencilState = new PipelineDepthStencilStateCreateInfo
{
SType = StructureType.PipelineDepthStencilStateCreateInfo,
DepthTestEnable = DepthTestEnable,
@@ -544,7 +544,7 @@ namespace Ryujinx.Graphics.Vulkan
// so we need to force disable them here.
bool logicOpEnable = LogicOpEnable && (gd.Vendor == Vendor.Nvidia || Internal.LogicOpsAllowed);
var colorBlendState = new PipelineColorBlendStateCreateInfo
PipelineColorBlendStateCreateInfo colorBlendState = new PipelineColorBlendStateCreateInfo
{
SType = StructureType.PipelineColorBlendStateCreateInfo,
LogicOpEnable = logicOpEnable,
@@ -595,7 +595,7 @@ namespace Ryujinx.Graphics.Vulkan
dynamicStates[dynamicStatesCount++] = DynamicState.AttachmentFeedbackLoopEnableExt;
}
var pipelineDynamicStateCreateInfo = new PipelineDynamicStateCreateInfo
PipelineDynamicStateCreateInfo pipelineDynamicStateCreateInfo = new PipelineDynamicStateCreateInfo
{
SType = StructureType.PipelineDynamicStateCreateInfo,
DynamicStateCount = (uint)dynamicStatesCount,
@@ -619,7 +619,7 @@ namespace Ryujinx.Graphics.Vulkan
}
}
var pipelineCreateInfo = new GraphicsPipelineCreateInfo
GraphicsPipelineCreateInfo pipelineCreateInfo = new GraphicsPipelineCreateInfo
{
SType = StructureType.GraphicsPipelineCreateInfo,
Flags = flags,
@@ -677,12 +677,12 @@ namespace Ryujinx.Graphics.Vulkan
for (int index = 0; index < VertexAttributeDescriptionsCount; index++)
{
var attribute = Internal.VertexAttributeDescriptions[index];
VertexInputAttributeDescription attribute = Internal.VertexAttributeDescriptions[index];
int vbIndex = GetVertexBufferIndex(attribute.Binding);
if (vbIndex >= 0)
{
ref var vb = ref Internal.VertexBindingDescriptions[vbIndex];
ref VertexInputBindingDescription vb = ref Internal.VertexBindingDescriptions[vbIndex];
Format format = attribute.Format;