misc: chore: Use collection expressions

This commit is contained in:
KeatonTheBot
2025-03-06 20:46:29 -06:00
parent 4d5757417e
commit e2973a875a
236 changed files with 9843 additions and 7561 deletions
@@ -150,10 +150,7 @@ namespace Ryujinx.Graphics.Vulkan
}
else
{
_ranges = new List<Range>
{
new Range(offset, size)
};
_ranges = [new Range(offset, size)];
}
}
@@ -189,7 +186,7 @@ namespace Ryujinx.Graphics.Vulkan
do
{
(result ??= new List<Range>()).Add(list[index++]);
(result ??= []).Add(list[index++]);
}
while (index < list.Count && list[index].OverlapsWith(offset, size));
}
@@ -137,11 +137,11 @@ namespace Ryujinx.Graphics.Vulkan
_bufferTextureRefs = new TextureBuffer[Constants.MaxTextureBindings * 2];
_bufferImageRefs = new TextureBuffer[Constants.MaxImageBindings * 2];
_textureArrayRefs = Array.Empty<ArrayRef<TextureArray>>();
_imageArrayRefs = Array.Empty<ArrayRef<ImageArray>>();
_textureArrayRefs = [];
_imageArrayRefs = [];
_textureArrayExtraRefs = Array.Empty<ArrayRef<TextureArray>>();
_imageArrayExtraRefs = Array.Empty<ArrayRef<ImageArray>>();
_textureArrayExtraRefs = [];
_imageArrayExtraRefs = [];
_uniformBuffers = new DescriptorBufferInfo[Constants.MaxUniformBufferBindings];
_storageBuffers = new DescriptorBufferInfo[Constants.MaxStorageBufferBindings];
@@ -50,10 +50,9 @@ namespace Ryujinx.Graphics.Vulkan.Effects
_sampler = _renderer.CreateSampler(SamplerCreateInfo.Create(MinFilter.Linear, MagFilter.Linear));
_scalingProgram = _renderer.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(scalingShader, ShaderStage.Compute, TargetLanguage.Spirv),
}, scalingResourceLayout);
_scalingProgram = _renderer.CreateProgramWithMinimalLayout([
new ShaderSource(scalingShader, ShaderStage.Compute, TargetLanguage.Spirv)
], scalingResourceLayout);
}
public void Run(
@@ -70,8 +69,8 @@ namespace Ryujinx.Graphics.Vulkan.Effects
_pipeline.SetProgram(_scalingProgram);
_pipeline.SetTextureAndSampler(ShaderStage.Compute, 1, view, _sampler);
ReadOnlySpan<float> dimensionsBuffer = stackalloc float[]
{
ReadOnlySpan<float> dimensionsBuffer =
[
source.X1,
source.X2,
source.Y1,
@@ -79,8 +78,8 @@ namespace Ryujinx.Graphics.Vulkan.Effects
destination.X1,
destination.X2,
destination.Y1,
destination.Y2,
};
destination.Y2
];
int rangeSize = dimensionsBuffer.Length * sizeof(float);
using var buffer = _renderer.BufferManager.ReserveOrCreate(_renderer, cbs, rangeSize);
@@ -90,7 +89,7 @@ namespace Ryujinx.Graphics.Vulkan.Effects
int dispatchX = (width + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
int dispatchY = (height + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(2, buffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(2, buffer.Range)]);
_pipeline.SetImage(0, destinationTexture);
_pipeline.DispatchCompute(dispatchX, dispatchY, 1);
_pipeline.ComputeBarrier();
@@ -70,15 +70,13 @@ namespace Ryujinx.Graphics.Vulkan.Effects
_sampler = _renderer.CreateSampler(SamplerCreateInfo.Create(MinFilter.Linear, MagFilter.Linear));
_scalingProgram = _renderer.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(scalingShader, ShaderStage.Compute, TargetLanguage.Spirv),
}, scalingResourceLayout);
_scalingProgram = _renderer.CreateProgramWithMinimalLayout([
new ShaderSource(scalingShader, ShaderStage.Compute, TargetLanguage.Spirv)
], scalingResourceLayout);
_sharpeningProgram = _renderer.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(sharpeningShader, ShaderStage.Compute, TargetLanguage.Spirv),
}, sharpeningResourceLayout);
_sharpeningProgram = _renderer.CreateProgramWithMinimalLayout([
new ShaderSource(sharpeningShader, ShaderStage.Compute, TargetLanguage.Spirv)
], sharpeningResourceLayout);
}
public void Run(
@@ -127,8 +125,8 @@ namespace Ryujinx.Graphics.Vulkan.Effects
float scaleX = srcWidth / view.Width;
float scaleY = srcHeight / view.Height;
ReadOnlySpan<float> dimensionsBuffer = stackalloc float[]
{
ReadOnlySpan<float> dimensionsBuffer =
[
source.X1,
source.X2,
source.Y1,
@@ -138,14 +136,14 @@ namespace Ryujinx.Graphics.Vulkan.Effects
destination.Y1,
destination.Y2,
scaleX,
scaleY,
};
scaleY
];
int rangeSize = dimensionsBuffer.Length * sizeof(float);
using var buffer = _renderer.BufferManager.ReserveOrCreate(_renderer, cbs, rangeSize);
buffer.Holder.SetDataUnchecked(buffer.Offset, dimensionsBuffer);
ReadOnlySpan<float> sharpeningBufferData = stackalloc float[] { 1.5f - (Level * 0.01f * 1.5f) };
ReadOnlySpan<float> sharpeningBufferData = [1.5f - (Level * 0.01f * 1.5f)];
using var sharpeningBuffer = _renderer.BufferManager.ReserveOrCreate(_renderer, cbs, sizeof(float));
sharpeningBuffer.Holder.SetDataUnchecked(sharpeningBuffer.Offset, sharpeningBufferData);
@@ -153,7 +151,7 @@ namespace Ryujinx.Graphics.Vulkan.Effects
int dispatchX = (width + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
int dispatchY = (height + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim;
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(2, buffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(2, buffer.Range)]);
_pipeline.SetImage(ShaderStage.Compute, 0, _intermediaryTexture.GetView(FormatTable.ConvertRgba8SrgbToUnorm(view.Info.Format)));
_pipeline.DispatchCompute(dispatchX, dispatchY, 1);
_pipeline.ComputeBarrier();
@@ -161,7 +159,7 @@ namespace Ryujinx.Graphics.Vulkan.Effects
// Sharpening pass
_pipeline.SetProgram(_sharpeningProgram);
_pipeline.SetTextureAndSampler(ShaderStage.Compute, 1, _intermediaryTexture, _sampler);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(4, sharpeningBuffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(4, sharpeningBuffer.Range)]);
_pipeline.SetImage(0, destinationTexture);
_pipeline.DispatchCompute(dispatchX, dispatchY, 1);
_pipeline.ComputeBarrier();
@@ -46,10 +46,9 @@ namespace Ryujinx.Graphics.Vulkan.Effects
_samplerLinear = _renderer.CreateSampler(SamplerCreateInfo.Create(MinFilter.Linear, MagFilter.Linear));
_shaderProgram = _renderer.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(shader, ShaderStage.Compute, TargetLanguage.Spirv),
}, resourceLayout);
_shaderProgram = _renderer.CreateProgramWithMinimalLayout([
new ShaderSource(shader, ShaderStage.Compute, TargetLanguage.Spirv)
], resourceLayout);
}
public TextureView Run(TextureView view, CommandBufferScoped cbs, int width, int height)
@@ -64,13 +63,13 @@ namespace Ryujinx.Graphics.Vulkan.Effects
_pipeline.SetProgram(_shaderProgram);
_pipeline.SetTextureAndSampler(ShaderStage.Compute, 1, view, _samplerLinear);
ReadOnlySpan<float> resolutionBuffer = stackalloc float[] { view.Width, view.Height };
ReadOnlySpan<float> resolutionBuffer = [view.Width, view.Height];
int rangeSize = resolutionBuffer.Length * sizeof(float);
using var buffer = _renderer.BufferManager.ReserveOrCreate(_renderer, cbs, rangeSize);
buffer.Holder.SetDataUnchecked(buffer.Offset, resolutionBuffer);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(2, buffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(2, buffer.Range)]);
var dispatchX = BitUtils.DivRoundUp(view.Width, IPostProcessingEffect.LocalGroupSize);
var dispatchY = BitUtils.DivRoundUp(view.Height, IPostProcessingEffect.LocalGroupSize);
@@ -116,20 +116,17 @@ namespace Ryujinx.Graphics.Vulkan.Effects
(4, SpecConstType.Float32),
(5, SpecConstType.Float32));
_edgeProgram = _renderer.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(edgeShader, ShaderStage.Compute, TargetLanguage.Spirv),
}, edgeResourceLayout, new[] { specInfo });
_edgeProgram = _renderer.CreateProgramWithMinimalLayout([
new ShaderSource(edgeShader, ShaderStage.Compute, TargetLanguage.Spirv)
], edgeResourceLayout, [specInfo]);
_blendProgram = _renderer.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(blendShader, ShaderStage.Compute, TargetLanguage.Spirv),
}, blendResourceLayout, new[] { specInfo });
_blendProgram = _renderer.CreateProgramWithMinimalLayout([
new ShaderSource(blendShader, ShaderStage.Compute, TargetLanguage.Spirv)
], blendResourceLayout, [specInfo]);
_neighbourProgram = _renderer.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(neighbourShader, ShaderStage.Compute, TargetLanguage.Spirv),
}, neighbourResourceLayout, new[] { specInfo });
_neighbourProgram = _renderer.CreateProgramWithMinimalLayout([
new ShaderSource(neighbourShader, ShaderStage.Compute, TargetLanguage.Spirv)
], neighbourResourceLayout, [specInfo]);
}
public void DeletePipelines()
@@ -213,12 +210,12 @@ namespace Ryujinx.Graphics.Vulkan.Effects
_pipeline.SetTextureAndSampler(ShaderStage.Compute, 1, view, _samplerLinear);
_pipeline.Specialize(_specConstants);
ReadOnlySpan<float> resolutionBuffer = stackalloc float[] { view.Width, view.Height };
ReadOnlySpan<float> resolutionBuffer = [view.Width, view.Height];
int rangeSize = resolutionBuffer.Length * sizeof(float);
using var buffer = _renderer.BufferManager.ReserveOrCreate(_renderer, cbs, rangeSize);
buffer.Holder.SetDataUnchecked(buffer.Offset, resolutionBuffer);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(2, buffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(2, buffer.Range)]);
_pipeline.SetImage(ShaderStage.Compute, 0, _edgeOutputTexture.GetView(FormatTable.ConvertRgba8SrgbToUnorm(view.Info.Format)));
_pipeline.DispatchCompute(dispatchX, dispatchY, 1);
_pipeline.ComputeBarrier();
+4 -4
View File
@@ -110,7 +110,7 @@ namespace Ryujinx.Graphics.Vulkan
try
{
FenceHelper.WaitAllIndefinitely(_api, _device, stackalloc Fence[] { _fence });
FenceHelper.WaitAllIndefinitely(_api, _device, [_fence]);
}
finally
{
@@ -119,7 +119,7 @@ namespace Ryujinx.Graphics.Vulkan
}
else
{
FenceHelper.WaitAllIndefinitely(_api, _device, stackalloc Fence[] { _fence });
FenceHelper.WaitAllIndefinitely(_api, _device, [_fence]);
}
}
@@ -134,7 +134,7 @@ namespace Ryujinx.Graphics.Vulkan
try
{
return FenceHelper.AllSignaled(_api, _device, stackalloc Fence[] { _fence });
return FenceHelper.AllSignaled(_api, _device, [_fence]);
}
finally
{
@@ -143,7 +143,7 @@ namespace Ryujinx.Graphics.Vulkan
}
else
{
return FenceHelper.AllSignaled(_api, _device, stackalloc Fence[] { _fence });
return FenceHelper.AllSignaled(_api, _device, [_fence]);
}
}
@@ -9,7 +9,8 @@ namespace Ryujinx.Graphics.Vulkan
{
class FormatCapabilities
{
private static readonly GAL.Format[] _scaledFormats = {
private static readonly GAL.Format[] _scaledFormats =
[
GAL.Format.R8Uscaled,
GAL.Format.R8Sscaled,
GAL.Format.R16Uscaled,
@@ -27,10 +28,11 @@ namespace Ryujinx.Graphics.Vulkan
GAL.Format.R16G16B16A16Uscaled,
GAL.Format.R16G16B16A16Sscaled,
GAL.Format.R10G10B10A2Uscaled,
GAL.Format.R10G10B10A2Sscaled,
};
GAL.Format.R10G10B10A2Sscaled
];
private static readonly GAL.Format[] _intFormats = {
private static readonly GAL.Format[] _intFormats =
[
GAL.Format.R8Uint,
GAL.Format.R8Sint,
GAL.Format.R16Uint,
@@ -48,8 +50,8 @@ namespace Ryujinx.Graphics.Vulkan
GAL.Format.R16G16B16A16Uint,
GAL.Format.R16G16B16A16Sint,
GAL.Format.R10G10B10A2Uint,
GAL.Format.R10G10B10A2Sint,
};
GAL.Format.R10G10B10A2Sint
];
private readonly FormatFeatureFlags[] _bufferTable;
private readonly FormatFeatureFlags[] _optimalTable;
@@ -38,7 +38,7 @@ namespace Ryujinx.Graphics.Vulkan
bool isDepthStencil = format.IsDepthOrStencil();
_device = device;
_attachments = new[] { view.GetImageViewForAttachment() };
_attachments = [view.GetImageViewForAttachment()];
_validColorAttachments = isDepthStencil ? 0u : 1u;
_baseAttachment = view;
@@ -48,7 +48,7 @@ namespace Ryujinx.Graphics.Vulkan
}
else
{
_colors = new TextureView[] { view };
_colors = [view];
_colorsCanonical = _colors;
}
@@ -56,9 +56,9 @@ namespace Ryujinx.Graphics.Vulkan
Height = height;
Layers = 1;
AttachmentSamples = new[] { (uint)view.Info.Samples };
AttachmentFormats = new[] { view.VkFormat };
AttachmentIndices = isDepthStencil ? Array.Empty<int>() : new[] { 0 };
AttachmentSamples = [(uint)view.Info.Samples];
AttachmentFormats = [view.VkFormat];
AttachmentIndices = isDepthStencil ? [] : [0];
AttachmentIntegerFormatMask = format.IsInteger() ? 1u : 0u;
LogicOpsAllowed = !format.IsFloatOrSrgb();
+4 -4
View File
@@ -89,10 +89,10 @@ namespace Ryujinx.Graphics.Vulkan
}
else
{
bucket.Entries = new[]
{
entry,
};
bucket.Entries =
[
entry
];
}
bucket.Length++;
+92 -114
View File
@@ -68,109 +68,95 @@ namespace Ryujinx.Graphics.Vulkan
.Add(ResourceStages.Vertex, ResourceType.UniformBuffer, 1)
.Add(ResourceStages.Fragment, ResourceType.TextureAndSampler, 0).Build();
_programColorBlit = gd.CreateProgramWithMinimalLayout(new[]
{
_programColorBlit = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorBlitVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("ColorBlitFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, blitResourceLayout);
new ShaderSource(ReadSpirv("ColorBlitFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], blitResourceLayout);
_programColorBlitMs = gd.CreateProgramWithMinimalLayout(new[]
{
_programColorBlitMs = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorBlitVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("ColorBlitMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, blitResourceLayout);
new ShaderSource(ReadSpirv("ColorBlitMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], blitResourceLayout);
_programColorBlitClearAlpha = gd.CreateProgramWithMinimalLayout(new[]
{
_programColorBlitClearAlpha = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorBlitVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("ColorBlitClearAlphaFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, blitResourceLayout);
new ShaderSource(ReadSpirv("ColorBlitClearAlphaFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], blitResourceLayout);
var colorClearResourceLayout = new ResourceLayoutBuilder().Add(ResourceStages.Vertex, ResourceType.UniformBuffer, 1).Build();
_programColorClearF = gd.CreateProgramWithMinimalLayout(new[]
{
_programColorClearF = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorClearVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("ColorClearFFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, colorClearResourceLayout);
new ShaderSource(ReadSpirv("ColorClearFFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], colorClearResourceLayout);
_programColorClearSI = gd.CreateProgramWithMinimalLayout(new[]
{
_programColorClearSI = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorClearVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("ColorClearSIFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, colorClearResourceLayout);
new ShaderSource(ReadSpirv("ColorClearSIFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], colorClearResourceLayout);
_programColorClearUI = gd.CreateProgramWithMinimalLayout(new[]
{
_programColorClearUI = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorClearVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("ColorClearUIFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, colorClearResourceLayout);
new ShaderSource(ReadSpirv("ColorClearUIFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], colorClearResourceLayout);
_programDepthStencilClear = gd.CreateProgramWithMinimalLayout(new[]
{
_programDepthStencilClear = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorClearVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("DepthStencilClearFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, colorClearResourceLayout);
new ShaderSource(ReadSpirv("DepthStencilClearFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], colorClearResourceLayout);
var strideChangeResourceLayout = new ResourceLayoutBuilder()
.Add(ResourceStages.Compute, ResourceType.UniformBuffer, 0)
.Add(ResourceStages.Compute, ResourceType.StorageBuffer, 1)
.Add(ResourceStages.Compute, ResourceType.StorageBuffer, 2, true).Build();
_programStrideChange = gd.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(ReadSpirv("ChangeBufferStride.spv"), ShaderStage.Compute, TargetLanguage.Spirv),
}, strideChangeResourceLayout);
_programStrideChange = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ChangeBufferStride.spv"), ShaderStage.Compute, TargetLanguage.Spirv)
], strideChangeResourceLayout);
var colorCopyResourceLayout = new ResourceLayoutBuilder()
.Add(ResourceStages.Compute, ResourceType.UniformBuffer, 0)
.Add(ResourceStages.Compute, ResourceType.TextureAndSampler, 0)
.Add(ResourceStages.Compute, ResourceType.Image, 0, true).Build();
_programColorCopyShortening = gd.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(ReadSpirv("ColorCopyShorteningCompute.spv"), ShaderStage.Compute, TargetLanguage.Spirv),
}, colorCopyResourceLayout);
_programColorCopyShortening = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorCopyShorteningCompute.spv"), ShaderStage.Compute, TargetLanguage.Spirv)
], colorCopyResourceLayout);
_programColorCopyToNonMs = gd.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(ReadSpirv("ColorCopyToNonMsCompute.spv"), ShaderStage.Compute, TargetLanguage.Spirv),
}, colorCopyResourceLayout);
_programColorCopyToNonMs = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorCopyToNonMsCompute.spv"), ShaderStage.Compute, TargetLanguage.Spirv)
], colorCopyResourceLayout);
_programColorCopyWidening = gd.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(ReadSpirv("ColorCopyWideningCompute.spv"), ShaderStage.Compute, TargetLanguage.Spirv),
}, colorCopyResourceLayout);
_programColorCopyWidening = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorCopyWideningCompute.spv"), ShaderStage.Compute, TargetLanguage.Spirv)
], colorCopyResourceLayout);
var colorDrawToMsResourceLayout = new ResourceLayoutBuilder()
.Add(ResourceStages.Fragment, ResourceType.UniformBuffer, 0)
.Add(ResourceStages.Fragment, ResourceType.TextureAndSampler, 0).Build();
_programColorDrawToMs = gd.CreateProgramWithMinimalLayout(new[]
{
_programColorDrawToMs = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorDrawToMsVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("ColorDrawToMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, colorDrawToMsResourceLayout);
new ShaderSource(ReadSpirv("ColorDrawToMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], colorDrawToMsResourceLayout);
var convertD32S8ToD24S8ResourceLayout = new ResourceLayoutBuilder()
.Add(ResourceStages.Compute, ResourceType.UniformBuffer, 0)
.Add(ResourceStages.Compute, ResourceType.StorageBuffer, 1)
.Add(ResourceStages.Compute, ResourceType.StorageBuffer, 2, true).Build();
_programConvertD32S8ToD24S8 = gd.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(ReadSpirv("ConvertD32S8ToD24S8.spv"), ShaderStage.Compute, TargetLanguage.Spirv),
}, convertD32S8ToD24S8ResourceLayout);
_programConvertD32S8ToD24S8 = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ConvertD32S8ToD24S8.spv"), ShaderStage.Compute, TargetLanguage.Spirv)
], convertD32S8ToD24S8ResourceLayout);
var convertIndexBufferResourceLayout = new ResourceLayoutBuilder()
.Add(ResourceStages.Compute, ResourceType.UniformBuffer, 0)
.Add(ResourceStages.Compute, ResourceType.StorageBuffer, 1)
.Add(ResourceStages.Compute, ResourceType.StorageBuffer, 2, true).Build();
_programConvertIndexBuffer = gd.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(ReadSpirv("ConvertIndexBuffer.spv"), ShaderStage.Compute, TargetLanguage.Spirv),
}, convertIndexBufferResourceLayout);
_programConvertIndexBuffer = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ConvertIndexBuffer.spv"), ShaderStage.Compute, TargetLanguage.Spirv)
], convertIndexBufferResourceLayout);
var convertIndirectDataResourceLayout = new ResourceLayoutBuilder()
.Add(ResourceStages.Compute, ResourceType.UniformBuffer, 0)
@@ -178,60 +164,51 @@ namespace Ryujinx.Graphics.Vulkan
.Add(ResourceStages.Compute, ResourceType.StorageBuffer, 2, true)
.Add(ResourceStages.Compute, ResourceType.StorageBuffer, 3).Build();
_programConvertIndirectData = gd.CreateProgramWithMinimalLayout(new[]
{
new ShaderSource(ReadSpirv("ConvertIndirectData.spv"), ShaderStage.Compute, TargetLanguage.Spirv),
}, convertIndirectDataResourceLayout);
_programConvertIndirectData = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ConvertIndirectData.spv"), ShaderStage.Compute, TargetLanguage.Spirv)
], convertIndirectDataResourceLayout);
_programDepthBlit = gd.CreateProgramWithMinimalLayout(new[]
{
_programDepthBlit = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorBlitVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("DepthBlitFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, blitResourceLayout);
new ShaderSource(ReadSpirv("DepthBlitFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], blitResourceLayout);
_programDepthBlitMs = gd.CreateProgramWithMinimalLayout(new[]
{
_programDepthBlitMs = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorBlitVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("DepthBlitMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, blitResourceLayout);
new ShaderSource(ReadSpirv("DepthBlitMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], blitResourceLayout);
_programDepthDrawToMs = gd.CreateProgramWithMinimalLayout(new[]
{
_programDepthDrawToMs = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorDrawToMsVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("DepthDrawToMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, colorDrawToMsResourceLayout);
new ShaderSource(ReadSpirv("DepthDrawToMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], colorDrawToMsResourceLayout);
_programDepthDrawToNonMs = gd.CreateProgramWithMinimalLayout(new[]
{
_programDepthDrawToNonMs = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorDrawToMsVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("DepthDrawToNonMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, colorDrawToMsResourceLayout);
new ShaderSource(ReadSpirv("DepthDrawToNonMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], colorDrawToMsResourceLayout);
if (gd.Capabilities.SupportsShaderStencilExport)
{
_programStencilBlit = gd.CreateProgramWithMinimalLayout(new[]
{
_programStencilBlit = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorBlitVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("StencilBlitFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, blitResourceLayout);
new ShaderSource(ReadSpirv("StencilBlitFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], blitResourceLayout);
_programStencilBlitMs = gd.CreateProgramWithMinimalLayout(new[]
{
_programStencilBlitMs = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorBlitVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("StencilBlitMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, blitResourceLayout);
new ShaderSource(ReadSpirv("StencilBlitMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], blitResourceLayout);
_programStencilDrawToMs = gd.CreateProgramWithMinimalLayout(new[]
{
_programStencilDrawToMs = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorDrawToMsVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("StencilDrawToMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, colorDrawToMsResourceLayout);
new ShaderSource(ReadSpirv("StencilDrawToMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], colorDrawToMsResourceLayout);
_programStencilDrawToNonMs = gd.CreateProgramWithMinimalLayout(new[]
{
_programStencilDrawToNonMs = gd.CreateProgramWithMinimalLayout([
new ShaderSource(ReadSpirv("ColorDrawToMsVertex.spv"), ShaderStage.Vertex, TargetLanguage.Spirv),
new ShaderSource(ReadSpirv("StencilDrawToNonMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv),
}, colorDrawToMsResourceLayout);
new ShaderSource(ReadSpirv("StencilDrawToNonMsFragment.spv"), ShaderStage.Fragment, TargetLanguage.Spirv)
], colorDrawToMsResourceLayout);
}
}
@@ -406,7 +383,7 @@ namespace Ryujinx.Graphics.Vulkan
buffer.Holder.SetDataUnchecked<float>(buffer.Offset, region);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(1, buffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(1, buffer.Range)]);
Span<Viewport> viewports = stackalloc Viewport[1];
@@ -449,8 +426,8 @@ namespace Ryujinx.Graphics.Vulkan
int dstHeight = dst.Height;
_pipeline.SetRenderTarget(dst, (uint)dstWidth, (uint)dstHeight);
_pipeline.SetRenderTargetColorMasks(new uint[] { 0xf });
_pipeline.SetScissors(stackalloc Rectangle<int>[] { new Rectangle<int>(0, 0, dstWidth, dstHeight) });
_pipeline.SetRenderTargetColorMasks([0xf]);
_pipeline.SetScissors([new Rectangle<int>(0, 0, dstWidth, dstHeight)]);
if (clearAlpha)
{
@@ -502,7 +479,7 @@ namespace Ryujinx.Graphics.Vulkan
buffer.Holder.SetDataUnchecked<float>(buffer.Offset, region);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(1, buffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(1, buffer.Range)]);
Span<Viewport> viewports = stackalloc Viewport[1];
@@ -525,7 +502,7 @@ namespace Ryujinx.Graphics.Vulkan
int dstHeight = dst.Height;
_pipeline.SetRenderTarget(dst, (uint)dstWidth, (uint)dstHeight);
_pipeline.SetScissors(stackalloc Rectangle<int>[] { new Rectangle<int>(0, 0, dstWidth, dstHeight) });
_pipeline.SetScissors([new Rectangle<int>(0, 0, dstWidth, dstHeight)]);
_pipeline.SetViewports(viewports);
_pipeline.SetPrimitiveTopology(PrimitiveTopology.TriangleStrip);
@@ -656,7 +633,7 @@ namespace Ryujinx.Graphics.Vulkan
buffer.Holder.SetDataUnchecked(buffer.Offset, clearColor);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(1, buffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(1, buffer.Range)]);
Span<Viewport> viewports = stackalloc Viewport[1];
@@ -688,7 +665,7 @@ namespace Ryujinx.Graphics.Vulkan
_pipeline.SetRenderTarget(dst, (uint)dstWidth, (uint)dstHeight);
_pipeline.SetRenderTargetColorMasks(new[] { componentMask });
_pipeline.SetViewports(viewports);
_pipeline.SetScissors(stackalloc Rectangle<int>[] { scissor });
_pipeline.SetScissors([scissor]);
_pipeline.SetPrimitiveTopology(PrimitiveTopology.TriangleStrip);
_pipeline.Draw(4, 1, 0, 0);
_pipeline.Finish();
@@ -716,9 +693,9 @@ namespace Ryujinx.Graphics.Vulkan
using var buffer = gd.BufferManager.ReserveOrCreate(gd, cbs, ClearColorBufferSize);
buffer.Holder.SetDataUnchecked<float>(buffer.Offset, stackalloc float[] { depthValue });
buffer.Holder.SetDataUnchecked<float>(buffer.Offset, [depthValue]);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(1, buffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(1, buffer.Range)]);
Span<Viewport> viewports = stackalloc Viewport[1];
@@ -734,7 +711,7 @@ namespace Ryujinx.Graphics.Vulkan
_pipeline.SetProgram(_programDepthStencilClear);
_pipeline.SetRenderTarget(dst, (uint)dstWidth, (uint)dstHeight);
_pipeline.SetViewports(viewports);
_pipeline.SetScissors(stackalloc Rectangle<int>[] { scissor });
_pipeline.SetScissors([scissor]);
_pipeline.SetPrimitiveTopology(PrimitiveTopology.TriangleStrip);
_pipeline.SetDepthTest(new DepthTestDescriptor(true, depthMask, CompareOp.Always));
_pipeline.SetStencilTest(CreateStencilTestDescriptor(stencilMask != 0, stencilValue, 0xff, stencilMask));
@@ -775,7 +752,7 @@ namespace Ryujinx.Graphics.Vulkan
gd.BufferManager.SetData<float>(bufferHandle, 0, region);
pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(1, new BufferRange(bufferHandle, 0, RegionBufferSize)) });
pipeline.SetUniformBuffers([new BufferAssignment(1, new BufferRange(bufferHandle, 0, RegionBufferSize))]);
Span<Viewport> viewports = stackalloc Viewport[1];
@@ -851,7 +828,7 @@ namespace Ryujinx.Graphics.Vulkan
_pipeline.SetCommandBuffer(cbs);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(0, buffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(0, buffer.Range)]);
Span<Auto<DisposableBuffer>> sbRanges = new Auto<DisposableBuffer>[2];
@@ -1029,7 +1006,7 @@ namespace Ryujinx.Graphics.Vulkan
var srcFormat = GetFormat(componentSize, srcBpp / componentSize);
var dstFormat = GetFormat(componentSize, dstBpp / componentSize);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(0, buffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(0, buffer.Range)]);
for (int l = 0; l < levels; l++)
{
@@ -1110,7 +1087,7 @@ namespace Ryujinx.Graphics.Vulkan
1);
_pipeline.SetCommandBuffer(cbs);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(0, buffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(0, buffer.Range)]);
if (isDepthOrStencil)
{
@@ -1129,7 +1106,7 @@ namespace Ryujinx.Graphics.Vulkan
0f,
1f);
_pipeline.SetScissors(stackalloc Rectangle<int>[] { new Rectangle<int>(0, 0, dst.Width, dst.Height) });
_pipeline.SetScissors([new Rectangle<int>(0, 0, dst.Width, dst.Height)]);
_pipeline.SetViewports(viewports);
_pipeline.SetPrimitiveTopology(PrimitiveTopology.TriangleStrip);
@@ -1250,12 +1227,12 @@ namespace Ryujinx.Graphics.Vulkan
0f,
1f);
_pipeline.SetRenderTargetColorMasks(new uint[] { 0xf });
_pipeline.SetScissors(stackalloc Rectangle<int>[] { new Rectangle<int>(0, 0, dst.Width, dst.Height) });
_pipeline.SetRenderTargetColorMasks([0xf]);
_pipeline.SetScissors([new Rectangle<int>(0, 0, dst.Width, dst.Height)]);
_pipeline.SetViewports(viewports);
_pipeline.SetPrimitiveTopology(PrimitiveTopology.TriangleStrip);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(0, buffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(0, buffer.Range)]);
if (isDepthOrStencil)
{
@@ -1577,9 +1554,9 @@ namespace Ryujinx.Graphics.Vulkan
srcIndirectBufferOffset,
indirectDataSize);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(0, drawCountBufferAligned) });
_pipeline.SetUniformBuffers([new BufferAssignment(0, drawCountBufferAligned)]);
_pipeline.SetStorageBuffers(1, new[] { srcIndirectBuffer.GetBuffer(), dstIndirectBuffer.GetBuffer() });
_pipeline.SetStorageBuffers(stackalloc[] { new BufferAssignment(3, patternScoped.Range) });
_pipeline.SetStorageBuffers([new BufferAssignment(3, patternScoped.Range)]);
_pipeline.SetProgram(_programConvertIndirectData);
_pipeline.DispatchCompute(1, 1, 1);
@@ -1606,7 +1583,8 @@ namespace Ryujinx.Graphics.Vulkan
0,
convertedCount * outputIndexSize);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(0, new BufferRange(patternScoped.Handle, patternScoped.Offset, ParamsBufferSize)) });
_pipeline.SetUniformBuffers([new BufferAssignment(0, new BufferRange(patternScoped.Handle, patternScoped.Offset, ParamsBufferSize))
]);
_pipeline.SetStorageBuffers(1, new[] { srcIndexBuffer.GetBuffer(), dstIndexBuffer.GetBuffer() });
_pipeline.SetProgram(_programConvertIndexBuffer);
@@ -1674,7 +1652,7 @@ namespace Ryujinx.Graphics.Vulkan
_pipeline.SetCommandBuffer(cbs);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(0, buffer.Range) });
_pipeline.SetUniformBuffers([new BufferAssignment(0, buffer.Range)]);
Span<Auto<DisposableBuffer>> sbRanges = new Auto<DisposableBuffer>[2];
@@ -42,10 +42,10 @@ namespace Ryujinx.Graphics.Vulkan
Memory = memory;
HostPointer = hostPointer;
Size = size;
_freeRanges = new List<Range>
{
new Range(0, size),
};
_freeRanges =
[
new Range(0, size)
];
}
public ulong Allocate(ulong size, ulong alignment)
@@ -171,7 +171,7 @@ namespace Ryujinx.Graphics.Vulkan
public MemoryAllocatorBlockList(Vk api, Device device, int memoryTypeIndex, int blockAlignment, bool forBuffer)
{
_blocks = new List<Block>();
_blocks = [];
_api = api;
_device = device;
MemoryTypeIndex = memoryTypeIndex;
@@ -40,7 +40,7 @@ namespace Ryujinx.Graphics.Vulkan.MoltenVK
path = path[..^VulkanLib.Length] + "libMoltenVK.dylib";
return [path];
}
return Array.Empty<string>();
return [];
}
public static void InitializeResolver()
+2 -2
View File
@@ -127,8 +127,8 @@ namespace Ryujinx.Graphics.Vulkan
{
_descriptorSetUpdater.Initialize();
QuadsToTrisPattern = new IndexBufferPattern(Gd, 4, 6, 0, new[] { 0, 1, 2, 0, 2, 3 }, 4, false);
TriFanToTrisPattern = new IndexBufferPattern(Gd, 3, 3, 2, new[] { int.MinValue, -1, 0 }, 1, true);
QuadsToTrisPattern = new IndexBufferPattern(Gd, 4, 6, 0, [0, 1, 2, 0, 2, 3], 4, false);
TriFanToTrisPattern = new IndexBufferPattern(Gd, 3, 3, 2, [int.MinValue, -1, 0], 1, true);
}
public unsafe void Barrier()
@@ -168,7 +168,7 @@ namespace Ryujinx.Graphics.Vulkan
// If binding 3 is immediately used, use an alternate set of reserved bindings.
ReadOnlyCollection<ResourceUsage> uniformUsage = layout.SetUsages[0].Usages;
bool hasBinding3 = uniformUsage.Any(x => x.Binding == 3);
int[] reserved = isCompute ? Array.Empty<int>() : gd.GetPushDescriptorReservedBindings(hasBinding3);
int[] reserved = isCompute ? [] : gd.GetPushDescriptorReservedBindings(hasBinding3);
// Can't use any of the reserved usages.
for (int i = 0; i < uniformUsage.Count; i++)
@@ -249,7 +249,7 @@ namespace Ryujinx.Graphics.Vulkan
for (int setIndex = 0; setIndex < sets.Count; setIndex++)
{
List<ResourceBindingSegment> currentSegments = new();
List<ResourceBindingSegment> currentSegments = [];
ResourceDescriptor currentDescriptor = default;
int currentCount = 0;
@@ -307,7 +307,7 @@ namespace Ryujinx.Graphics.Vulkan
for (int setIndex = 0; setIndex < setUsages.Count; setIndex++)
{
List<ResourceBindingSegment> currentSegments = new();
List<ResourceBindingSegment> currentSegments = [];
ResourceUsage currentUsage = default;
int currentCount = 0;
@@ -20,7 +20,8 @@ namespace Ryujinx.Graphics.Vulkan
private const string AppName = "Ryujinx.Graphics.Vulkan";
private const int QueuesCount = 2;
private static readonly string[] _desirableExtensions = {
private static readonly string[] _desirableExtensions =
[
ExtConditionalRendering.ExtensionName,
ExtExtendedDynamicState.ExtensionName,
ExtTransformFeedback.ExtensionName,
@@ -43,12 +44,13 @@ namespace Ryujinx.Graphics.Vulkan
"VK_KHR_portability_subset", // As per spec, we should enable this if present.
"VK_EXT_4444_formats",
"VK_KHR_8bit_storage",
"VK_KHR_maintenance2",
};
"VK_KHR_maintenance2"
];
private static readonly string[] _requiredExtensions = {
KhrSwapchain.ExtensionName,
};
private static readonly string[] _requiredExtensions =
[
KhrSwapchain.ExtensionName
];
internal static VulkanInstance CreateInstance(Vk api, GraphicsDebugLevel logLevel, string[] requiredExtensions)
{
@@ -194,12 +196,12 @@ namespace Ryujinx.Graphics.Vulkan
// TODO: Remove this once we relax our initialization codepaths.
if (instance.InstanceVersion < _minimalInstanceVulkanVersion)
{
return Array.Empty<DeviceInfo>();
return [];
}
instance.EnumeratePhysicalDevices(out VulkanPhysicalDevice[] physicalDevices).ThrowOnError();
List<DeviceInfo> deviceInfos = new();
List<DeviceInfo> deviceInfos = [];
foreach (VulkanPhysicalDevice physicalDevice in physicalDevices)
{
@@ -81,8 +81,8 @@ namespace Ryujinx.Graphics.Vulkan
private readonly string _preferredGpuId;
private int[] _pdReservedBindings;
private readonly static int[] _pdReservedBindingsNvn = { 3, 18, 21, 36, 30 };
private readonly static int[] _pdReservedBindingsOgl = { 17, 18, 34, 35, 36 };
private readonly static int[] _pdReservedBindingsNvn = [3, 18, 21, 36, 30];
private readonly static int[] _pdReservedBindingsOgl = [17, 18, 34, 35, 36];
internal Vendor Vendor { get; private set; }
internal bool IsAmdWindows { get; private set; }
@@ -110,9 +110,9 @@ namespace Ryujinx.Graphics.Vulkan
_getRequiredExtensions = requiredExtensionsFunc;
_preferredGpuId = preferredGpuId;
Api = api;
Shaders = new HashSet<ShaderCollection>();
Textures = new HashSet<ITexture>();
Samplers = new HashSet<SamplerHolder>();
Shaders = [];
Textures = [];
Samplers = [];
if (OperatingSystem.IsMacOS())
{
@@ -484,7 +484,7 @@ namespace Ryujinx.Graphics.Vulkan
}
else
{
_pdReservedBindings = Array.Empty<int>();
_pdReservedBindings = [];
}
}
@@ -794,7 +794,7 @@ namespace Ryujinx.Graphics.Vulkan
{
Logger.Error?.PrintMsg(LogClass.Gpu, $"Error querying Vulkan devices: {ex.Message}");
return Array.Empty<DeviceInfo>();
return [];
}
}
@@ -807,7 +807,7 @@ namespace Ryujinx.Graphics.Vulkan
catch (Exception)
{
// If we got an exception here, Vulkan is most likely not supported.
return Array.Empty<DeviceInfo>();
return [];
}
}
+4 -4
View File
@@ -393,7 +393,7 @@ namespace Ryujinx.Graphics.Vulkan
_gd.CommandBufferPool.Return(
cbs,
null,
stackalloc[] { PipelineStageFlags.ColorAttachmentOutputBit },
[PipelineStageFlags.ColorAttachmentOutputBit],
null);
_gd.FlushAllCommands();
cbs.GetFence().Wait();
@@ -456,9 +456,9 @@ namespace Ryujinx.Graphics.Vulkan
_gd.CommandBufferPool.Return(
cbs,
stackalloc[] { _imageAvailableSemaphores[semaphoreIndex] },
stackalloc[] { PipelineStageFlags.ColorAttachmentOutputBit },
stackalloc[] { _renderFinishedSemaphores[semaphoreIndex] });
[_imageAvailableSemaphores[semaphoreIndex]],
[PipelineStageFlags.ColorAttachmentOutputBit],
[_renderFinishedSemaphores[semaphoreIndex]]);
// TODO: Present queue.
var semaphore = _renderFinishedSemaphores[semaphoreIndex];