mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2025-02-03 21:42:56 -06:00
492a046335
* Initial implementation of buffer mirrors Generally slower right now, goal is to reduce render passes in games that do inline updates Fix support buffer mirrors Reintroduce vertex buffer mirror Add storage buffer support Optimisation part 1 More optimisation Avoid useless data copies. Remove unused cbIndex stuff Properly set write flag for storage buffers. Fix minor issues Not sure why this was here. Fix BufferRangeList Fix some big issues Align storage buffers rather than getting full buffer as a range Improves mirrorability of read-only storage buffers Increase staging buffer size, as it now contains mirrors Fix some issues with buffers not updating Fix buffer SetDataUnchecked offset for one of the paths when using mirrors Fix buffer mirrors interaction with buffer textures Fix mirror rebinding Move GetBuffer calls on indirect draws before BeginRenderPass to avoid draws without render pass Fix mirrors rebase Fix rebase 2023 * Fix crash when using stale vertex buffer Similar to `Get` with a size that's too large, just treat it as a clamp. * Explicitly set support buffer as mirrorable * Address feedback * Remove unused fragment of MVK workaround * Replace logging for staging buffer OOM * Address format issues * Address more format issues * Mini cleanup * Address more things * Rename BufferRangeList * Support bounding range for ClearMirrors and UploadPendingData * Add maximum size for vertex buffer mirrors * Enable index buffer mirrors Enabled on all platforms for the IbStreamer. * Feedback * Remove mystery BufferCache change Probably macos related? * Fix mirrors not creating when staging buffer is empty. * Change log level to debug
136 lines
6.8 KiB
C#
136 lines
6.8 KiB
C#
using Silk.NET.Vulkan;
|
|
using System;
|
|
|
|
namespace Ryujinx.Graphics.Vulkan
|
|
{
|
|
[Flags]
|
|
enum PortabilitySubsetFlags
|
|
{
|
|
None = 0,
|
|
|
|
NoTriangleFans = 1,
|
|
NoPointMode = 1 << 1,
|
|
No3DImageView = 1 << 2,
|
|
NoLodBias = 1 << 3,
|
|
}
|
|
|
|
readonly struct HardwareCapabilities
|
|
{
|
|
public readonly bool SupportsIndexTypeUint8;
|
|
public readonly bool SupportsCustomBorderColor;
|
|
public readonly bool SupportsBlendEquationAdvanced;
|
|
public readonly bool SupportsBlendEquationAdvancedCorrelatedOverlap;
|
|
public readonly bool SupportsBlendEquationAdvancedNonPreMultipliedSrcColor;
|
|
public readonly bool SupportsBlendEquationAdvancedNonPreMultipliedDstColor;
|
|
public readonly bool SupportsIndirectParameters;
|
|
public readonly bool SupportsFragmentShaderInterlock;
|
|
public readonly bool SupportsGeometryShaderPassthrough;
|
|
public readonly bool SupportsSubgroupSizeControl;
|
|
public readonly bool SupportsShaderFloat64;
|
|
public readonly bool SupportsShaderInt8;
|
|
public readonly bool SupportsShaderStencilExport;
|
|
public readonly bool SupportsShaderStorageImageMultisample;
|
|
public readonly bool SupportsConditionalRendering;
|
|
public readonly bool SupportsExtendedDynamicState;
|
|
public readonly bool SupportsMultiView;
|
|
public readonly bool SupportsNullDescriptors;
|
|
public readonly bool SupportsPushDescriptors;
|
|
public readonly bool SupportsPrimitiveTopologyListRestart;
|
|
public readonly bool SupportsPrimitiveTopologyPatchListRestart;
|
|
public readonly bool SupportsTransformFeedback;
|
|
public readonly bool SupportsTransformFeedbackQueries;
|
|
public readonly bool SupportsPreciseOcclusionQueries;
|
|
public readonly bool SupportsPipelineStatisticsQuery;
|
|
public readonly bool SupportsGeometryShader;
|
|
public readonly bool SupportsViewportArray2;
|
|
public readonly bool SupportsHostImportedMemory;
|
|
public readonly bool SupportsDepthClipControl;
|
|
public readonly uint MinSubgroupSize;
|
|
public readonly uint MaxSubgroupSize;
|
|
public readonly ShaderStageFlags RequiredSubgroupSizeStages;
|
|
public readonly SampleCountFlags SupportedSampleCounts;
|
|
public readonly PortabilitySubsetFlags PortabilitySubset;
|
|
public readonly uint VertexBufferAlignment;
|
|
public readonly uint SubTexelPrecisionBits;
|
|
public readonly ulong MinResourceAlignment;
|
|
|
|
public HardwareCapabilities(
|
|
bool supportsIndexTypeUint8,
|
|
bool supportsCustomBorderColor,
|
|
bool supportsBlendEquationAdvanced,
|
|
bool supportsBlendEquationAdvancedCorrelatedOverlap,
|
|
bool supportsBlendEquationAdvancedNonPreMultipliedSrcColor,
|
|
bool supportsBlendEquationAdvancedNonPreMultipliedDstColor,
|
|
bool supportsIndirectParameters,
|
|
bool supportsFragmentShaderInterlock,
|
|
bool supportsGeometryShaderPassthrough,
|
|
bool supportsSubgroupSizeControl,
|
|
bool supportsShaderFloat64,
|
|
bool supportsShaderInt8,
|
|
bool supportsShaderStencilExport,
|
|
bool supportsShaderStorageImageMultisample,
|
|
bool supportsConditionalRendering,
|
|
bool supportsExtendedDynamicState,
|
|
bool supportsMultiView,
|
|
bool supportsNullDescriptors,
|
|
bool supportsPushDescriptors,
|
|
bool supportsPrimitiveTopologyListRestart,
|
|
bool supportsPrimitiveTopologyPatchListRestart,
|
|
bool supportsTransformFeedback,
|
|
bool supportsTransformFeedbackQueries,
|
|
bool supportsPreciseOcclusionQueries,
|
|
bool supportsPipelineStatisticsQuery,
|
|
bool supportsGeometryShader,
|
|
bool supportsViewportArray2,
|
|
bool supportsHostImportedMemory,
|
|
bool supportsDepthClipControl,
|
|
uint minSubgroupSize,
|
|
uint maxSubgroupSize,
|
|
ShaderStageFlags requiredSubgroupSizeStages,
|
|
SampleCountFlags supportedSampleCounts,
|
|
PortabilitySubsetFlags portabilitySubset,
|
|
uint vertexBufferAlignment,
|
|
uint subTexelPrecisionBits,
|
|
ulong minResourceAlignment)
|
|
{
|
|
SupportsIndexTypeUint8 = supportsIndexTypeUint8;
|
|
SupportsCustomBorderColor = supportsCustomBorderColor;
|
|
SupportsBlendEquationAdvanced = supportsBlendEquationAdvanced;
|
|
SupportsBlendEquationAdvancedCorrelatedOverlap = supportsBlendEquationAdvancedCorrelatedOverlap;
|
|
SupportsBlendEquationAdvancedNonPreMultipliedSrcColor = supportsBlendEquationAdvancedNonPreMultipliedSrcColor;
|
|
SupportsBlendEquationAdvancedNonPreMultipliedDstColor = supportsBlendEquationAdvancedNonPreMultipliedDstColor;
|
|
SupportsIndirectParameters = supportsIndirectParameters;
|
|
SupportsFragmentShaderInterlock = supportsFragmentShaderInterlock;
|
|
SupportsGeometryShaderPassthrough = supportsGeometryShaderPassthrough;
|
|
SupportsSubgroupSizeControl = supportsSubgroupSizeControl;
|
|
SupportsShaderFloat64 = supportsShaderFloat64;
|
|
SupportsShaderInt8 = supportsShaderInt8;
|
|
SupportsShaderStencilExport = supportsShaderStencilExport;
|
|
SupportsShaderStorageImageMultisample = supportsShaderStorageImageMultisample;
|
|
SupportsConditionalRendering = supportsConditionalRendering;
|
|
SupportsExtendedDynamicState = supportsExtendedDynamicState;
|
|
SupportsMultiView = supportsMultiView;
|
|
SupportsNullDescriptors = supportsNullDescriptors;
|
|
SupportsPushDescriptors = supportsPushDescriptors;
|
|
SupportsPrimitiveTopologyListRestart = supportsPrimitiveTopologyListRestart;
|
|
SupportsPrimitiveTopologyPatchListRestart = supportsPrimitiveTopologyPatchListRestart;
|
|
SupportsTransformFeedback = supportsTransformFeedback;
|
|
SupportsTransformFeedbackQueries = supportsTransformFeedbackQueries;
|
|
SupportsPreciseOcclusionQueries = supportsPreciseOcclusionQueries;
|
|
SupportsPipelineStatisticsQuery = supportsPipelineStatisticsQuery;
|
|
SupportsGeometryShader = supportsGeometryShader;
|
|
SupportsViewportArray2 = supportsViewportArray2;
|
|
SupportsHostImportedMemory = supportsHostImportedMemory;
|
|
SupportsDepthClipControl = supportsDepthClipControl;
|
|
MinSubgroupSize = minSubgroupSize;
|
|
MaxSubgroupSize = maxSubgroupSize;
|
|
RequiredSubgroupSizeStages = requiredSubgroupSizeStages;
|
|
SupportedSampleCounts = supportedSampleCounts;
|
|
PortabilitySubset = portabilitySubset;
|
|
VertexBufferAlignment = vertexBufferAlignment;
|
|
SubTexelPrecisionBits = subTexelPrecisionBits;
|
|
MinResourceAlignment = minResourceAlignment;
|
|
}
|
|
}
|
|
}
|