diff --git a/src/Ryujinx.Graphics.Vulkan/BufferHolder.cs b/src/Ryujinx.Graphics.Vulkan/BufferHolder.cs index a93ced0e5..101758c78 100644 --- a/src/Ryujinx.Graphics.Vulkan/BufferHolder.cs +++ b/src/Ryujinx.Graphics.Vulkan/BufferHolder.cs @@ -819,6 +819,8 @@ namespace Ryujinx.Graphics.Vulkan endRenderPass?.Invoke(); + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"BufferHolder.TryPushData: {data.Length} bytes -> {dstOffset:X}", new ColorF(1, 1, 0, 1)); + var dstBuffer = GetBuffer(cbs.CommandBuffer, dstOffset, data.Length, true).Get(cbs, dstOffset, data.Length, true).Value; _writeCount--; @@ -868,6 +870,8 @@ namespace Ryujinx.Graphics.Vulkan int size, bool registerSrcUsage = true) { + using var debugScope = gd.CreateLabelScope(cbs.CommandBuffer, $"BufferHolder.Copy: {srcOffset:X}->{dstOffset:X} {size} bytes", new ColorF(1, 1, 0, 1)); + var srcBuffer = registerSrcUsage ? src.Get(cbs, srcOffset, size).Value : src.GetUnsafe().Value; var dstBuffer = dst.Get(cbs, dstOffset, size, true).Value; diff --git a/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs b/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs index 14e4c02f0..770fef1ee 100644 --- a/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs +++ b/src/Ryujinx.Graphics.Vulkan/DescriptorSetUpdater.cs @@ -414,6 +414,8 @@ namespace Ryujinx.Graphics.Vulkan return; } + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"DescriptorSetUpdater.UpdateAndBindDescriptorSets({pbp})", new ColorF(1, 0, 1, 1)); + if (_dirty.HasFlag(DirtyFlags.Uniform)) { if (_program.UsePushDescriptors) @@ -488,6 +490,8 @@ namespace Ryujinx.Graphics.Vulkan return; } + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"DescriptorSetUpdater.UpdateAndBind({pbp}): set:{setIndex}", new ColorF(1, 0, 1, 1)); + var dummyBuffer = _dummyBuffer?.GetBuffer(); var dsc = program.GetNewDescriptorSetCollection(_gd, cbs.CommandBufferIndex, setIndex, out var isNew).Get(cbs); @@ -649,6 +653,8 @@ namespace Ryujinx.Graphics.Vulkan [MethodImpl(MethodImplOptions.AggressiveInlining)] private void UpdateAndBindUniformBufferPd(CommandBufferScoped cbs, PipelineBindPoint pbp) { + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"DescriptorSetUpdater.UpdateAndBindUniformBufferPd({pbp})", new ColorF(1, 0, 1, 1)); + var bindingSegments = _program.BindingSegments[PipelineBase.UniformSetIndex]; var dummyBuffer = _dummyBuffer?.GetBuffer(); diff --git a/src/Ryujinx.Graphics.Vulkan/HelperShader.cs b/src/Ryujinx.Graphics.Vulkan/HelperShader.cs index 5be4a9329..e890e84cc 100644 --- a/src/Ryujinx.Graphics.Vulkan/HelperShader.cs +++ b/src/Ryujinx.Graphics.Vulkan/HelperShader.cs @@ -255,6 +255,7 @@ namespace Ryujinx.Graphics.Vulkan gd.FlushAllCommands(); using var cbs = gd.CommandBufferPool.Rent(); + using var debugScope = gd.CreateLabelScope(cbs.CommandBuffer, $"HelperShader.Blit: {src.Info.Format}:{srcRegion} -> {dst.Info.Format}:{dstRegion}", new ColorF(0, 1, 1, 1)); var dstFormat = dst.VkFormat; var dstSamples = dst.Info.Samples; @@ -341,6 +342,8 @@ namespace Ryujinx.Graphics.Vulkan int depth, int levels) { + using var debugScope = gd.CreateLabelScope(cbs.CommandBuffer, $"HelperShader.CopyColor: {src.Info.Format}:{srcLayer}:{srcLevel} -> {dst.Info.Format}:{dstLayer}:{dstLevel}", new ColorF(0, 1, 1, 1)); + for (int l = 0; l < levels; l++) { int mipSrcLevel = srcLevel + l; @@ -405,6 +408,8 @@ namespace Ryujinx.Graphics.Vulkan bool linearFilter, bool clearAlpha = false) { + using var debugScope = gd.CreateLabelScope(cbs.CommandBuffer, $"HelperShader.BlitColor: {src.Info.Format}:{srcRegion} -> {dstFormat}:{dstRegion}", new ColorF(0, 1, 1, 1)); + _pipeline.SetCommandBuffer(cbs); const int RegionBufferSize = 16; @@ -506,6 +511,8 @@ namespace Ryujinx.Graphics.Vulkan Extents2D srcRegion, Extents2D dstRegion) { + using var debugScope = gd.CreateLabelScope(cbs.CommandBuffer, $"HelperShader.BlitDepthStencil: {src.Info.Format}:{srcRegion} -> {dstFormat}:{dstRegion}", new ColorF(0, 1, 1, 1)); + _pipeline.SetCommandBuffer(cbs); const int RegionBufferSize = 16; @@ -679,6 +686,8 @@ namespace Ryujinx.Graphics.Vulkan using var cbs = gd.CommandBufferPool.Rent(); + using var debugScope = gd.CreateLabelScope(cbs.CommandBuffer, $"HelperShader.Clear: {dstWidth}x{dstHeight} {clearColor.ToString()}", new ColorF(0, 1, 1, 1)); + _pipeline.SetCommandBuffer(cbs); var bufferHandle = gd.BufferManager.CreateWithHandle(gd, ClearColorBufferSize); @@ -785,6 +794,8 @@ namespace Ryujinx.Graphics.Vulkan { const int RegionBufferSize = 16; + using var debugScope = gd.CreateLabelScope(pipeline.CurrentCommandBuffer.CommandBuffer, $"HelperShader.DrawTexture: {srcRegion}->{dstRegion}", new ColorF(0, 1, 1, 1)); + pipeline.SetTextureAndSampler(ShaderStage.Fragment, 0, src, srcSampler); Span region = stackalloc float[RegionBufferSize / sizeof(float)]; @@ -837,11 +848,15 @@ namespace Ryujinx.Graphics.Vulkan public void ConvertI8ToI16(VulkanRenderer gd, CommandBufferScoped cbs, BufferHolder src, BufferHolder dst, int srcOffset, int size) { + using var debugScope = gd.CreateLabelScope(cbs.CommandBuffer, $"HelperShader.ConvertI8ToI16: 0x{srcOffset:X} {size} bytes", new ColorF(0, 1, 1, 1)); + ChangeStride(gd, cbs, src, dst, srcOffset, size, 1, 2); } public unsafe void ChangeStride(VulkanRenderer gd, CommandBufferScoped cbs, BufferHolder src, BufferHolder dst, int srcOffset, int size, int stride, int newStride) { + using var debugScope = gd.CreateLabelScope(cbs.CommandBuffer, $"HelperShader.ChangeStride: 0x{srcOffset:X}#{size} {stride}->{newStride}", new ColorF(0, 1, 1, 1)); + bool supportsUint8 = gd.Capabilities.SupportsShaderInt8; int elems = size / stride; @@ -938,6 +953,8 @@ namespace Ryujinx.Graphics.Vulkan int srcOffset, int indexCount) { + using var debugScope = gd.CreateLabelScope(cbs.CommandBuffer, $"HelperShader.ConvertIndexBuffer: 0x{srcOffset:X} uint{indexSize * 8}x{indexCount}", new ColorF(0, 1, 1, 1)); + // TODO: Support conversion with primitive restart enabled. // TODO: Convert with a compute shader? @@ -1023,6 +1040,8 @@ namespace Ryujinx.Graphics.Vulkan int depth, int levels) { + using var debugScope = gd.CreateLabelScope(cbs.CommandBuffer, $"HelperShader.CopyIncompatibleFormats: {src.VkFormat}:{srcLayer}:{srcLevel} -> {dst.VkFormat}:{dstLayer}:{dstLevel}", new ColorF(0, 1, 1, 1)); + const int ParamsBufferSize = 4; Span shaderParams = stackalloc int[sizeof(int)]; @@ -1114,6 +1133,8 @@ namespace Ryujinx.Graphics.Vulkan public void CopyMSToNonMS(VulkanRenderer gd, CommandBufferScoped cbs, TextureView src, TextureView dst, int srcLayer, int dstLayer, int depth) { + using var debugScope = gd.CreateLabelScope(cbs.CommandBuffer, $"HelperShader.BlitColor: {src.VkFormat}:{srcLayer} -> {dst.VkFormat}:{dstLayer}", new ColorF(0, 1, 1, 1)); + const int ParamsBufferSize = 16; Span shaderParams = stackalloc int[ParamsBufferSize / sizeof(int)]; diff --git a/src/Ryujinx.Graphics.Vulkan/PersistentFlushBuffer.cs b/src/Ryujinx.Graphics.Vulkan/PersistentFlushBuffer.cs index 80a24682b..327645a5a 100644 --- a/src/Ryujinx.Graphics.Vulkan/PersistentFlushBuffer.cs +++ b/src/Ryujinx.Graphics.Vulkan/PersistentFlushBuffer.cs @@ -41,6 +41,8 @@ namespace Ryujinx.Graphics.Vulkan if (srcBuffer.TryIncrementReferenceCount()) { + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"PersistentFlushBuffer.GetBufferData: 0x{offset:X} {size} bytes", new ColorF(0.5f, 0.5f, 1, 1)); + BufferHolder.Copy(_gd, cbs, srcBuffer, dstBuffer, offset, 0, size, registerSrcUsage: false); } else @@ -66,6 +68,8 @@ namespace Ryujinx.Graphics.Vulkan var buffer = flushStorage.GetBuffer(cbs.CommandBuffer).Get(cbs).Value; var image = view.GetImage().Get(cbs).Value; + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"PersistentFlushBuffer.GetTextureData: {size} bytes", new ColorF(0.5f, 0.5f, 1, 1)); + view.CopyFromOrToBuffer(cbs.CommandBuffer, buffer, image, size, true, 0, 0, info.GetLayers(), info.Levels, singleSlice: false); } @@ -82,6 +86,8 @@ namespace Ryujinx.Graphics.Vulkan var buffer = flushStorage.GetBuffer(cbs.CommandBuffer).Get(cbs).Value; var image = view.GetImage().Get(cbs).Value; + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"PersistentFlushBuffer.GetTextureData: {size} bytes layer:{layer} level:{level}", new ColorF(0.5f, 0.5f, 1, 1)); + view.CopyFromOrToBuffer(cbs.CommandBuffer, buffer, image, size, true, layer, level, 1, 1, singleSlice: true); } diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs index 54b67f35e..3f5003d05 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -54,6 +54,7 @@ namespace Ryujinx.Graphics.Vulkan private Auto _framebuffer; private Auto _renderPass; private int _writtenAttachmentCount; + private ILabelScope _renderPassLabelScope; private bool _framebufferUsingColorWriteMask; @@ -130,6 +131,8 @@ namespace Ryujinx.Graphics.Vulkan public unsafe void Barrier() { + using var debugScope = Gd.CreateLabelScope(CommandBuffer, $"PipelineBase.Barrier", new ColorF(1, 0.5f, 0, 1)); + if (_drawCountSinceBarrier != DrawCount) { _drawCountSinceBarrier = DrawCount; @@ -164,6 +167,8 @@ namespace Ryujinx.Graphics.Vulkan public void ComputeBarrier() { + using var debugScope = Gd.CreateLabelScope(CommandBuffer, $"PipelineBase.ComputeBarrier", new ColorF(1, 0.5f, 0, 1)); + MemoryBarrier memoryBarrier = new() { SType = StructureType.MemoryBarrier, @@ -195,6 +200,8 @@ namespace Ryujinx.Graphics.Vulkan var dst = Gd.BufferManager.GetBuffer(CommandBuffer, destination, offset, size, true).Get(Cbs, offset, size, true).Value; + using var debugScope = Gd.CreateLabelScope(CommandBuffer, $"PipelineBase.ClearBuffer: {value:X} -> 0x{offset:X} {size} bytes", new ColorF(1, 0.5f, 0, 1)); + BufferHolder.InsertBufferBarrier( Gd, Cbs.CommandBuffer, @@ -234,6 +241,8 @@ namespace Ryujinx.Graphics.Vulkan BeginRenderPass(); + _renderPassLabelScope?.InsertLabel($"PipelineBase.ClearRenderTargetColor({index}, {layer}, {layerCount})", color); + var clearValue = new ClearValue(new ClearColorValue(color.Red, color.Green, color.Blue, color.Alpha)); var attachment = new ClearAttachment(ImageAspectFlags.ColorBit, (uint)index, clearValue); var clearRect = FramebufferParams.GetClearRect(ClearScissor, layer, layerCount); @@ -269,9 +278,10 @@ namespace Ryujinx.Graphics.Vulkan { CreateRenderPass(); } - BeginRenderPass(); + _renderPassLabelScope?.InsertLabel($"PipelineBase.ClearRenderTargetDepthStencil({layer}, {layerCount}, {depthValue}, {stencilValue})", new ColorF(1, 0.5f, 0, 1)); + var attachment = new ClearAttachment(flags, 0, clearValue); var clearRect = FramebufferParams.GetClearRect(ClearScissor, layer, layerCount); @@ -368,6 +378,7 @@ namespace Ryujinx.Graphics.Vulkan BeginRenderPass(); DrawCount++; + _renderPassLabelScope?.InsertLabel($"PipelineBase.Draw({vertexCount}, {instanceCount}, {firstVertex}, {firstInstance})", new ColorF(1, 0.5f, 0, 1)); if (Gd.TopologyUnsupported(_topology)) { // Temporarily bind a conversion pattern as an index buffer. @@ -1296,6 +1307,8 @@ namespace Ryujinx.Graphics.Vulkan } } + using var debugScope = Gd.CreateLabelScope(CommandBuffer, $"PipelineBase.SetVertexBuffers({validCount})", new ColorF(1, 0.5f, 0, 1)); + _vertexBufferUpdater.Commit(Cbs); _newState.VertexBindingDescriptionsCount = (uint)validCount; @@ -1572,6 +1585,8 @@ namespace Ryujinx.Graphics.Vulkan Gd.FlushAllCommands(); } + using var debugScope = Gd.CreateLabelScope(CommandBuffer, $"PipelineBase.RecreatePipelineIfNeeded({pbp})", new ColorF(1, 0.75f, 0, 1)); + DynamicState.ReplayIfDirty(Gd.Api, CommandBuffer); if (_needsIndexBufferRebind && _indexBufferPattern == null) @@ -1660,6 +1675,7 @@ namespace Ryujinx.Graphics.Vulkan ClearValueCount = 1, }; + _renderPassLabelScope = Gd.CreateLabelScope(CommandBuffer, $"PipelineBase.RenderPass: {FramebufferParams.Width}x{FramebufferParams.Height}", new ColorF(1, 0.5f, 0, 1)); Gd.Api.CmdBeginRenderPass(CommandBuffer, renderPassBeginInfo, SubpassContents.Inline); RenderPassActive = true; } @@ -1671,6 +1687,8 @@ namespace Ryujinx.Graphics.Vulkan { PauseTransformFeedbackInternal(); Gd.Api.CmdEndRenderPass(CommandBuffer); + _renderPassLabelScope.Dispose(); + _renderPassLabelScope = null; SignalRenderPassEnd(); RenderPassActive = false; } diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineFull.cs b/src/Ryujinx.Graphics.Vulkan/PipelineFull.cs index c3e6f37c3..03a56024e 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineFull.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineFull.cs @@ -32,6 +32,8 @@ namespace Ryujinx.Graphics.Vulkan private void CopyPendingQuery() { + using var debugScope = _pendingQueryCopies.Count > 0 ? Gd.CreateLabelScope(CommandBuffer, $"PipelineFull.CopyPendingQuery({_pendingQueryCopies.Count})", new ColorF(0.5f, 1.0f, 0, 1)) : null; + foreach (var query in _pendingQueryCopies) { query.PoolCopy(Cbs); @@ -47,6 +49,8 @@ namespace Ryujinx.Graphics.Vulkan return; } + using var debugScope = Gd.CreateLabelScope(CommandBuffer, $"PipelineFull.ClearRenderTargetColor({index},{layer},{layerCount},{componentMask})", color); + if (componentMask != 0xf) { // We can't use CmdClearAttachments if not writing all components, @@ -239,6 +243,8 @@ namespace Ryujinx.Graphics.Vulkan public void Restore() { + using var debugScope = Gd.CreateLabelScope(CommandBuffer, $"PipelineFull.Restore({Pbp})", new ColorF(0.5f, 1.0f, 0, 1)); + if (Pipeline != null) { Gd.Api.CmdBindPipeline(CommandBuffer, Pbp, Pipeline.Get(Cbs).Value); diff --git a/src/Ryujinx.Graphics.Vulkan/StagingBuffer.cs b/src/Ryujinx.Graphics.Vulkan/StagingBuffer.cs index 3a02a28dc..580171633 100644 --- a/src/Ryujinx.Graphics.Vulkan/StagingBuffer.cs +++ b/src/Ryujinx.Graphics.Vulkan/StagingBuffer.cs @@ -1,5 +1,6 @@ using Ryujinx.Common; using Ryujinx.Common.Logging; +using Ryujinx.Graphics.GAL; using System; using System.Collections.Generic; using System.Diagnostics; @@ -102,6 +103,8 @@ namespace Ryujinx.Graphics.Vulkan private void PushDataImpl(CommandBufferScoped cbs, BufferHolder dst, int dstOffset, ReadOnlySpan data) { + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"StagingBuffer.PushDataImpl: {data.Length} bytes -> 0x{dstOffset:X}", new ColorF(1, 1, 0, 1)); + var srcBuffer = _buffer.GetBuffer(); var dstBuffer = dst.GetBuffer(cbs.CommandBuffer, dstOffset, data.Length, true); diff --git a/src/Ryujinx.Graphics.Vulkan/TextureCopy.cs b/src/Ryujinx.Graphics.Vulkan/TextureCopy.cs index 717935fb4..9f5f4bbcb 100644 --- a/src/Ryujinx.Graphics.Vulkan/TextureCopy.cs +++ b/src/Ryujinx.Graphics.Vulkan/TextureCopy.cs @@ -360,6 +360,8 @@ namespace Ryujinx.Graphics.Vulkan TextureView src, TextureView dst) { + using var debugScope = gd.CreateLabelScope(cbs.CommandBuffer, $"TextureCopy.ResolveDepthStencil({src.Info.Format})", new ColorF(1, 0, 1, 1)); + var dsAttachmentReference = new AttachmentReference2(StructureType.AttachmentReference2, null, 0, ImageLayout.General); var dsResolveAttachmentReference = new AttachmentReference2(StructureType.AttachmentReference2, null, 1, ImageLayout.General); diff --git a/src/Ryujinx.Graphics.Vulkan/TextureStorage.cs b/src/Ryujinx.Graphics.Vulkan/TextureStorage.cs index 090f69dca..8a1efd969 100644 --- a/src/Ryujinx.Graphics.Vulkan/TextureStorage.cs +++ b/src/Ryujinx.Graphics.Vulkan/TextureStorage.cs @@ -256,6 +256,8 @@ namespace Ryujinx.Graphics.Vulkan } } + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"TextureStorage.InitialTransition({srcLayout} -> {dstLayout})", new ColorF(1, 1, 0, 1)); + var aspectFlags = _info.Format.ConvertAspectFlags(); var subresourceRange = new ImageSubresourceRange(aspectFlags, 0, (uint)_info.Levels, 0, (uint)_info.GetLayers()); @@ -352,6 +354,8 @@ namespace Ryujinx.Graphics.Vulkan ImageAspectFlags aspectFlags, bool forFlush) { + using var debugScope = _gd.CreateLabelScope(commandBuffer, $"TextureStorage.CopyFromOrToBuffer({Info.Format} {(to ? "->" : "<-")} {size} bytes)", new ColorF(0, 0, 1, 1)); + bool is3D = Info.Target == Target.Texture3D; int width = Info.Width; int height = Info.Height; @@ -444,6 +448,8 @@ namespace Ryujinx.Graphics.Vulkan { if (_lastReadAccess != AccessFlags.None) { + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"TextureStorage.InsertReadToWriteBarrier({dstAccessFlags}, {dstStageFlags})", new ColorF(0, 0, 1, 1)); + ImageAspectFlags aspectFlags = Info.Format.ConvertAspectFlags(); TextureView.InsertImageBarrier( @@ -472,6 +478,8 @@ namespace Ryujinx.Graphics.Vulkan if (_lastModificationAccess != AccessFlags.None) { + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"TextureStorage.InsertWriteToReadBarrier({dstAccessFlags}, {dstStageFlags})", new ColorF(0, 0, 1, 1)); + ImageAspectFlags aspectFlags = Info.Format.ConvertAspectFlags(); TextureView.InsertImageBarrier( diff --git a/src/Ryujinx.Graphics.Vulkan/TextureView.cs b/src/Ryujinx.Graphics.Vulkan/TextureView.cs index 9fc50f67a..60a55662f 100644 --- a/src/Ryujinx.Graphics.Vulkan/TextureView.cs +++ b/src/Ryujinx.Graphics.Vulkan/TextureView.cs @@ -195,6 +195,8 @@ namespace Ryujinx.Graphics.Vulkan var srcImage = src.GetImage().Get(cbs).Value; var dstImage = dst.GetImage().Get(cbs).Value; + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"TextureView.CopyTo({Info.Format} -> {dst.Info.Format}{firstLayer}:{firstLevel})", new ColorF(1, 1, 0, 1)); + if (!dst.Info.Target.IsMultisample() && Info.Target.IsMultisample()) { int layers = Math.Min(Info.GetLayers(), dst.Info.GetLayers() - firstLayer); @@ -247,6 +249,7 @@ namespace Ryujinx.Graphics.Vulkan var srcImage = src.GetImage().Get(cbs).Value; var dstImage = dst.GetImage().Get(cbs).Value; + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"TextureView.CopyTo({Info.Format}:{srcLayer}:{srcLevel} -> {dst.Info.Format}:{dstLayer}:{dstLevel})", new ColorF(1, 1, 0, 1)); if (!dst.Info.Target.IsMultisample() && Info.Target.IsMultisample()) { @@ -292,6 +295,7 @@ namespace Ryujinx.Graphics.Vulkan var cbs = _gd.PipelineInternal.CurrentCommandBuffer; + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"TextureView.CopyTo({Info.Format}:{srcRegion} -> {dst.Info.Format}:{dstRegion})", new ColorF(1, 1, 0, 1)); CopyToImpl(cbs, dst, srcRegion, dstRegion, linearFilter); } else @@ -300,6 +304,7 @@ namespace Ryujinx.Graphics.Vulkan using var cbs = cbp.Rent(); + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"TextureView.CopyTo({Info.Format}:{srcRegion} -> {dst.Info.Format}:{dstRegion})", new ColorF(1, 1, 0, 1)); CopyToImpl(cbs, dst, srcRegion, dstRegion, linearFilter); } } @@ -308,6 +313,8 @@ namespace Ryujinx.Graphics.Vulkan { var src = this; + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"TextureView.CopyToImpl({src.Info.Format}:{srcRegion} -> {dst.Info.Format}:{dstRegion})", new ColorF(1, 1, 0, 1)); + var srcFormat = GetCompatibleGalFormat(src.Info.Format); var dstFormat = GetCompatibleGalFormat(dst.Info.Format); @@ -767,6 +774,8 @@ namespace Ryujinx.Graphics.Vulkan int offset = 0, int stride = 0) { + using var debugScope = _gd.CreateLabelScope(commandBuffer, $"TextureView.CopyFromOrToBuffer({Info.Format} {(to ? "->" : "<-")} {size} bytes)", new ColorF(1, 1, 0, 1)); + bool is3D = Info.Target == Target.Texture3D; int width = Math.Max(1, Info.Width >> dstLevel); int height = Math.Max(1, Info.Height >> dstLevel); @@ -777,6 +786,8 @@ namespace Ryujinx.Graphics.Vulkan for (int level = 0; level < levels; level++) { + debugScope.InsertLabel($"level: {level}", new ColorF(1, 1, 0, 1)); + int mipSize = GetBufferDataLength(Info.GetMipSize2D(dstLevel + level) * dstLayers); int endOffset = offset + mipSize; @@ -847,6 +858,8 @@ namespace Ryujinx.Graphics.Vulkan int width, int height) { + using var debugScope = _gd.CreateLabelScope(commandBuffer, $"TextureView.CopyFromOrToBuffer({Info.Format} {(to ? "->" : "<-")} {size} bytes)", new ColorF(1, 1, 0, 1)); + var aspectFlags = Info.Format.ConvertAspectFlags(); if (aspectFlags == (ImageAspectFlags.DepthBit | ImageAspectFlags.StencilBit)) diff --git a/src/Ryujinx.Graphics.Vulkan/Window.cs b/src/Ryujinx.Graphics.Vulkan/Window.cs index 2d0ad664c..97ec0aee3 100644 --- a/src/Ryujinx.Graphics.Vulkan/Window.cs +++ b/src/Ryujinx.Graphics.Vulkan/Window.cs @@ -295,6 +295,8 @@ namespace Ryujinx.Graphics.Vulkan var cbs = _gd.CommandBufferPool.Rent(); + using var debugScope = _gd.CreateLabelScope(cbs.CommandBuffer, $"Window.Present", new ColorF(0, 1, 0, 1)); + Transition( cbs.CommandBuffer, swapchainImage, @@ -541,6 +543,8 @@ namespace Ryujinx.Graphics.Vulkan ImageLayout srcLayout, ImageLayout dstLayout) { + using var debugScope = _gd.CreateLabelScope(commandBuffer, $"Window.Transition({srcAccess}:{srcLayout} -> {dstAccess}:{dstLayout})", new ColorF(1, 1, 0, 1)); + var subresourceRange = new ImageSubresourceRange(ImageAspectFlags.ColorBit, 0, 1, 0, 1); var barrier = new ImageMemoryBarrier