Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f82309fa2d | ||
|
7d8e198c33 | ||
|
3d98e1361b | ||
|
141cf61ff7 | ||
|
3fe3598d41 |
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
@@ -57,6 +57,7 @@ jobs:
|
|||||||
- name: Get git short hash
|
- name: Get git short hash
|
||||||
id: git_short_hash
|
id: git_short_hash
|
||||||
run: echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
|
run: echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
|
||||||
|
shell: bash
|
||||||
- name: Clear
|
- name: Clear
|
||||||
run: dotnet clean && dotnet nuget locals all --clear
|
run: dotnet clean && dotnet nuget locals all --clear
|
||||||
- name: Build
|
- name: Build
|
||||||
|
@@ -710,7 +710,12 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||||||
break;
|
break;
|
||||||
case Target.Texture2DMultisample:
|
case Target.Texture2DMultisample:
|
||||||
case Target.Texture2DMultisampleArray:
|
case Target.Texture2DMultisampleArray:
|
||||||
if (rhs.Target == Target.Texture2D || rhs.Target == Target.Texture2DArray)
|
// We don't support copy between multisample and non-multisample depth-stencil textures
|
||||||
|
// because there's no way to emulate that since most GPUs don't support writing a
|
||||||
|
// custom stencil value into the texture, among several other API limitations.
|
||||||
|
|
||||||
|
if ((rhs.Target == Target.Texture2D || rhs.Target == Target.Texture2DArray) &&
|
||||||
|
!rhs.FormatInfo.Format.IsDepthOrStencil())
|
||||||
{
|
{
|
||||||
return TextureViewCompatibility.CopyOnly;
|
return TextureViewCompatibility.CopyOnly;
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,9 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg
|
|||||||
{
|
{
|
||||||
unsafe class FFmpegContext : IDisposable
|
unsafe class FFmpegContext : IDisposable
|
||||||
{
|
{
|
||||||
private readonly FFCodec.AVCodec_decode _decodeFrame;
|
private unsafe delegate int AVCodec_decode(AVCodecContext* avctx, void* outdata, int* got_frame_ptr, AVPacket* avpkt);
|
||||||
|
|
||||||
|
private readonly AVCodec_decode _decodeFrame;
|
||||||
private static readonly FFmpegApi.av_log_set_callback_callback _logFunc;
|
private static readonly FFmpegApi.av_log_set_callback_callback _logFunc;
|
||||||
private readonly AVCodec* _codec;
|
private readonly AVCodec* _codec;
|
||||||
private AVPacket* _packet;
|
private AVPacket* _packet;
|
||||||
@@ -53,17 +55,17 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg
|
|||||||
// libavcodec 59.24 changed AvCodec to move its private API and also move the codec function to an union.
|
// libavcodec 59.24 changed AvCodec to move its private API and also move the codec function to an union.
|
||||||
if (avCodecMajorVersion > 59 || (avCodecMajorVersion == 59 && avCodecMinorVersion > 24))
|
if (avCodecMajorVersion > 59 || (avCodecMajorVersion == 59 && avCodecMinorVersion > 24))
|
||||||
{
|
{
|
||||||
_decodeFrame = Marshal.GetDelegateForFunctionPointer<FFCodec.AVCodec_decode>(((FFCodec*)_codec)->CodecCallback);
|
_decodeFrame = Marshal.GetDelegateForFunctionPointer<AVCodec_decode>(((FFCodec<AVCodec>*)_codec)->CodecCallback);
|
||||||
}
|
}
|
||||||
// libavcodec 59.x changed AvCodec private API layout.
|
// libavcodec 59.x changed AvCodec private API layout.
|
||||||
else if (avCodecMajorVersion == 59)
|
else if (avCodecMajorVersion == 59)
|
||||||
{
|
{
|
||||||
_decodeFrame = Marshal.GetDelegateForFunctionPointer<FFCodec.AVCodec_decode>(((FFCodecLegacy<AVCodec>*)_codec)->Decode);
|
_decodeFrame = Marshal.GetDelegateForFunctionPointer<AVCodec_decode>(((FFCodecLegacy<AVCodec501>*)_codec)->Decode);
|
||||||
}
|
}
|
||||||
// libavcodec 58.x and lower
|
// libavcodec 58.x and lower
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_decodeFrame = Marshal.GetDelegateForFunctionPointer<FFCodec.AVCodec_decode>(((FFCodecLegacy<AVCodecLegacy>*)_codec)->Decode);
|
_decodeFrame = Marshal.GetDelegateForFunctionPointer<AVCodec_decode>(((FFCodecLegacy<AVCodec>*)_codec)->Decode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -20,6 +20,7 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
|||||||
public unsafe IntPtr PrivClass;
|
public unsafe IntPtr PrivClass;
|
||||||
public IntPtr Profiles;
|
public IntPtr Profiles;
|
||||||
public unsafe byte* WrapperName;
|
public unsafe byte* WrapperName;
|
||||||
|
public IntPtr ChLayouts;
|
||||||
#pragma warning restore CS0649
|
#pragma warning restore CS0649
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
||||||
{
|
{
|
||||||
struct AVCodecLegacy
|
struct AVCodec501
|
||||||
{
|
{
|
||||||
#pragma warning disable CS0649
|
#pragma warning disable CS0649
|
||||||
public unsafe byte* Name;
|
public unsafe byte* Name;
|
||||||
@@ -20,7 +20,6 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
|||||||
public unsafe IntPtr PrivClass;
|
public unsafe IntPtr PrivClass;
|
||||||
public IntPtr Profiles;
|
public IntPtr Profiles;
|
||||||
public unsafe byte* WrapperName;
|
public unsafe byte* WrapperName;
|
||||||
public IntPtr ChLayouts;
|
|
||||||
#pragma warning restore CS0649
|
#pragma warning restore CS0649
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -9,7 +9,7 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
|||||||
public unsafe IntPtr AvClass;
|
public unsafe IntPtr AvClass;
|
||||||
public int LogLevelOffset;
|
public int LogLevelOffset;
|
||||||
public int CodecType;
|
public int CodecType;
|
||||||
public unsafe AVCodecLegacy* Codec;
|
public unsafe AVCodec* Codec;
|
||||||
public AVCodecID CodecId;
|
public AVCodecID CodecId;
|
||||||
public uint CodecTag;
|
public uint CodecTag;
|
||||||
public IntPtr PrivData;
|
public IntPtr PrivData;
|
||||||
|
@@ -2,12 +2,10 @@
|
|||||||
|
|
||||||
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
namespace Ryujinx.Graphics.Nvdec.FFmpeg.Native
|
||||||
{
|
{
|
||||||
struct FFCodec
|
struct FFCodec<T> where T: struct
|
||||||
{
|
{
|
||||||
public unsafe delegate int AVCodec_decode(AVCodecContext* avctx, void* outdata, int* got_frame_ptr, AVPacket* avpkt);
|
|
||||||
|
|
||||||
#pragma warning disable CS0649
|
#pragma warning disable CS0649
|
||||||
public AVCodec Base;
|
public T Base;
|
||||||
public int CapsInternalOrCbType;
|
public int CapsInternalOrCbType;
|
||||||
public int PrivDataSize;
|
public int PrivDataSize;
|
||||||
public IntPtr UpdateThreadContext;
|
public IntPtr UpdateThreadContext;
|
||||||
|
@@ -139,7 +139,7 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||||||
|
|
||||||
if (!destinationView.Target.IsMultisample() && Target.IsMultisample())
|
if (!destinationView.Target.IsMultisample() && Target.IsMultisample())
|
||||||
{
|
{
|
||||||
_renderer.TextureCopyMS.CopyMSToNonMS(this, destinationView, srcLayer, dstLayer,1);
|
_renderer.TextureCopyMS.CopyMSToNonMS(this, destinationView, srcLayer, dstLayer, 1);
|
||||||
}
|
}
|
||||||
else if (destinationView.Target.IsMultisample() && !Target.IsMultisample())
|
else if (destinationView.Target.IsMultisample() && !Target.IsMultisample())
|
||||||
{
|
{
|
||||||
|
@@ -18,6 +18,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
private readonly IProgram _programColorBlitClearAlpha;
|
private readonly IProgram _programColorBlitClearAlpha;
|
||||||
private readonly IProgram _programColorClear;
|
private readonly IProgram _programColorClear;
|
||||||
private readonly IProgram _programStrideChange;
|
private readonly IProgram _programStrideChange;
|
||||||
|
private readonly IProgram _programColorCopyBetweenMsNonMs;
|
||||||
|
|
||||||
public HelperShader(VulkanRenderer gd, Device device)
|
public HelperShader(VulkanRenderer gd, Device device)
|
||||||
{
|
{
|
||||||
@@ -73,6 +74,20 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
{
|
{
|
||||||
new ShaderSource(ShaderBinaries.ChangeBufferStrideShaderSource, strideChangeBindings, ShaderStage.Compute, TargetLanguage.Spirv),
|
new ShaderSource(ShaderBinaries.ChangeBufferStrideShaderSource, strideChangeBindings, ShaderStage.Compute, TargetLanguage.Spirv),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var colorCopyMSBindings = new ShaderBindings(
|
||||||
|
new[] { 0 },
|
||||||
|
Array.Empty<int>(),
|
||||||
|
new[] { 0 },
|
||||||
|
new[] { 0 });
|
||||||
|
|
||||||
|
_programColorCopyBetweenMsNonMs = gd.CreateProgramWithMinimalLayout(new[]
|
||||||
|
{
|
||||||
|
new ShaderSource(ShaderBinaries.ColorCopyBetweenMsNonMs, colorCopyMSBindings, ShaderStage.Compute, TargetLanguage.Spirv),
|
||||||
|
}, new[]
|
||||||
|
{
|
||||||
|
new SpecDescription((0, SpecConstType.Int32))
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Blit(
|
public void Blit(
|
||||||
@@ -136,11 +151,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
gd.BufferManager.SetData<float>(bufferHandle, 0, region);
|
gd.BufferManager.SetData<float>(bufferHandle, 0, region);
|
||||||
|
|
||||||
Span<BufferRange> bufferRanges = stackalloc BufferRange[1];
|
_pipeline.SetUniformBuffers(1, stackalloc[] { new BufferRange(bufferHandle, 0, RegionBufferSize) });
|
||||||
|
|
||||||
bufferRanges[0] = new BufferRange(bufferHandle, 0, RegionBufferSize);
|
|
||||||
|
|
||||||
_pipeline.SetUniformBuffers(1, bufferRanges);
|
|
||||||
|
|
||||||
Span<GAL.Viewport> viewports = stackalloc GAL.Viewport[1];
|
Span<GAL.Viewport> viewports = stackalloc GAL.Viewport[1];
|
||||||
|
|
||||||
@@ -203,11 +214,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
gd.BufferManager.SetData<float>(bufferHandle, 0, clearColor);
|
gd.BufferManager.SetData<float>(bufferHandle, 0, clearColor);
|
||||||
|
|
||||||
Span<BufferRange> bufferRanges = stackalloc BufferRange[1];
|
_pipeline.SetUniformBuffers(1, stackalloc[] { new BufferRange(bufferHandle, 0, ClearColorBufferSize) });
|
||||||
|
|
||||||
bufferRanges[0] = new BufferRange(bufferHandle, 0, ClearColorBufferSize);
|
|
||||||
|
|
||||||
_pipeline.SetUniformBuffers(1, bufferRanges);
|
|
||||||
|
|
||||||
Span<GAL.Viewport> viewports = stackalloc GAL.Viewport[1];
|
Span<GAL.Viewport> viewports = stackalloc GAL.Viewport[1];
|
||||||
|
|
||||||
@@ -269,11 +276,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
gd.BufferManager.SetData<float>(bufferHandle, 0, region);
|
gd.BufferManager.SetData<float>(bufferHandle, 0, region);
|
||||||
|
|
||||||
Span<BufferRange> bufferRanges = stackalloc BufferRange[1];
|
pipeline.SetUniformBuffers(1, stackalloc[] { new BufferRange(bufferHandle, 0, RegionBufferSize) });
|
||||||
|
|
||||||
bufferRanges[0] = new BufferRange(bufferHandle, 0, RegionBufferSize);
|
|
||||||
|
|
||||||
pipeline.SetUniformBuffers(1, bufferRanges);
|
|
||||||
|
|
||||||
Span<GAL.Viewport> viewports = stackalloc GAL.Viewport[1];
|
Span<GAL.Viewport> viewports = stackalloc GAL.Viewport[1];
|
||||||
|
|
||||||
@@ -351,11 +354,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
_pipeline.SetCommandBuffer(cbs);
|
_pipeline.SetCommandBuffer(cbs);
|
||||||
|
|
||||||
Span<BufferRange> cbRanges = stackalloc BufferRange[1];
|
_pipeline.SetUniformBuffers(0, stackalloc[] { new BufferRange(bufferHandle, 0, ParamsBufferSize) });
|
||||||
|
|
||||||
cbRanges[0] = new BufferRange(bufferHandle, 0, ParamsBufferSize);
|
|
||||||
|
|
||||||
_pipeline.SetUniformBuffers(0, cbRanges);
|
|
||||||
|
|
||||||
Span<Auto<DisposableBuffer>> sbRanges = new Auto<DisposableBuffer>[2];
|
Span<Auto<DisposableBuffer>> sbRanges = new Auto<DisposableBuffer>[2];
|
||||||
|
|
||||||
@@ -480,12 +479,207 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
convertedCount * outputIndexSize);
|
convertedCount * outputIndexSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void CopyMSToNonMS(VulkanRenderer gd, CommandBufferScoped cbs, TextureView src, TextureView dst, int srcLayer, int dstLayer, int depth)
|
||||||
|
{
|
||||||
|
CopyMS(gd, cbs, src, dst, srcLayer, dstLayer, depth, src.Info.Samples, dst.Info.Width, dst.Info.Height);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CopyNonMSToMS(VulkanRenderer gd, CommandBufferScoped cbs, TextureView src, TextureView dst, int srcLayer, int dstLayer, int depth)
|
||||||
|
{
|
||||||
|
CopyMS(gd, cbs, src, dst, srcLayer, dstLayer, depth, dst.Info.Samples, src.Info.Width, src.Info.Height);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CopyMS(
|
||||||
|
VulkanRenderer gd,
|
||||||
|
CommandBufferScoped cbs,
|
||||||
|
TextureView src,
|
||||||
|
TextureView dst,
|
||||||
|
int srcLayer,
|
||||||
|
int dstLayer,
|
||||||
|
int depth,
|
||||||
|
int samples,
|
||||||
|
int nonMSWidth,
|
||||||
|
int nonMSHeight)
|
||||||
|
{
|
||||||
|
const int ParamsBufferSize = 16;
|
||||||
|
|
||||||
|
Span<int> shaderParams = stackalloc int[ParamsBufferSize / sizeof(int)];
|
||||||
|
|
||||||
|
// X and Y are the expected texture samples.
|
||||||
|
// Z and W are the actual texture samples used.
|
||||||
|
// They may differ if the GPU does not support the samples count requested and we had to use a lower amount.
|
||||||
|
(shaderParams[0], shaderParams[1]) = GetSampleCountXYLog2(samples);
|
||||||
|
(shaderParams[2], shaderParams[3]) = GetSampleCountXYLog2((int)TextureStorage.ConvertToSampleCountFlags((uint)samples));
|
||||||
|
|
||||||
|
var bufferHandle = gd.BufferManager.CreateWithHandle(gd, ParamsBufferSize, false);
|
||||||
|
|
||||||
|
gd.BufferManager.SetData<int>(bufferHandle, 0, shaderParams);
|
||||||
|
|
||||||
|
TextureView.InsertImageBarrier(
|
||||||
|
gd.Api,
|
||||||
|
cbs.CommandBuffer,
|
||||||
|
src.GetImage().Get(cbs).Value,
|
||||||
|
TextureStorage.DefaultAccessMask,
|
||||||
|
AccessFlags.AccessShaderReadBit,
|
||||||
|
PipelineStageFlags.PipelineStageAllCommandsBit,
|
||||||
|
PipelineStageFlags.PipelineStageComputeShaderBit,
|
||||||
|
ImageAspectFlags.ImageAspectColorBit,
|
||||||
|
src.FirstLayer + srcLayer,
|
||||||
|
src.FirstLevel,
|
||||||
|
depth,
|
||||||
|
1);
|
||||||
|
|
||||||
|
_pipeline.SetCommandBuffer(cbs);
|
||||||
|
|
||||||
|
_pipeline.SetProgram(_programColorCopyBetweenMsNonMs);
|
||||||
|
|
||||||
|
var format = GetFormat(src.Info.BytesPerPixel);
|
||||||
|
|
||||||
|
int dispatchX = (nonMSWidth + 31) / 32;
|
||||||
|
int dispatchY = (nonMSHeight + 31) / 32;
|
||||||
|
|
||||||
|
// Specialize shader.
|
||||||
|
bool srcIsMs = src.Info.Target.IsMultisample();
|
||||||
|
int conversionType = srcIsMs ? src.Info.BytesPerPixel : -src.Info.BytesPerPixel;
|
||||||
|
_pipeline.Specialize(conversionType);
|
||||||
|
|
||||||
|
_pipeline.SetUniformBuffers(0, stackalloc[] { new BufferRange(bufferHandle, 0, ParamsBufferSize) });
|
||||||
|
|
||||||
|
if (src.Info.Target == Target.Texture2DMultisampleArray ||
|
||||||
|
dst.Info.Target == Target.Texture2DMultisampleArray)
|
||||||
|
{
|
||||||
|
for (int z = 0; z < depth; z++)
|
||||||
|
{
|
||||||
|
var srcView = Create2DLayerView(src, srcLayer + z, format);
|
||||||
|
var dstView = Create2DLayerView(dst, dstLayer + z);
|
||||||
|
|
||||||
|
_pipeline.SetTextureAndSampler(ShaderStage.Compute, 0, srcView, null);
|
||||||
|
_pipeline.SetImage(0, dstView, format);
|
||||||
|
|
||||||
|
_pipeline.DispatchCompute(dispatchX, dispatchY, 1);
|
||||||
|
|
||||||
|
srcView.Release();
|
||||||
|
dstView.Release();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var srcView = Create2DLayerView(src, srcLayer, format);
|
||||||
|
|
||||||
|
_pipeline.SetTextureAndSampler(ShaderStage.Compute, 0, srcView, null);
|
||||||
|
_pipeline.SetImage(0, dst, format);
|
||||||
|
|
||||||
|
_pipeline.DispatchCompute(dispatchX, dispatchY, 1);
|
||||||
|
|
||||||
|
srcView.Release();
|
||||||
|
}
|
||||||
|
|
||||||
|
gd.BufferManager.Delete(bufferHandle);
|
||||||
|
|
||||||
|
_pipeline.Finish(gd, cbs);
|
||||||
|
|
||||||
|
TextureView.InsertImageBarrier(
|
||||||
|
gd.Api,
|
||||||
|
cbs.CommandBuffer,
|
||||||
|
dst.GetImage().Get(cbs).Value,
|
||||||
|
AccessFlags.AccessShaderWriteBit,
|
||||||
|
TextureStorage.DefaultAccessMask,
|
||||||
|
PipelineStageFlags.PipelineStageComputeShaderBit,
|
||||||
|
PipelineStageFlags.PipelineStageAllCommandsBit,
|
||||||
|
ImageAspectFlags.ImageAspectColorBit,
|
||||||
|
dst.FirstLayer + dstLayer,
|
||||||
|
dst.FirstLevel,
|
||||||
|
depth,
|
||||||
|
1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static (int, int) GetSampleCountXYLog2(int samples)
|
||||||
|
{
|
||||||
|
int samplesInXLog2 = 0;
|
||||||
|
int samplesInYLog2 = 0;
|
||||||
|
|
||||||
|
switch (samples)
|
||||||
|
{
|
||||||
|
case 2: // 2x1
|
||||||
|
samplesInXLog2 = 1;
|
||||||
|
break;
|
||||||
|
case 4: // 2x2
|
||||||
|
samplesInXLog2 = 1;
|
||||||
|
samplesInYLog2 = 1;
|
||||||
|
break;
|
||||||
|
case 8: // 4x2
|
||||||
|
samplesInXLog2 = 2;
|
||||||
|
samplesInYLog2 = 1;
|
||||||
|
break;
|
||||||
|
case 16: // 4x4
|
||||||
|
samplesInXLog2 = 2;
|
||||||
|
samplesInYLog2 = 2;
|
||||||
|
break;
|
||||||
|
case 32: // 8x4
|
||||||
|
samplesInXLog2 = 3;
|
||||||
|
samplesInYLog2 = 2;
|
||||||
|
break;
|
||||||
|
case 64: // 8x8
|
||||||
|
samplesInXLog2 = 3;
|
||||||
|
samplesInYLog2 = 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (samplesInXLog2, samplesInYLog2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ITexture Create2DLayerView(TextureView from, int layer, GAL.Format? format = null)
|
||||||
|
{
|
||||||
|
var target = from.Info.Target switch
|
||||||
|
{
|
||||||
|
Target.Texture1DArray => Target.Texture1D,
|
||||||
|
Target.Texture2DArray => Target.Texture2D,
|
||||||
|
Target.Texture2DMultisampleArray => Target.Texture2DMultisample,
|
||||||
|
_ => from.Info.Target
|
||||||
|
};
|
||||||
|
|
||||||
|
var info = new TextureCreateInfo(
|
||||||
|
from.Info.Width,
|
||||||
|
from.Info.Height,
|
||||||
|
from.Info.Depth,
|
||||||
|
1,
|
||||||
|
from.Info.Samples,
|
||||||
|
from.Info.BlockWidth,
|
||||||
|
from.Info.BlockHeight,
|
||||||
|
from.Info.BytesPerPixel,
|
||||||
|
format ?? from.Info.Format,
|
||||||
|
from.Info.DepthStencilMode,
|
||||||
|
target,
|
||||||
|
from.Info.SwizzleR,
|
||||||
|
from.Info.SwizzleG,
|
||||||
|
from.Info.SwizzleB,
|
||||||
|
from.Info.SwizzleA);
|
||||||
|
|
||||||
|
return from.CreateView(info, layer, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static GAL.Format GetFormat(int bytesPerPixel)
|
||||||
|
{
|
||||||
|
return bytesPerPixel switch
|
||||||
|
{
|
||||||
|
1 => GAL.Format.R8Uint,
|
||||||
|
2 => GAL.Format.R16Uint,
|
||||||
|
4 => GAL.Format.R32Uint,
|
||||||
|
8 => GAL.Format.R32G32Uint,
|
||||||
|
16 => GAL.Format.R32G32B32A32Uint,
|
||||||
|
_ => throw new ArgumentException($"Invalid bytes per pixel {bytesPerPixel}.")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
protected virtual void Dispose(bool disposing)
|
protected virtual void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (disposing)
|
if (disposing)
|
||||||
{
|
{
|
||||||
_programColorBlitClearAlpha.Dispose();
|
_programColorBlitClearAlpha.Dispose();
|
||||||
_programColorBlit.Dispose();
|
_programColorBlit.Dispose();
|
||||||
|
_programColorClear.Dispose();
|
||||||
|
_programStrideChange.Dispose();
|
||||||
|
_programColorCopyBetweenMsNonMs.Dispose();
|
||||||
_samplerNearest.Dispose();
|
_samplerNearest.Dispose();
|
||||||
_samplerLinear.Dispose();
|
_samplerLinear.Dispose();
|
||||||
_pipeline.Dispose();
|
_pipeline.Dispose();
|
||||||
|
@@ -3,6 +3,8 @@ using Ryujinx.Graphics.Shader;
|
|||||||
using Silk.NET.Vulkan;
|
using Silk.NET.Vulkan;
|
||||||
using System;
|
using System;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Ryujinx.Graphics.Vulkan
|
namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
@@ -697,6 +699,18 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
SignalStateChange();
|
SignalStateChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Specialize<T>(in T data) where T : unmanaged
|
||||||
|
{
|
||||||
|
var dataSpan = MemoryMarshal.AsBytes(MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef(in data), 1));
|
||||||
|
|
||||||
|
if (!dataSpan.SequenceEqual(_newState.SpecializationData.Span))
|
||||||
|
{
|
||||||
|
_newState.SpecializationData = new SpecData(dataSpan);
|
||||||
|
|
||||||
|
SignalStateChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected virtual void SignalAttachmentChange()
|
protected virtual void SignalAttachmentChange()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -1188,14 +1202,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var subpassDependency = new SubpassDependency(
|
var subpassDependency = PipelineConverter.CreateSubpassDependency();
|
||||||
0,
|
|
||||||
0,
|
|
||||||
PipelineStageFlags.PipelineStageAllGraphicsBit,
|
|
||||||
PipelineStageFlags.PipelineStageAllGraphicsBit,
|
|
||||||
AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit | AccessFlags.AccessColorAttachmentWriteBit,
|
|
||||||
AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit | AccessFlags.AccessShaderReadBit,
|
|
||||||
0);
|
|
||||||
|
|
||||||
fixed (AttachmentDescription* pAttachmentDescs = attachmentDescs)
|
fixed (AttachmentDescription* pAttachmentDescs = attachmentDescs)
|
||||||
{
|
{
|
||||||
|
@@ -6,6 +6,9 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
{
|
{
|
||||||
static class PipelineConverter
|
static class PipelineConverter
|
||||||
{
|
{
|
||||||
|
private const AccessFlags SubpassSrcAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit | AccessFlags.AccessColorAttachmentWriteBit;
|
||||||
|
private const AccessFlags SubpassDstAccessMask = AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit | AccessFlags.AccessShaderReadBit;
|
||||||
|
|
||||||
public static unsafe DisposableRenderPass ToRenderPass(this ProgramPipelineState state, VulkanRenderer gd, Device device)
|
public static unsafe DisposableRenderPass ToRenderPass(this ProgramPipelineState state, VulkanRenderer gd, Device device)
|
||||||
{
|
{
|
||||||
const int MaxAttachments = Constants.MaxRenderTargets + 1;
|
const int MaxAttachments = Constants.MaxRenderTargets + 1;
|
||||||
@@ -100,14 +103,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var subpassDependency = new SubpassDependency(
|
var subpassDependency = CreateSubpassDependency();
|
||||||
0,
|
|
||||||
0,
|
|
||||||
PipelineStageFlags.PipelineStageAllGraphicsBit,
|
|
||||||
PipelineStageFlags.PipelineStageAllGraphicsBit,
|
|
||||||
AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit,
|
|
||||||
AccessFlags.AccessMemoryReadBit | AccessFlags.AccessMemoryWriteBit,
|
|
||||||
0);
|
|
||||||
|
|
||||||
fixed (AttachmentDescription* pAttachmentDescs = attachmentDescs)
|
fixed (AttachmentDescription* pAttachmentDescs = attachmentDescs)
|
||||||
{
|
{
|
||||||
@@ -128,6 +124,32 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static SubpassDependency CreateSubpassDependency()
|
||||||
|
{
|
||||||
|
return new SubpassDependency(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
PipelineStageFlags.PipelineStageAllGraphicsBit,
|
||||||
|
PipelineStageFlags.PipelineStageAllGraphicsBit,
|
||||||
|
SubpassSrcAccessMask,
|
||||||
|
SubpassDstAccessMask,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public unsafe static SubpassDependency2 CreateSubpassDependency2()
|
||||||
|
{
|
||||||
|
return new SubpassDependency2(
|
||||||
|
StructureType.SubpassDependency2,
|
||||||
|
null,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
PipelineStageFlags.PipelineStageAllGraphicsBit,
|
||||||
|
PipelineStageFlags.PipelineStageAllGraphicsBit,
|
||||||
|
SubpassSrcAccessMask,
|
||||||
|
SubpassDstAccessMask,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
|
||||||
public static PipelineState ToVulkanPipelineState(this ProgramPipelineState state, VulkanRenderer gd)
|
public static PipelineState ToVulkanPipelineState(this ProgramPipelineState state, VulkanRenderer gd)
|
||||||
{
|
{
|
||||||
PipelineState pipeline = new PipelineState();
|
PipelineState pipeline = new PipelineState();
|
||||||
|
@@ -312,6 +312,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
public NativeArray<PipelineShaderStageCreateInfo> Stages;
|
public NativeArray<PipelineShaderStageCreateInfo> Stages;
|
||||||
public NativeArray<PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT> StageRequiredSubgroupSizes;
|
public NativeArray<PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT> StageRequiredSubgroupSizes;
|
||||||
public PipelineLayout PipelineLayout;
|
public PipelineLayout PipelineLayout;
|
||||||
|
public SpecData SpecializationData;
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
@@ -334,7 +335,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
ShaderCollection program,
|
ShaderCollection program,
|
||||||
PipelineCache cache)
|
PipelineCache cache)
|
||||||
{
|
{
|
||||||
if (program.TryGetComputePipeline(out var pipeline))
|
if (program.TryGetComputePipeline(ref SpecializationData, out var pipeline))
|
||||||
{
|
{
|
||||||
return pipeline;
|
return pipeline;
|
||||||
}
|
}
|
||||||
@@ -354,20 +355,36 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
Pipeline pipelineHandle = default;
|
Pipeline pipelineHandle = default;
|
||||||
|
|
||||||
gd.Api.CreateComputePipelines(device, cache, 1, &pipelineCreateInfo, null, &pipelineHandle).ThrowOnError();
|
bool hasSpec = program.SpecDescriptions != null;
|
||||||
|
|
||||||
|
var desc = hasSpec ? program.SpecDescriptions[0] : SpecDescription.Empty;
|
||||||
|
|
||||||
|
if (hasSpec && SpecializationData.Length < (int)desc.Info.DataSize)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Specialization data size does not match description");
|
||||||
|
}
|
||||||
|
|
||||||
|
fixed (SpecializationInfo* info = &desc.Info)
|
||||||
|
fixed (SpecializationMapEntry* map = desc.Map)
|
||||||
|
fixed (byte* data = SpecializationData.Span)
|
||||||
|
{
|
||||||
|
if (hasSpec)
|
||||||
|
{
|
||||||
|
info->PMapEntries = map;
|
||||||
|
info->PData = data;
|
||||||
|
pipelineCreateInfo.Stage.PSpecializationInfo = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
gd.Api.CreateComputePipelines(device, cache, 1, &pipelineCreateInfo, null, &pipelineHandle).ThrowOnError();
|
||||||
|
}
|
||||||
|
|
||||||
pipeline = new Auto<DisposablePipeline>(new DisposablePipeline(gd.Api, device, pipelineHandle));
|
pipeline = new Auto<DisposablePipeline>(new DisposablePipeline(gd.Api, device, pipelineHandle));
|
||||||
|
|
||||||
program.AddComputePipeline(pipeline);
|
program.AddComputePipeline(ref SpecializationData, pipeline);
|
||||||
|
|
||||||
return pipeline;
|
return pipeline;
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe void DestroyComputePipeline(ShaderCollection program)
|
|
||||||
{
|
|
||||||
program.RemoveComputePipeline();
|
|
||||||
}
|
|
||||||
|
|
||||||
public unsafe Auto<DisposablePipeline> CreateGraphicsPipeline(
|
public unsafe Auto<DisposablePipeline> CreateGraphicsPipeline(
|
||||||
VulkanRenderer gd,
|
VulkanRenderer gd,
|
||||||
Device device,
|
Device device,
|
||||||
|
@@ -26,6 +26,8 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
public ProgramLinkStatus LinkStatus { get; private set; }
|
public ProgramLinkStatus LinkStatus { get; private set; }
|
||||||
|
|
||||||
|
public readonly SpecDescription[] SpecDescriptions;
|
||||||
|
|
||||||
public bool IsLinked
|
public bool IsLinked
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -40,7 +42,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
}
|
}
|
||||||
|
|
||||||
private HashTableSlim<PipelineUid, Auto<DisposablePipeline>> _graphicsPipelineCache;
|
private HashTableSlim<PipelineUid, Auto<DisposablePipeline>> _graphicsPipelineCache;
|
||||||
private Auto<DisposablePipeline> _computePipeline;
|
private HashTableSlim<SpecData, Auto<DisposablePipeline>> _computePipelineCache;
|
||||||
|
|
||||||
private VulkanRenderer _gd;
|
private VulkanRenderer _gd;
|
||||||
private Device _device;
|
private Device _device;
|
||||||
@@ -52,17 +54,24 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
private Task _compileTask;
|
private Task _compileTask;
|
||||||
private bool _firstBackgroundUse;
|
private bool _firstBackgroundUse;
|
||||||
|
|
||||||
public ShaderCollection(VulkanRenderer gd, Device device, ShaderSource[] shaders, bool isMinimal = false)
|
public ShaderCollection(VulkanRenderer gd, Device device, ShaderSource[] shaders, SpecDescription[] specDescription = null, bool isMinimal = false)
|
||||||
{
|
{
|
||||||
_gd = gd;
|
_gd = gd;
|
||||||
_device = device;
|
_device = device;
|
||||||
|
|
||||||
|
if (specDescription != null && specDescription.Length != shaders.Length)
|
||||||
|
{
|
||||||
|
throw new ArgumentException($"{nameof(specDescription)} array length must match {nameof(shaders)} array if provided");
|
||||||
|
}
|
||||||
|
|
||||||
gd.Shaders.Add(this);
|
gd.Shaders.Add(this);
|
||||||
|
|
||||||
var internalShaders = new Shader[shaders.Length];
|
var internalShaders = new Shader[shaders.Length];
|
||||||
|
|
||||||
_infos = new PipelineShaderStageCreateInfo[shaders.Length];
|
_infos = new PipelineShaderStageCreateInfo[shaders.Length];
|
||||||
|
|
||||||
|
SpecDescriptions = specDescription;
|
||||||
|
|
||||||
LinkStatus = ProgramLinkStatus.Incomplete;
|
LinkStatus = ProgramLinkStatus.Incomplete;
|
||||||
|
|
||||||
uint stages = 0;
|
uint stages = 0;
|
||||||
@@ -314,14 +323,9 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddComputePipeline(Auto<DisposablePipeline> pipeline)
|
public void AddComputePipeline(ref SpecData key, Auto<DisposablePipeline> pipeline)
|
||||||
{
|
{
|
||||||
_computePipeline = pipeline;
|
(_computePipelineCache ??= new()).Add(ref key, pipeline);
|
||||||
}
|
|
||||||
|
|
||||||
public void RemoveComputePipeline()
|
|
||||||
{
|
|
||||||
_computePipeline = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddGraphicsPipeline(ref PipelineUid key, Auto<DisposablePipeline> pipeline)
|
public void AddGraphicsPipeline(ref PipelineUid key, Auto<DisposablePipeline> pipeline)
|
||||||
@@ -329,10 +333,20 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
(_graphicsPipelineCache ??= new()).Add(ref key, pipeline);
|
(_graphicsPipelineCache ??= new()).Add(ref key, pipeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetComputePipeline(out Auto<DisposablePipeline> pipeline)
|
public bool TryGetComputePipeline(ref SpecData key, out Auto<DisposablePipeline> pipeline)
|
||||||
{
|
{
|
||||||
pipeline = _computePipeline;
|
if (_computePipelineCache == null)
|
||||||
return pipeline != null;
|
{
|
||||||
|
pipeline = default;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_computePipelineCache.TryGetValue(ref key, out pipeline))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetGraphicsPipeline(ref PipelineUid key, out Auto<DisposablePipeline> pipeline)
|
public bool TryGetGraphicsPipeline(ref PipelineUid key, out Auto<DisposablePipeline> pipeline)
|
||||||
@@ -390,7 +404,14 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_computePipeline?.Dispose();
|
if (_computePipelineCache != null)
|
||||||
|
{
|
||||||
|
foreach (Auto<DisposablePipeline> pipeline in _computePipelineCache.Values)
|
||||||
|
{
|
||||||
|
pipeline.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (_dummyRenderPass.Value.Handle != 0)
|
if (_dummyRenderPass.Value.Handle != 0)
|
||||||
{
|
{
|
||||||
_dummyRenderPass.Dispose();
|
_dummyRenderPass.Dispose();
|
||||||
|
89
Ryujinx.Graphics.Vulkan/Shaders/ColorCopyBetweenMsNonMs.comp
Normal file
89
Ryujinx.Graphics.Vulkan/Shaders/ColorCopyBetweenMsNonMs.comp
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
#version 450 core
|
||||||
|
|
||||||
|
// +ve for MsToNonMs, -ve for reverse
|
||||||
|
layout (constant_id = 0) const int convType = 0;
|
||||||
|
|
||||||
|
layout (std140, binding = 0) uniform sample_counts_log2_in
|
||||||
|
{
|
||||||
|
ivec4 sample_counts_log2;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define R8_ID 1
|
||||||
|
#define R16_ID 2
|
||||||
|
#define R32_ID 4
|
||||||
|
#define RG32_ID 8
|
||||||
|
#define RGBA32_ID 16
|
||||||
|
|
||||||
|
#define R8_TYPE r8ui
|
||||||
|
#define R16_TYPE r16ui
|
||||||
|
#define R32_TYPE r32ui
|
||||||
|
#define RG32_TYPE rg32ui
|
||||||
|
#define RGBA32_TYPE rgba32ui
|
||||||
|
|
||||||
|
#define DECLARE_BINDINGS(type) layout (set = 3, binding = 0, type##_TYPE) uniform uimage2DMS dstMS ## type; \
|
||||||
|
layout (set = 3, binding = 0, type##_TYPE) uniform uimage2D dst ## type;
|
||||||
|
|
||||||
|
#define CASE_SIZE(type) case type##_ID: imageSz = imageSize(dst ## type); break;
|
||||||
|
|
||||||
|
#define CASE_CONVERT(type) case type##_ID: imageStore(dst ## type, ivec2(coords), texelFetch(srcMS, shiftedCoords, sampleIdx)); break; \
|
||||||
|
case -type##_ID: imageStore(dstMS ## type, shiftedCoords, sampleIdx, texelFetch(src, ivec2(coords), 0)); break;
|
||||||
|
|
||||||
|
// src tex
|
||||||
|
layout (set = 2, binding = 0) uniform usampler2DMS srcMS;
|
||||||
|
layout (set = 2, binding = 0) uniform usampler2D src;
|
||||||
|
|
||||||
|
// dst img
|
||||||
|
DECLARE_BINDINGS(R8)
|
||||||
|
DECLARE_BINDINGS(R16)
|
||||||
|
DECLARE_BINDINGS(R32)
|
||||||
|
DECLARE_BINDINGS(RG32)
|
||||||
|
DECLARE_BINDINGS(RGBA32)
|
||||||
|
|
||||||
|
layout (local_size_x = 32, local_size_y = 32, local_size_z = 1) in;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
uvec2 coords = gl_GlobalInvocationID.xy;
|
||||||
|
|
||||||
|
ivec2 imageSz = ivec2(0, 0);
|
||||||
|
|
||||||
|
switch (convType)
|
||||||
|
{
|
||||||
|
case 0: break;
|
||||||
|
CASE_SIZE(R8 )
|
||||||
|
CASE_SIZE(R16 )
|
||||||
|
CASE_SIZE(R32 )
|
||||||
|
CASE_SIZE(RG32 )
|
||||||
|
CASE_SIZE(RGBA32)
|
||||||
|
default:
|
||||||
|
imageSz = textureSize(src, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (int(coords.x) >= imageSz.x || int(coords.y) >= imageSz.y)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int deltaX = sample_counts_log2.x - sample_counts_log2.z;
|
||||||
|
int deltaY = sample_counts_log2.y - sample_counts_log2.w;
|
||||||
|
int samplesInXLog2 = sample_counts_log2.z;
|
||||||
|
int samplesInYLog2 = sample_counts_log2.w;
|
||||||
|
int samplesInX = 1 << samplesInXLog2;
|
||||||
|
int samplesInY = 1 << samplesInYLog2;
|
||||||
|
int sampleIdx = ((int(coords.x) >> deltaX) & (samplesInX - 1)) | (((int(coords.y) >> deltaY) & (samplesInY - 1)) << samplesInXLog2);
|
||||||
|
|
||||||
|
samplesInXLog2 = sample_counts_log2.x;
|
||||||
|
samplesInYLog2 = sample_counts_log2.y;
|
||||||
|
|
||||||
|
ivec2 shiftedCoords = ivec2(int(coords.x) >> samplesInXLog2, int(coords.y) >> samplesInYLog2);
|
||||||
|
|
||||||
|
switch (convType)
|
||||||
|
{
|
||||||
|
CASE_CONVERT(R8 )
|
||||||
|
CASE_CONVERT(R16 )
|
||||||
|
CASE_CONVERT(R32 )
|
||||||
|
CASE_CONVERT(RG32 )
|
||||||
|
CASE_CONVERT(RGBA32)
|
||||||
|
}
|
||||||
|
}
|
@@ -551,5 +551,324 @@ namespace Ryujinx.Graphics.Vulkan.Shaders
|
|||||||
0x21, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00,
|
0x21, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00,
|
||||||
0x35, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00,
|
0x35, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static readonly byte[] ColorCopyBetweenMsNonMs = new byte[]
|
||||||
|
{
|
||||||
|
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0A, 0x00, 0x08, 0x00, 0x2D, 0x01, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
|
||||||
|
0x1B, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x31, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
|
||||||
|
0x32, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4C, 0x53, 0x4C,
|
||||||
|
0x2E, 0x73, 0x74, 0x64, 0x2E, 0x34, 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x06, 0x00, 0x05, 0x00, 0x00, 0x00,
|
||||||
|
0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00,
|
||||||
|
0x10, 0x00, 0x06, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||||
|
0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||||
|
0xC2, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x69, 0x6E,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x67, 0x6C, 0x5F, 0x47,
|
||||||
|
0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x49, 0x6E, 0x76, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x49,
|
||||||
|
0x44, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00, 0x63, 0x6F, 0x6E, 0x76,
|
||||||
|
0x54, 0x79, 0x70, 0x65, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x64, 0x73, 0x74, 0x52, 0x38, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00,
|
||||||
|
0x64, 0x73, 0x74, 0x52, 0x31, 0x36, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x2D, 0x00, 0x00, 0x00,
|
||||||
|
0x64, 0x73, 0x74, 0x52, 0x33, 0x32, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00,
|
||||||
|
0x64, 0x73, 0x74, 0x52, 0x47, 0x33, 0x32, 0x00, 0x05, 0x00, 0x05, 0x00, 0x39, 0x00, 0x00, 0x00,
|
||||||
|
0x64, 0x73, 0x74, 0x52, 0x47, 0x42, 0x41, 0x33, 0x32, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00,
|
||||||
|
0x40, 0x00, 0x00, 0x00, 0x73, 0x72, 0x63, 0x00, 0x05, 0x00, 0x08, 0x00, 0x60, 0x00, 0x00, 0x00,
|
||||||
|
0x73, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x5F, 0x63, 0x6F, 0x75, 0x6E, 0x74, 0x73, 0x5F, 0x6C, 0x6F,
|
||||||
|
0x67, 0x32, 0x5F, 0x69, 0x6E, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x60, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x73, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x5F, 0x63, 0x6F, 0x75, 0x6E, 0x74,
|
||||||
|
0x73, 0x5F, 0x6C, 0x6F, 0x67, 0x32, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x62, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0xB3, 0x00, 0x00, 0x00, 0x73, 0x72, 0x63, 0x4D,
|
||||||
|
0x53, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0xBD, 0x00, 0x00, 0x00, 0x64, 0x73, 0x74, 0x4D,
|
||||||
|
0x53, 0x52, 0x38, 0x00, 0x05, 0x00, 0x05, 0x00, 0xD2, 0x00, 0x00, 0x00, 0x64, 0x73, 0x74, 0x4D,
|
||||||
|
0x53, 0x52, 0x31, 0x36, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0xE7, 0x00, 0x00, 0x00,
|
||||||
|
0x64, 0x73, 0x74, 0x4D, 0x53, 0x52, 0x33, 0x32, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00,
|
||||||
|
0xFC, 0x00, 0x00, 0x00, 0x64, 0x73, 0x74, 0x4D, 0x53, 0x52, 0x47, 0x33, 0x32, 0x00, 0x00, 0x00,
|
||||||
|
0x05, 0x00, 0x05, 0x00, 0x11, 0x01, 0x00, 0x00, 0x64, 0x73, 0x74, 0x4D, 0x53, 0x52, 0x47, 0x42,
|
||||||
|
0x41, 0x33, 0x32, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||||
|
0x1C, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x40, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
|
0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x40, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x60, 0x00, 0x00, 0x00,
|
||||||
|
0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x62, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xB3, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
|
0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xB3, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xBD, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xBD, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xD2, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xD2, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xE7, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xE7, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x11, 0x01, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x11, 0x01, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x1D, 0x01, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||||
|
0x19, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||||
|
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||||
|
0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x00, 0x00,
|
||||||
|
0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||||
|
0x0C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00,
|
||||||
|
0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||||
|
0x0F, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00,
|
||||||
|
0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||||
|
0x14, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x32, 0x00, 0x04, 0x00,
|
||||||
|
0x0F, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00,
|
||||||
|
0x1F, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
|
||||||
|
0x20, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00,
|
||||||
|
0x3B, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x19, 0x00, 0x09, 0x00, 0x25, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||||
|
0x26, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x25, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x2C, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x2C, 0x00, 0x00, 0x00,
|
||||||
|
0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x31, 0x00, 0x00, 0x00,
|
||||||
|
0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||||
|
0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||||
|
0x32, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00,
|
||||||
|
0x37, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||||
|
0x20, 0x00, 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00,
|
||||||
|
0x3B, 0x00, 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x19, 0x00, 0x09, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x03, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00,
|
||||||
|
0x20, 0x00, 0x04, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00,
|
||||||
|
0x3B, 0x00, 0x04, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x14, 0x00, 0x02, 0x00, 0x46, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||||
|
0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||||
|
0x53, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x5F, 0x00, 0x00, 0x00,
|
||||||
|
0x0F, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x03, 0x00, 0x60, 0x00, 0x00, 0x00,
|
||||||
|
0x5F, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||||
|
0x60, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00,
|
||||||
|
0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x63, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||||
|
0x0F, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00,
|
||||||
|
0x02, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6D, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0xB0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x03, 0x00, 0xB1, 0x00, 0x00, 0x00,
|
||||||
|
0xB0, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xB2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0xB1, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0xB2, 0x00, 0x00, 0x00, 0xB3, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0xB8, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||||
|
0x04, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0xBB, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x02, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xBC, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0xBB, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0xBC, 0x00, 0x00, 0x00,
|
||||||
|
0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0xD0, 0x00, 0x00, 0x00,
|
||||||
|
0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||||
|
0xD1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||||
|
0xD1, 0x00, 0x00, 0x00, 0xD2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00,
|
||||||
|
0xE5, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||||
|
0x20, 0x00, 0x04, 0x00, 0xE6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE5, 0x00, 0x00, 0x00,
|
||||||
|
0x3B, 0x00, 0x04, 0x00, 0xE6, 0x00, 0x00, 0x00, 0xE7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x19, 0x00, 0x09, 0x00, 0xFA, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||||
|
0x23, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0xFB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0xFA, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0xFB, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x0F, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x02, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x10, 0x01, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x10, 0x01, 0x00, 0x00,
|
||||||
|
0x11, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||||
|
0x1C, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x06, 0x00, 0x0A, 0x00, 0x00, 0x00,
|
||||||
|
0x1D, 0x01, 0x00, 0x00, 0x1C, 0x01, 0x00, 0x00, 0x1C, 0x01, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00,
|
||||||
|
0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00,
|
||||||
|
0x1E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0x00, 0x03, 0x00, 0x47, 0x00, 0x00, 0x00,
|
||||||
|
0x1F, 0x01, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x1F, 0x01, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0x0A, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x07, 0x00,
|
||||||
|
0x07, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x1D, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0xFB, 0x00, 0x0F, 0x00, 0x15, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00,
|
||||||
|
0x02, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
|
||||||
|
0x08, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00,
|
||||||
|
0xF8, 0x00, 0x02, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x3E, 0x00, 0x00, 0x00,
|
||||||
|
0x41, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x64, 0x00, 0x04, 0x00, 0x3D, 0x00, 0x00, 0x00,
|
||||||
|
0x42, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x67, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||||
|
0x43, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0x1D, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x16, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0x1D, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x17, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0x1F, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x68, 0x00, 0x04, 0x00,
|
||||||
|
0x10, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0x1D, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0x25, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x68, 0x00, 0x04, 0x00,
|
||||||
|
0x10, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0x1D, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x19, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0x2B, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x68, 0x00, 0x04, 0x00,
|
||||||
|
0x10, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0x1D, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0x31, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x68, 0x00, 0x04, 0x00,
|
||||||
|
0x10, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0x1D, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0x37, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x68, 0x00, 0x04, 0x00,
|
||||||
|
0x10, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0x1D, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x1D, 0x00, 0x00, 0x00, 0xF5, 0x00, 0x11, 0x00,
|
||||||
|
0x10, 0x00, 0x00, 0x00, 0x2C, 0x01, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00,
|
||||||
|
0x14, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00,
|
||||||
|
0x29, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
|
||||||
|
0x35, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00,
|
||||||
|
0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00,
|
||||||
|
0x4A, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00,
|
||||||
|
0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAF, 0x00, 0x05, 0x00, 0x46, 0x00, 0x00, 0x00,
|
||||||
|
0x4F, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0xA8, 0x00, 0x04, 0x00,
|
||||||
|
0x46, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00,
|
||||||
|
0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00, 0x50, 0x00, 0x00, 0x00,
|
||||||
|
0x51, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x51, 0x00, 0x00, 0x00,
|
||||||
|
0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00,
|
||||||
|
0x55, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00,
|
||||||
|
0x2C, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xAF, 0x00, 0x05, 0x00, 0x46, 0x00, 0x00, 0x00,
|
||||||
|
0x59, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0x52, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x52, 0x00, 0x00, 0x00, 0xF5, 0x00, 0x07, 0x00,
|
||||||
|
0x46, 0x00, 0x00, 0x00, 0x5A, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00,
|
||||||
|
0x59, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x5C, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00, 0x5A, 0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x00,
|
||||||
|
0x5C, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x5B, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0x1E, 0x01, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00,
|
||||||
|
0x63, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||||
|
0x47, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00,
|
||||||
|
0x64, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x63, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00,
|
||||||
|
0x62, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0x0F, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x00, 0x82, 0x00, 0x05, 0x00,
|
||||||
|
0x0F, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00,
|
||||||
|
0x41, 0x00, 0x06, 0x00, 0x63, 0x00, 0x00, 0x00, 0x6B, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00,
|
||||||
|
0x13, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00,
|
||||||
|
0x6C, 0x00, 0x00, 0x00, 0x6B, 0x00, 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x63, 0x00, 0x00, 0x00,
|
||||||
|
0x6E, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x6D, 0x00, 0x00, 0x00,
|
||||||
|
0x3D, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x6E, 0x00, 0x00, 0x00,
|
||||||
|
0x82, 0x00, 0x05, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00,
|
||||||
|
0x6F, 0x00, 0x00, 0x00, 0xC4, 0x00, 0x05, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00,
|
||||||
|
0x78, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0xC4, 0x00, 0x05, 0x00, 0x0F, 0x00, 0x00, 0x00,
|
||||||
|
0x7D, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, 0xC3, 0x00, 0x05, 0x00,
|
||||||
|
0x0F, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x69, 0x00, 0x00, 0x00,
|
||||||
|
0x82, 0x00, 0x05, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x7A, 0x00, 0x00, 0x00,
|
||||||
|
0x78, 0x00, 0x00, 0x00, 0xC7, 0x00, 0x05, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00,
|
||||||
|
0x83, 0x00, 0x00, 0x00, 0x85, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||||
|
0x88, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x04, 0x00,
|
||||||
|
0x0F, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0xC3, 0x00, 0x05, 0x00,
|
||||||
|
0x0F, 0x00, 0x00, 0x00, 0x8B, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00,
|
||||||
|
0x82, 0x00, 0x05, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00,
|
||||||
|
0x78, 0x00, 0x00, 0x00, 0xC7, 0x00, 0x05, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00,
|
||||||
|
0x8B, 0x00, 0x00, 0x00, 0x8D, 0x00, 0x00, 0x00, 0xC4, 0x00, 0x05, 0x00, 0x0F, 0x00, 0x00, 0x00,
|
||||||
|
0x90, 0x00, 0x00, 0x00, 0x8E, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0xC5, 0x00, 0x05, 0x00,
|
||||||
|
0x0F, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00,
|
||||||
|
0xC3, 0x00, 0x05, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00,
|
||||||
|
0x65, 0x00, 0x00, 0x00, 0xC3, 0x00, 0x05, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00,
|
||||||
|
0x89, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x50, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||||
|
0xA1, 0x00, 0x00, 0x00, 0x9B, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00,
|
||||||
|
0xAC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0x00, 0x17, 0x00, 0x15, 0x00, 0x00, 0x00,
|
||||||
|
0xAC, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xA2, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xA3, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xA4, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xA5, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xA6, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xA7, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xA8, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xA9, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xAB, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0xA2, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0x1F, 0x00, 0x00, 0x00, 0xAD, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x04, 0x00,
|
||||||
|
0x10, 0x00, 0x00, 0x00, 0xAF, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0xB1, 0x00, 0x00, 0x00, 0xB4, 0x00, 0x00, 0x00, 0xB3, 0x00, 0x00, 0x00, 0x64, 0x00, 0x04, 0x00,
|
||||||
|
0xB0, 0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0xB4, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x07, 0x00,
|
||||||
|
0xB8, 0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0xB7, 0x00, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00,
|
||||||
|
0x40, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x63, 0x00, 0x04, 0x00, 0xAD, 0x00, 0x00, 0x00,
|
||||||
|
0xAF, 0x00, 0x00, 0x00, 0xB9, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, 0xAC, 0x00, 0x00, 0x00,
|
||||||
|
0xF8, 0x00, 0x02, 0x00, 0xA3, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0xBB, 0x00, 0x00, 0x00,
|
||||||
|
0xBE, 0x00, 0x00, 0x00, 0xBD, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x3E, 0x00, 0x00, 0x00,
|
||||||
|
0xC1, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||||
|
0xC3, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x64, 0x00, 0x04, 0x00, 0x3D, 0x00, 0x00, 0x00,
|
||||||
|
0xC4, 0x00, 0x00, 0x00, 0xC1, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x07, 0x00, 0xB8, 0x00, 0x00, 0x00,
|
||||||
|
0xC5, 0x00, 0x00, 0x00, 0xC4, 0x00, 0x00, 0x00, 0xC3, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||||
|
0x13, 0x00, 0x00, 0x00, 0x63, 0x00, 0x06, 0x00, 0xBE, 0x00, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00,
|
||||||
|
0xC5, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0xAC, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0xA4, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0x25, 0x00, 0x00, 0x00, 0xC7, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x04, 0x00,
|
||||||
|
0x10, 0x00, 0x00, 0x00, 0xC9, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0xB1, 0x00, 0x00, 0x00, 0xCA, 0x00, 0x00, 0x00, 0xB3, 0x00, 0x00, 0x00, 0x64, 0x00, 0x04, 0x00,
|
||||||
|
0xB0, 0x00, 0x00, 0x00, 0xCD, 0x00, 0x00, 0x00, 0xCA, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x07, 0x00,
|
||||||
|
0xB8, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0xCD, 0x00, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00,
|
||||||
|
0x40, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x63, 0x00, 0x04, 0x00, 0xC7, 0x00, 0x00, 0x00,
|
||||||
|
0xC9, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, 0xAC, 0x00, 0x00, 0x00,
|
||||||
|
0xF8, 0x00, 0x02, 0x00, 0xA5, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0xD0, 0x00, 0x00, 0x00,
|
||||||
|
0xD3, 0x00, 0x00, 0x00, 0xD2, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x3E, 0x00, 0x00, 0x00,
|
||||||
|
0xD6, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||||
|
0xD8, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x64, 0x00, 0x04, 0x00, 0x3D, 0x00, 0x00, 0x00,
|
||||||
|
0xD9, 0x00, 0x00, 0x00, 0xD6, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x07, 0x00, 0xB8, 0x00, 0x00, 0x00,
|
||||||
|
0xDA, 0x00, 0x00, 0x00, 0xD9, 0x00, 0x00, 0x00, 0xD8, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||||
|
0x13, 0x00, 0x00, 0x00, 0x63, 0x00, 0x06, 0x00, 0xD3, 0x00, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00,
|
||||||
|
0xDA, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0xAC, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0xA6, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0x2B, 0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x04, 0x00,
|
||||||
|
0x10, 0x00, 0x00, 0x00, 0xDE, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0xB1, 0x00, 0x00, 0x00, 0xDF, 0x00, 0x00, 0x00, 0xB3, 0x00, 0x00, 0x00, 0x64, 0x00, 0x04, 0x00,
|
||||||
|
0xB0, 0x00, 0x00, 0x00, 0xE2, 0x00, 0x00, 0x00, 0xDF, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x07, 0x00,
|
||||||
|
0xB8, 0x00, 0x00, 0x00, 0xE3, 0x00, 0x00, 0x00, 0xE2, 0x00, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00,
|
||||||
|
0x40, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x63, 0x00, 0x04, 0x00, 0xDC, 0x00, 0x00, 0x00,
|
||||||
|
0xDE, 0x00, 0x00, 0x00, 0xE3, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, 0xAC, 0x00, 0x00, 0x00,
|
||||||
|
0xF8, 0x00, 0x02, 0x00, 0xA7, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0xE5, 0x00, 0x00, 0x00,
|
||||||
|
0xE8, 0x00, 0x00, 0x00, 0xE7, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x3E, 0x00, 0x00, 0x00,
|
||||||
|
0xEB, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||||
|
0xED, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x64, 0x00, 0x04, 0x00, 0x3D, 0x00, 0x00, 0x00,
|
||||||
|
0xEE, 0x00, 0x00, 0x00, 0xEB, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x07, 0x00, 0xB8, 0x00, 0x00, 0x00,
|
||||||
|
0xEF, 0x00, 0x00, 0x00, 0xEE, 0x00, 0x00, 0x00, 0xED, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||||
|
0x13, 0x00, 0x00, 0x00, 0x63, 0x00, 0x06, 0x00, 0xE8, 0x00, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00,
|
||||||
|
0xEF, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0xAC, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0xA8, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0x31, 0x00, 0x00, 0x00, 0xF1, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x04, 0x00,
|
||||||
|
0x10, 0x00, 0x00, 0x00, 0xF3, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0xB1, 0x00, 0x00, 0x00, 0xF4, 0x00, 0x00, 0x00, 0xB3, 0x00, 0x00, 0x00, 0x64, 0x00, 0x04, 0x00,
|
||||||
|
0xB0, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x00, 0x00, 0xF4, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x07, 0x00,
|
||||||
|
0xB8, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00,
|
||||||
|
0x40, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x63, 0x00, 0x04, 0x00, 0xF1, 0x00, 0x00, 0x00,
|
||||||
|
0xF3, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, 0xAC, 0x00, 0x00, 0x00,
|
||||||
|
0xF8, 0x00, 0x02, 0x00, 0xA9, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0xFA, 0x00, 0x00, 0x00,
|
||||||
|
0xFD, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x3E, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||||
|
0x02, 0x01, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x64, 0x00, 0x04, 0x00, 0x3D, 0x00, 0x00, 0x00,
|
||||||
|
0x03, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x5F, 0x00, 0x07, 0x00, 0xB8, 0x00, 0x00, 0x00,
|
||||||
|
0x04, 0x01, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||||
|
0x13, 0x00, 0x00, 0x00, 0x63, 0x00, 0x06, 0x00, 0xFD, 0x00, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00,
|
||||||
|
0x04, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0xAC, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0x37, 0x00, 0x00, 0x00, 0x06, 0x01, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x04, 0x00,
|
||||||
|
0x10, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||||
|
0xB1, 0x00, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0xB3, 0x00, 0x00, 0x00, 0x64, 0x00, 0x04, 0x00,
|
||||||
|
0xB0, 0x00, 0x00, 0x00, 0x0C, 0x01, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x5F, 0x00, 0x07, 0x00,
|
||||||
|
0xB8, 0x00, 0x00, 0x00, 0x0D, 0x01, 0x00, 0x00, 0x0C, 0x01, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00,
|
||||||
|
0x40, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0x63, 0x00, 0x04, 0x00, 0x06, 0x01, 0x00, 0x00,
|
||||||
|
0x08, 0x01, 0x00, 0x00, 0x0D, 0x01, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, 0xAC, 0x00, 0x00, 0x00,
|
||||||
|
0xF8, 0x00, 0x02, 0x00, 0xAB, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0F, 0x01, 0x00, 0x00,
|
||||||
|
0x12, 0x01, 0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x3E, 0x00, 0x00, 0x00,
|
||||||
|
0x15, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||||
|
0x17, 0x01, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x64, 0x00, 0x04, 0x00, 0x3D, 0x00, 0x00, 0x00,
|
||||||
|
0x18, 0x01, 0x00, 0x00, 0x15, 0x01, 0x00, 0x00, 0x5F, 0x00, 0x07, 0x00, 0xB8, 0x00, 0x00, 0x00,
|
||||||
|
0x19, 0x01, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x17, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||||
|
0x13, 0x00, 0x00, 0x00, 0x63, 0x00, 0x06, 0x00, 0x12, 0x01, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00,
|
||||||
|
0x19, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0xAC, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0xAC, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||||
|
0x1E, 0x01, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x1E, 0x01, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00,
|
||||||
|
0x38, 0x00, 0x01, 0x00,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
103
Ryujinx.Graphics.Vulkan/SpecInfo.cs
Normal file
103
Ryujinx.Graphics.Vulkan/SpecInfo.cs
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
using Silk.NET.Vulkan;
|
||||||
|
using System;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace Ryujinx.Graphics.Vulkan
|
||||||
|
{
|
||||||
|
public enum SpecConstType
|
||||||
|
{
|
||||||
|
Bool32,
|
||||||
|
Int16,
|
||||||
|
Int32,
|
||||||
|
Int64,
|
||||||
|
Float16,
|
||||||
|
Float32,
|
||||||
|
Float64
|
||||||
|
}
|
||||||
|
|
||||||
|
sealed class SpecDescription
|
||||||
|
{
|
||||||
|
public readonly SpecializationInfo Info;
|
||||||
|
public readonly SpecializationMapEntry[] Map;
|
||||||
|
|
||||||
|
// For mapping a simple packed struct or single entry
|
||||||
|
public SpecDescription(params (uint Id, SpecConstType Type)[] description)
|
||||||
|
{
|
||||||
|
int count = description.Length;
|
||||||
|
Map = new SpecializationMapEntry[count];
|
||||||
|
|
||||||
|
uint structSize = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < count; ++i)
|
||||||
|
{
|
||||||
|
var typeSize = SizeOf(description[i].Type);
|
||||||
|
Map[i] = new SpecializationMapEntry(description[i].Id, structSize, typeSize);
|
||||||
|
structSize += typeSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info = new SpecializationInfo()
|
||||||
|
{
|
||||||
|
DataSize = structSize,
|
||||||
|
MapEntryCount = (uint)count
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// For advanced mapping with overlapping or staggered fields
|
||||||
|
public SpecDescription(SpecializationMapEntry[] map)
|
||||||
|
{
|
||||||
|
int count = map.Length;
|
||||||
|
Map = map;
|
||||||
|
|
||||||
|
uint structSize = 0;
|
||||||
|
for (int i = 0; i < count; ++i)
|
||||||
|
{
|
||||||
|
structSize = Math.Max(structSize, map[i].Offset + (uint)map[i].Size);
|
||||||
|
}
|
||||||
|
|
||||||
|
Info = new SpecializationInfo()
|
||||||
|
{
|
||||||
|
DataSize = structSize,
|
||||||
|
MapEntryCount = (uint)map.Length
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static uint SizeOf(SpecConstType type) => type switch
|
||||||
|
{
|
||||||
|
SpecConstType.Int16 or SpecConstType.Float16 => 2,
|
||||||
|
SpecConstType.Bool32 or SpecConstType.Int32 or SpecConstType.Float32 => 4,
|
||||||
|
SpecConstType.Int64 or SpecConstType.Float64 => 8,
|
||||||
|
_ => throw new ArgumentOutOfRangeException(nameof(type))
|
||||||
|
};
|
||||||
|
|
||||||
|
private SpecDescription()
|
||||||
|
{
|
||||||
|
Info = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly SpecDescription Empty = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly struct SpecData : IRefEquatable<SpecData>
|
||||||
|
{
|
||||||
|
private readonly byte[] _data;
|
||||||
|
private readonly int _hash;
|
||||||
|
|
||||||
|
public int Length => _data.Length;
|
||||||
|
public ReadOnlySpan<byte> Span => _data.AsSpan();
|
||||||
|
public override int GetHashCode() => _hash;
|
||||||
|
|
||||||
|
public SpecData(ReadOnlySpan<byte> data)
|
||||||
|
{
|
||||||
|
_data = new byte[data.Length];
|
||||||
|
data.CopyTo(_data);
|
||||||
|
|
||||||
|
var hc = new HashCode();
|
||||||
|
hc.AddBytes(data);
|
||||||
|
_hash = hc.ToHashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(object obj) => obj is SpecData other && Equals(other);
|
||||||
|
public bool Equals(ref SpecData other) => _data.AsSpan().SequenceEqual(other._data);
|
||||||
|
}
|
||||||
|
}
|
@@ -355,5 +355,122 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
dstLayers,
|
dstLayers,
|
||||||
levels);
|
levels);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public unsafe static void ResolveDepthStencil(
|
||||||
|
VulkanRenderer gd,
|
||||||
|
Device device,
|
||||||
|
CommandBufferScoped cbs,
|
||||||
|
TextureView src,
|
||||||
|
TextureView dst)
|
||||||
|
{
|
||||||
|
var dsAttachmentReference = new AttachmentReference2(StructureType.AttachmentReference2, null, 0, ImageLayout.General);
|
||||||
|
var dsResolveAttachmentReference = new AttachmentReference2(StructureType.AttachmentReference2, null, 1, ImageLayout.General);
|
||||||
|
|
||||||
|
var subpassDsResolve = new SubpassDescriptionDepthStencilResolve()
|
||||||
|
{
|
||||||
|
SType = StructureType.SubpassDescriptionDepthStencilResolve,
|
||||||
|
PDepthStencilResolveAttachment = &dsResolveAttachmentReference,
|
||||||
|
DepthResolveMode = ResolveModeFlags.ResolveModeSampleZeroBit,
|
||||||
|
StencilResolveMode = ResolveModeFlags.ResolveModeSampleZeroBit
|
||||||
|
};
|
||||||
|
|
||||||
|
var subpass = new SubpassDescription2()
|
||||||
|
{
|
||||||
|
SType = StructureType.SubpassDescription2,
|
||||||
|
PipelineBindPoint = PipelineBindPoint.Graphics,
|
||||||
|
PDepthStencilAttachment = &dsAttachmentReference,
|
||||||
|
PNext = &subpassDsResolve
|
||||||
|
};
|
||||||
|
|
||||||
|
AttachmentDescription2[] attachmentDescs = new AttachmentDescription2[2];
|
||||||
|
|
||||||
|
attachmentDescs[0] = new AttachmentDescription2(
|
||||||
|
StructureType.AttachmentDescription2,
|
||||||
|
null,
|
||||||
|
0,
|
||||||
|
src.VkFormat,
|
||||||
|
TextureStorage.ConvertToSampleCountFlags((uint)src.Info.Samples),
|
||||||
|
AttachmentLoadOp.Load,
|
||||||
|
AttachmentStoreOp.Store,
|
||||||
|
AttachmentLoadOp.Load,
|
||||||
|
AttachmentStoreOp.Store,
|
||||||
|
ImageLayout.General,
|
||||||
|
ImageLayout.General);
|
||||||
|
|
||||||
|
attachmentDescs[1] = new AttachmentDescription2(
|
||||||
|
StructureType.AttachmentDescription2,
|
||||||
|
null,
|
||||||
|
0,
|
||||||
|
dst.VkFormat,
|
||||||
|
TextureStorage.ConvertToSampleCountFlags((uint)dst.Info.Samples),
|
||||||
|
AttachmentLoadOp.Load,
|
||||||
|
AttachmentStoreOp.Store,
|
||||||
|
AttachmentLoadOp.Load,
|
||||||
|
AttachmentStoreOp.Store,
|
||||||
|
ImageLayout.General,
|
||||||
|
ImageLayout.General);
|
||||||
|
|
||||||
|
var subpassDependency = PipelineConverter.CreateSubpassDependency2();
|
||||||
|
|
||||||
|
fixed (AttachmentDescription2* pAttachmentDescs = attachmentDescs)
|
||||||
|
{
|
||||||
|
var renderPassCreateInfo = new RenderPassCreateInfo2()
|
||||||
|
{
|
||||||
|
SType = StructureType.RenderPassCreateInfo2,
|
||||||
|
PAttachments = pAttachmentDescs,
|
||||||
|
AttachmentCount = (uint)attachmentDescs.Length,
|
||||||
|
PSubpasses = &subpass,
|
||||||
|
SubpassCount = 1,
|
||||||
|
PDependencies = &subpassDependency,
|
||||||
|
DependencyCount = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
gd.Api.CreateRenderPass2(device, renderPassCreateInfo, null, out var renderPass).ThrowOnError();
|
||||||
|
|
||||||
|
using var rp = new Auto<DisposableRenderPass>(new DisposableRenderPass(gd.Api, device, renderPass));
|
||||||
|
|
||||||
|
ImageView* attachments = stackalloc ImageView[2];
|
||||||
|
|
||||||
|
var srcView = src.GetImageViewForAttachment();
|
||||||
|
var dstView = dst.GetImageViewForAttachment();
|
||||||
|
|
||||||
|
attachments[0] = srcView.Get(cbs).Value;
|
||||||
|
attachments[1] = dstView.Get(cbs).Value;
|
||||||
|
|
||||||
|
var framebufferCreateInfo = new FramebufferCreateInfo()
|
||||||
|
{
|
||||||
|
SType = StructureType.FramebufferCreateInfo,
|
||||||
|
RenderPass = rp.Get(cbs).Value,
|
||||||
|
AttachmentCount = 2,
|
||||||
|
PAttachments = attachments,
|
||||||
|
Width = (uint)src.Width,
|
||||||
|
Height = (uint)src.Height,
|
||||||
|
Layers = (uint)src.Layers
|
||||||
|
};
|
||||||
|
|
||||||
|
gd.Api.CreateFramebuffer(device, framebufferCreateInfo, null, out var framebuffer).ThrowOnError();
|
||||||
|
using var fb = new Auto<DisposableFramebuffer>(new DisposableFramebuffer(gd.Api, device, framebuffer), null, new[] { srcView, dstView });
|
||||||
|
|
||||||
|
var renderArea = new Rect2D(null, new Extent2D((uint)src.Info.Width, (uint)src.Info.Height));
|
||||||
|
var clearValue = new ClearValue();
|
||||||
|
|
||||||
|
var renderPassBeginInfo = new RenderPassBeginInfo()
|
||||||
|
{
|
||||||
|
SType = StructureType.RenderPassBeginInfo,
|
||||||
|
RenderPass = rp.Get(cbs).Value,
|
||||||
|
Framebuffer = fb.Get(cbs).Value,
|
||||||
|
RenderArea = renderArea,
|
||||||
|
PClearValues = &clearValue,
|
||||||
|
ClearValueCount = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
// The resolve operation happens at the end of the subpass, so let's just do a begin/end
|
||||||
|
// to resolve the depth-stencil texture.
|
||||||
|
// TODO: Do speculative resolve and part of the same render pass as the draw to avoid
|
||||||
|
// ending the current render pass?
|
||||||
|
gd.Api.CmdBeginRenderPass(cbs.CommandBuffer, renderPassBeginInfo, SubpassContents.Inline);
|
||||||
|
gd.Api.CmdEndRenderPass(cbs.CommandBuffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -169,12 +169,15 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
var srcImage = src.GetImage().Get(cbs).Value;
|
var srcImage = src.GetImage().Get(cbs).Value;
|
||||||
var dstImage = dst.GetImage().Get(cbs).Value;
|
var dstImage = dst.GetImage().Get(cbs).Value;
|
||||||
|
|
||||||
if (src.Info.Target.IsMultisample())
|
if (!dst.Info.Target.IsMultisample() && Info.Target.IsMultisample())
|
||||||
{
|
{
|
||||||
int depth = Math.Min(src.Info.Depth, dst.Info.Depth - firstLayer);
|
int layers = Math.Min(Info.GetLayers(), dst.Info.GetLayers() - firstLayer);
|
||||||
int levels = Math.Min(src.Info.Levels, dst.Info.Levels - firstLevel);
|
_gd.HelperShader.CopyMSToNonMS(_gd, cbs, src, dst, 0, firstLayer, layers);
|
||||||
|
}
|
||||||
CopyMSToNonMS(_gd, cbs, src, dst, srcImage, dstImage, 0, firstLayer, 0, firstLevel, depth, levels);
|
else if (dst.Info.Target.IsMultisample() && !Info.Target.IsMultisample())
|
||||||
|
{
|
||||||
|
int layers = Math.Min(Info.GetLayers(), dst.Info.GetLayers() - firstLayer);
|
||||||
|
_gd.HelperShader.CopyNonMSToMS(_gd, cbs, src, dst, 0, firstLayer, layers);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -213,9 +216,13 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
var srcImage = src.GetImage().Get(cbs).Value;
|
var srcImage = src.GetImage().Get(cbs).Value;
|
||||||
var dstImage = dst.GetImage().Get(cbs).Value;
|
var dstImage = dst.GetImage().Get(cbs).Value;
|
||||||
|
|
||||||
if (src.Info.Target.IsMultisample())
|
if (!dst.Info.Target.IsMultisample() && Info.Target.IsMultisample())
|
||||||
{
|
{
|
||||||
CopyMSToNonMS(_gd, cbs, src, dst, srcImage, dstImage, srcLayer, dstLayer, srcLevel, dstLevel, 1, 1);
|
_gd.HelperShader.CopyMSToNonMS(_gd, cbs, src, dst, srcLayer, dstLayer, 1);
|
||||||
|
}
|
||||||
|
else if (dst.Info.Target.IsMultisample() && !Info.Target.IsMultisample())
|
||||||
|
{
|
||||||
|
_gd.HelperShader.CopyNonMSToMS(_gd, cbs, src, dst, srcLayer, dstLayer, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -239,142 +246,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CopyMSToNonMS(
|
|
||||||
VulkanRenderer gd,
|
|
||||||
CommandBufferScoped cbs,
|
|
||||||
TextureView src,
|
|
||||||
TextureView dst,
|
|
||||||
Image srcImage,
|
|
||||||
Image dstImage,
|
|
||||||
int srcLayer,
|
|
||||||
int dstLayer,
|
|
||||||
int srcLevel,
|
|
||||||
int dstLevel,
|
|
||||||
int layers,
|
|
||||||
int levels)
|
|
||||||
{
|
|
||||||
bool differentFormats = src.Info.Format != dst.Info.Format;
|
|
||||||
|
|
||||||
var target = src.Info.Target switch
|
|
||||||
{
|
|
||||||
Target.Texture2D => Target.Texture2DMultisample,
|
|
||||||
Target.Texture2DArray => Target.Texture2DMultisampleArray,
|
|
||||||
Target.Texture2DMultisampleArray => Target.Texture2DArray,
|
|
||||||
_ => Target.Texture2D
|
|
||||||
};
|
|
||||||
|
|
||||||
var intermmediateTarget = differentFormats ? dst.Info.Target : target;
|
|
||||||
using var intermmediate = CreateIntermmediateTexture(gd, src, ref dst._info, intermmediateTarget, layers, levels);
|
|
||||||
var intermmediateImage = intermmediate.GetImage().Get(cbs).Value;
|
|
||||||
|
|
||||||
if (differentFormats)
|
|
||||||
{
|
|
||||||
// If the formats are different, the resolve would perform format conversion.
|
|
||||||
// So we need yet another intermmediate texture and do a copy to reinterpret the
|
|
||||||
// data into the correct (destination) format, without doing any sort of conversion.
|
|
||||||
using var intermmediate2 = CreateIntermmediateTexture(gd, src, ref src._info, target, layers, levels);
|
|
||||||
var intermmediate2Image = intermmediate2.GetImage().Get(cbs).Value;
|
|
||||||
|
|
||||||
TextureCopy.Copy(
|
|
||||||
gd.Api,
|
|
||||||
cbs.CommandBuffer,
|
|
||||||
srcImage,
|
|
||||||
intermmediate2Image,
|
|
||||||
src.Info,
|
|
||||||
intermmediate2.Info,
|
|
||||||
src.FirstLayer,
|
|
||||||
0,
|
|
||||||
src.FirstLevel,
|
|
||||||
0,
|
|
||||||
srcLayer,
|
|
||||||
0,
|
|
||||||
srcLevel,
|
|
||||||
0,
|
|
||||||
layers,
|
|
||||||
levels);
|
|
||||||
|
|
||||||
TextureCopy.Copy(
|
|
||||||
gd.Api,
|
|
||||||
cbs.CommandBuffer,
|
|
||||||
intermmediate2Image,
|
|
||||||
intermmediateImage,
|
|
||||||
intermmediate2.Info,
|
|
||||||
intermmediate.Info,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
layers,
|
|
||||||
levels);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TextureCopy.Copy(
|
|
||||||
gd.Api,
|
|
||||||
cbs.CommandBuffer,
|
|
||||||
srcImage,
|
|
||||||
intermmediateImage,
|
|
||||||
src.Info,
|
|
||||||
intermmediate.Info,
|
|
||||||
src.FirstLayer,
|
|
||||||
0,
|
|
||||||
src.FirstLevel,
|
|
||||||
0,
|
|
||||||
srcLayer,
|
|
||||||
0,
|
|
||||||
srcLevel,
|
|
||||||
0,
|
|
||||||
layers,
|
|
||||||
levels);
|
|
||||||
}
|
|
||||||
|
|
||||||
var srcRegion = new Extents2D(0, 0, src.Width, src.Height);
|
|
||||||
var dstRegion = new Extents2D(0, 0, dst.Width, dst.Height);
|
|
||||||
|
|
||||||
TextureCopy.Blit(
|
|
||||||
gd.Api,
|
|
||||||
cbs.CommandBuffer,
|
|
||||||
intermmediateImage,
|
|
||||||
dstImage,
|
|
||||||
intermmediate.Info,
|
|
||||||
dst.Info,
|
|
||||||
srcRegion,
|
|
||||||
dstRegion,
|
|
||||||
0,
|
|
||||||
dst.FirstLevel + dstLevel,
|
|
||||||
0,
|
|
||||||
dst.FirstLayer + dstLayer,
|
|
||||||
layers,
|
|
||||||
levels,
|
|
||||||
true,
|
|
||||||
ImageAspectFlags.ImageAspectColorBit,
|
|
||||||
ImageAspectFlags.ImageAspectColorBit);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static TextureView CreateIntermmediateTexture(VulkanRenderer gd, TextureView src, ref TextureCreateInfo formatInfo, Target target, int depth, int levels)
|
|
||||||
{
|
|
||||||
return gd.CreateTextureView(new GAL.TextureCreateInfo(
|
|
||||||
src.Width,
|
|
||||||
src.Height,
|
|
||||||
depth,
|
|
||||||
levels,
|
|
||||||
1,
|
|
||||||
formatInfo.BlockWidth,
|
|
||||||
formatInfo.BlockHeight,
|
|
||||||
formatInfo.BytesPerPixel,
|
|
||||||
formatInfo.Format,
|
|
||||||
DepthStencilMode.Depth,
|
|
||||||
target,
|
|
||||||
SwizzleComponent.Red,
|
|
||||||
SwizzleComponent.Green,
|
|
||||||
SwizzleComponent.Blue,
|
|
||||||
SwizzleComponent.Alpha), 1f);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void CopyTo(ITexture destination, Extents2D srcRegion, Extents2D dstRegion, bool linearFilter)
|
public void CopyTo(ITexture destination, Extents2D srcRegion, Extents2D dstRegion, bool linearFilter)
|
||||||
{
|
{
|
||||||
var dst = (TextureView)destination;
|
var dst = (TextureView)destination;
|
||||||
@@ -422,23 +293,32 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
src.Height == dst.Height &&
|
src.Height == dst.Height &&
|
||||||
src.VkFormat == dst.VkFormat)
|
src.VkFormat == dst.VkFormat)
|
||||||
{
|
{
|
||||||
TextureCopy.Copy(
|
if (src.Info.Samples > 1 && src.Info.Samples != dst.Info.Samples && src.Info.Format.IsDepthOrStencil())
|
||||||
_gd.Api,
|
{
|
||||||
cbs.CommandBuffer,
|
// CmdResolveImage does not support depth-stencil resolve, so we need to use an alternative path
|
||||||
src.GetImage().Get(cbs).Value,
|
// for those textures.
|
||||||
dst.GetImage().Get(cbs).Value,
|
TextureCopy.ResolveDepthStencil(_gd, _device, cbs, src, dst);
|
||||||
src.Info,
|
}
|
||||||
dst.Info,
|
else
|
||||||
src.FirstLayer,
|
{
|
||||||
dst.FirstLayer,
|
TextureCopy.Copy(
|
||||||
src.FirstLevel,
|
_gd.Api,
|
||||||
dst.FirstLevel,
|
cbs.CommandBuffer,
|
||||||
0,
|
src.GetImage().Get(cbs).Value,
|
||||||
0,
|
dst.GetImage().Get(cbs).Value,
|
||||||
0,
|
src.Info,
|
||||||
0,
|
dst.Info,
|
||||||
layers,
|
src.FirstLayer,
|
||||||
levels);
|
dst.FirstLayer,
|
||||||
|
src.FirstLevel,
|
||||||
|
dst.FirstLevel,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
layers,
|
||||||
|
levels);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Graphics.GAL;
|
using Ryujinx.Graphics.GAL;
|
||||||
using Silk.NET.Vulkan;
|
using Silk.NET.Vulkan;
|
||||||
@@ -53,7 +53,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
"VUID-VkSubpassDependency-srcSubpass-00867"
|
"VUID-VkSubpassDependency-srcSubpass-00867"
|
||||||
};
|
};
|
||||||
|
|
||||||
internal static Instance CreateInstance(Vk api, GraphicsDebugLevel logLevel, string[] requiredExtensions, out ExtDebugReport debugReport, out DebugReportCallbackEXT debugReportCallback)
|
internal static Instance CreateInstance(Vk api, GraphicsDebugLevel logLevel, string[] requiredExtensions, out ExtDebugUtils debugUtils, out DebugUtilsMessengerEXT debugUtilsMessenger)
|
||||||
{
|
{
|
||||||
var enabledLayers = new List<string>();
|
var enabledLayers = new List<string>();
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
AddAvailableLayer("VK_LAYER_KHRONOS_validation");
|
AddAvailableLayer("VK_LAYER_KHRONOS_validation");
|
||||||
}
|
}
|
||||||
|
|
||||||
var enabledExtensions = requiredExtensions.Append(ExtDebugReport.ExtensionName).ToArray();
|
var enabledExtensions = requiredExtensions.Append(ExtDebugUtils.ExtensionName).ToArray();
|
||||||
|
|
||||||
var appName = Marshal.StringToHGlobalAnsi(AppName);
|
var appName = Marshal.StringToHGlobalAnsi(AppName);
|
||||||
|
|
||||||
@@ -139,22 +139,18 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
Marshal.FreeHGlobal(ppEnabledLayers[i]);
|
Marshal.FreeHGlobal(ppEnabledLayers[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateDebugCallbacks(api, logLevel, instance, out debugReport, out debugReportCallback);
|
CreateDebugMessenger(api, logLevel, instance, out debugUtils, out debugUtilsMessenger);
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
private unsafe static uint DebugReport(
|
private unsafe static uint DebugMessenger(
|
||||||
uint flags,
|
DebugUtilsMessageSeverityFlagsEXT messageSeverity,
|
||||||
DebugReportObjectTypeEXT objectType,
|
DebugUtilsMessageTypeFlagsEXT messageTypes,
|
||||||
ulong @object,
|
DebugUtilsMessengerCallbackDataEXT* pCallbackData,
|
||||||
nuint location,
|
void* pUserData)
|
||||||
int messageCode,
|
|
||||||
byte* layerPrefix,
|
|
||||||
byte* message,
|
|
||||||
void* userData)
|
|
||||||
{
|
{
|
||||||
var msg = Marshal.PtrToStringAnsi((IntPtr)message);
|
var msg = Marshal.PtrToStringAnsi((IntPtr)pCallbackData->PMessage);
|
||||||
|
|
||||||
foreach (string excludedMessagePart in _excludedMessages)
|
foreach (string excludedMessagePart in _excludedMessages)
|
||||||
{
|
{
|
||||||
@@ -164,26 +160,20 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugReportFlagsEXT debugFlags = (DebugReportFlagsEXT)flags;
|
if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityErrorBitExt))
|
||||||
|
|
||||||
if (debugFlags.HasFlag(DebugReportFlagsEXT.DebugReportErrorBitExt))
|
|
||||||
{
|
{
|
||||||
Logger.Error?.Print(LogClass.Gpu, msg);
|
Logger.Error?.Print(LogClass.Gpu, msg);
|
||||||
//throw new Exception(msg);
|
//throw new Exception(msg);
|
||||||
}
|
}
|
||||||
else if (debugFlags.HasFlag(DebugReportFlagsEXT.DebugReportWarningBitExt))
|
else if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityWarningBitExt))
|
||||||
{
|
{
|
||||||
Logger.Warning?.Print(LogClass.Gpu, msg);
|
Logger.Warning?.Print(LogClass.Gpu, msg);
|
||||||
}
|
}
|
||||||
else if (debugFlags.HasFlag(DebugReportFlagsEXT.DebugReportInformationBitExt))
|
else if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityInfoBitExt))
|
||||||
{
|
{
|
||||||
Logger.Info?.Print(LogClass.Gpu, msg);
|
Logger.Info?.Print(LogClass.Gpu, msg);
|
||||||
}
|
}
|
||||||
else if (debugFlags.HasFlag(DebugReportFlagsEXT.DebugReportPerformanceWarningBitExt))
|
else // if (messageSeverity.HasFlag(DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityVerboseBitExt))
|
||||||
{
|
|
||||||
Logger.Warning?.Print(LogClass.Gpu, msg);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
Logger.Debug?.Print(LogClass.Gpu, msg);
|
Logger.Debug?.Print(LogClass.Gpu, msg);
|
||||||
}
|
}
|
||||||
@@ -403,6 +393,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
ShaderClipDistance = true,
|
ShaderClipDistance = true,
|
||||||
ShaderFloat64 = supportedFeatures.ShaderFloat64,
|
ShaderFloat64 = supportedFeatures.ShaderFloat64,
|
||||||
ShaderImageGatherExtended = true,
|
ShaderImageGatherExtended = true,
|
||||||
|
ShaderStorageImageMultisample = supportedFeatures.ShaderStorageImageMultisample,
|
||||||
// ShaderStorageImageReadWithoutFormat = true,
|
// ShaderStorageImageReadWithoutFormat = true,
|
||||||
// ShaderStorageImageWriteWithoutFormat = true,
|
// ShaderStorageImageWriteWithoutFormat = true,
|
||||||
TessellationShader = true,
|
TessellationShader = true,
|
||||||
@@ -551,46 +542,59 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
return new CommandBufferPool(api, device, queue, queueLock, queueFamilyIndex);
|
return new CommandBufferPool(api, device, queue, queueLock, queueFamilyIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal unsafe static void CreateDebugCallbacks(
|
internal unsafe static void CreateDebugMessenger(
|
||||||
Vk api,
|
Vk api,
|
||||||
GraphicsDebugLevel logLevel,
|
GraphicsDebugLevel logLevel,
|
||||||
Instance instance,
|
Instance instance,
|
||||||
out ExtDebugReport debugReport,
|
out ExtDebugUtils debugUtils,
|
||||||
out DebugReportCallbackEXT debugReportCallback)
|
out DebugUtilsMessengerEXT debugUtilsMessenger)
|
||||||
{
|
{
|
||||||
debugReport = default;
|
debugUtils = default;
|
||||||
|
|
||||||
if (logLevel != GraphicsDebugLevel.None)
|
if (logLevel != GraphicsDebugLevel.None)
|
||||||
{
|
{
|
||||||
if (!api.TryGetInstanceExtension(instance, out debugReport))
|
if (!api.TryGetInstanceExtension(instance, out debugUtils))
|
||||||
{
|
{
|
||||||
debugReportCallback = default;
|
debugUtilsMessenger = default;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var flags = logLevel switch
|
var filterLogType = logLevel switch
|
||||||
{
|
{
|
||||||
GraphicsDebugLevel.Error => DebugReportFlagsEXT.DebugReportErrorBitExt,
|
GraphicsDebugLevel.Error => DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypeValidationBitExt,
|
||||||
GraphicsDebugLevel.Slowdowns => DebugReportFlagsEXT.DebugReportErrorBitExt | DebugReportFlagsEXT.DebugReportPerformanceWarningBitExt,
|
GraphicsDebugLevel.Slowdowns => DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypeValidationBitExt |
|
||||||
GraphicsDebugLevel.All => DebugReportFlagsEXT.DebugReportInformationBitExt |
|
DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypePerformanceBitExt,
|
||||||
DebugReportFlagsEXT.DebugReportWarningBitExt |
|
GraphicsDebugLevel.All => DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypeGeneralBitExt |
|
||||||
DebugReportFlagsEXT.DebugReportPerformanceWarningBitExt |
|
DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypeValidationBitExt |
|
||||||
DebugReportFlagsEXT.DebugReportErrorBitExt |
|
DebugUtilsMessageTypeFlagsEXT.DebugUtilsMessageTypePerformanceBitExt,
|
||||||
DebugReportFlagsEXT.DebugReportDebugBitExt,
|
|
||||||
_ => throw new ArgumentException($"Invalid log level \"{logLevel}\".")
|
_ => throw new ArgumentException($"Invalid log level \"{logLevel}\".")
|
||||||
};
|
};
|
||||||
var debugReportCallbackCreateInfo = new DebugReportCallbackCreateInfoEXT()
|
|
||||||
|
var filterLogSeverity = logLevel switch
|
||||||
{
|
{
|
||||||
SType = StructureType.DebugReportCallbackCreateInfoExt,
|
GraphicsDebugLevel.Error => DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityErrorBitExt,
|
||||||
Flags = flags,
|
GraphicsDebugLevel.Slowdowns => DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityErrorBitExt |
|
||||||
PfnCallback = new PfnDebugReportCallbackEXT(DebugReport)
|
DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityWarningBitExt,
|
||||||
|
GraphicsDebugLevel.All => DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityInfoBitExt |
|
||||||
|
DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityWarningBitExt |
|
||||||
|
DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityVerboseBitExt |
|
||||||
|
DebugUtilsMessageSeverityFlagsEXT.DebugUtilsMessageSeverityErrorBitExt,
|
||||||
|
_ => throw new ArgumentException($"Invalid log level \"{logLevel}\".")
|
||||||
};
|
};
|
||||||
|
|
||||||
debugReport.CreateDebugReportCallback(instance, in debugReportCallbackCreateInfo, null, out debugReportCallback).ThrowOnError();
|
var debugUtilsMessengerCreateInfo = new DebugUtilsMessengerCreateInfoEXT()
|
||||||
|
{
|
||||||
|
SType = StructureType.DebugUtilsMessengerCreateInfoExt,
|
||||||
|
MessageType = filterLogType,
|
||||||
|
MessageSeverity = filterLogSeverity,
|
||||||
|
PfnUserCallback = new PfnDebugUtilsMessengerCallbackEXT(DebugMessenger)
|
||||||
|
};
|
||||||
|
|
||||||
|
debugUtils.CreateDebugUtilsMessenger(instance, in debugUtilsMessengerCreateInfo, null, out debugUtilsMessenger).ThrowOnError();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
debugReportCallback = default;
|
debugUtilsMessenger = default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -33,7 +33,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
internal KhrPushDescriptor PushDescriptorApi { get; private set; }
|
internal KhrPushDescriptor PushDescriptorApi { get; private set; }
|
||||||
internal ExtTransformFeedback TransformFeedbackApi { get; private set; }
|
internal ExtTransformFeedback TransformFeedbackApi { get; private set; }
|
||||||
internal KhrDrawIndirectCount DrawIndirectCountApi { get; private set; }
|
internal KhrDrawIndirectCount DrawIndirectCountApi { get; private set; }
|
||||||
internal ExtDebugReport DebugReportApi { get; private set; }
|
internal ExtDebugUtils DebugUtilsApi { get; private set; }
|
||||||
|
|
||||||
internal uint QueueFamilyIndex { get; private set; }
|
internal uint QueueFamilyIndex { get; private set; }
|
||||||
internal Queue Queue { get; private set; }
|
internal Queue Queue { get; private set; }
|
||||||
@@ -57,7 +57,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
private SyncManager _syncManager;
|
private SyncManager _syncManager;
|
||||||
|
|
||||||
private PipelineFull _pipeline;
|
private PipelineFull _pipeline;
|
||||||
private DebugReportCallbackEXT _debugReportCallback;
|
private DebugUtilsMessengerEXT _debugUtilsMessenger;
|
||||||
|
|
||||||
internal HelperShader HelperShader { get; private set; }
|
internal HelperShader HelperShader { get; private set; }
|
||||||
internal PipelineFull PipelineInternal => _pipeline;
|
internal PipelineFull PipelineInternal => _pipeline;
|
||||||
@@ -237,9 +237,9 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
Api = api;
|
Api = api;
|
||||||
|
|
||||||
_instance = VulkanInitialization.CreateInstance(api, logLevel, _getRequiredExtensions(), out ExtDebugReport debugReport, out _debugReportCallback);
|
_instance = VulkanInitialization.CreateInstance(api, logLevel, _getRequiredExtensions(), out ExtDebugUtils debugUtils, out _debugUtilsMessenger);
|
||||||
|
|
||||||
DebugReportApi = debugReport;
|
DebugUtilsApi = debugUtils;
|
||||||
|
|
||||||
if (api.TryGetInstanceExtension(_instance, out KhrSurface surfaceApi))
|
if (api.TryGetInstanceExtension(_instance, out KhrSurface surfaceApi))
|
||||||
{
|
{
|
||||||
@@ -287,9 +287,9 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal ShaderCollection CreateProgramWithMinimalLayout(ShaderSource[] sources)
|
internal ShaderCollection CreateProgramWithMinimalLayout(ShaderSource[] sources, SpecDescription[] specDescription = null)
|
||||||
{
|
{
|
||||||
return new ShaderCollection(this, _device, sources, isMinimal: true);
|
return new ShaderCollection(this, _device, sources, specDescription: specDescription, isMinimal: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ISampler CreateSampler(GAL.SamplerCreateInfo info)
|
public ISampler CreateSampler(GAL.SamplerCreateInfo info)
|
||||||
@@ -584,9 +584,9 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
MemoryAllocator.Dispose();
|
MemoryAllocator.Dispose();
|
||||||
|
|
||||||
if (_debugReportCallback.Handle != 0)
|
if (_debugUtilsMessenger.Handle != 0)
|
||||||
{
|
{
|
||||||
DebugReportApi.DestroyDebugReportCallback(_instance, _debugReportCallback, null);
|
DebugUtilsApi.DestroyDebugUtilsMessenger(_instance, _debugUtilsMessenger, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var shader in Shaders)
|
foreach (var shader in Shaders)
|
||||||
|
199
Ryujinx.Memory/Tracking/BitMap.cs
Normal file
199
Ryujinx.Memory/Tracking/BitMap.cs
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
|
namespace Ryujinx.Memory.Tracking
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A bitmap that can check or set large ranges of true/false values at once.
|
||||||
|
/// </summary>
|
||||||
|
struct BitMap
|
||||||
|
{
|
||||||
|
public const int IntSize = 64;
|
||||||
|
|
||||||
|
private const int IntShift = 6;
|
||||||
|
private const int IntMask = IntSize - 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Masks representing the bitmap. Least significant bit first, 64-bits per mask.
|
||||||
|
/// </summary>
|
||||||
|
public readonly long[] Masks;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a new bitmap.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="count">The number of bits to reserve</param>
|
||||||
|
public BitMap(int count)
|
||||||
|
{
|
||||||
|
Masks = new long[(count + IntMask) / IntSize];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if any bit in the bitmap is set.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>True if any bits are set, false otherwise</returns>
|
||||||
|
public bool AnySet()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < Masks.Length; i++)
|
||||||
|
{
|
||||||
|
if (Masks[i] != 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if a bit in the bitmap is set.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bit">The bit index to check</param>
|
||||||
|
/// <returns>True if the bit is set, false otherwise</returns>
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
public bool IsSet(int bit)
|
||||||
|
{
|
||||||
|
int wordIndex = bit >> IntShift;
|
||||||
|
int wordBit = bit & IntMask;
|
||||||
|
|
||||||
|
long wordMask = 1L << wordBit;
|
||||||
|
|
||||||
|
return (Masks[wordIndex] & wordMask) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if any bit in a range of bits in the bitmap are set. (inclusive)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="start">The first bit index to check</param>
|
||||||
|
/// <param name="end">The last bit index to check</param>
|
||||||
|
/// <returns>True if a bit is set, false otherwise</returns>
|
||||||
|
public bool IsSet(int start, int end)
|
||||||
|
{
|
||||||
|
if (start == end)
|
||||||
|
{
|
||||||
|
return IsSet(start);
|
||||||
|
}
|
||||||
|
|
||||||
|
int startIndex = start >> IntShift;
|
||||||
|
int startBit = start & IntMask;
|
||||||
|
long startMask = -1L << startBit;
|
||||||
|
|
||||||
|
int endIndex = end >> IntShift;
|
||||||
|
int endBit = end & IntMask;
|
||||||
|
long endMask = (long)(ulong.MaxValue >> (IntMask - endBit));
|
||||||
|
|
||||||
|
if (startIndex == endIndex)
|
||||||
|
{
|
||||||
|
return (Masks[startIndex] & startMask & endMask) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((Masks[startIndex] & startMask) != 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = startIndex + 1; i < endIndex; i++)
|
||||||
|
{
|
||||||
|
if (Masks[i] != 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((Masks[endIndex] & endMask) != 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set a bit at a specific index to 1.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bit">The bit index to set</param>
|
||||||
|
/// <returns>True if the bit is set, false if it was already set</returns>
|
||||||
|
public bool Set(int bit)
|
||||||
|
{
|
||||||
|
int wordIndex = bit >> IntShift;
|
||||||
|
int wordBit = bit & IntMask;
|
||||||
|
|
||||||
|
long wordMask = 1L << wordBit;
|
||||||
|
|
||||||
|
if ((Masks[wordIndex] & wordMask) != 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Masks[wordIndex] |= wordMask;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set a range of bits in the bitmap to 1.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="start">The first bit index to set</param>
|
||||||
|
/// <param name="end">The last bit index to set</param>
|
||||||
|
public void SetRange(int start, int end)
|
||||||
|
{
|
||||||
|
if (start == end)
|
||||||
|
{
|
||||||
|
Set(start);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int startIndex = start >> IntShift;
|
||||||
|
int startBit = start & IntMask;
|
||||||
|
long startMask = -1L << startBit;
|
||||||
|
|
||||||
|
int endIndex = end >> IntShift;
|
||||||
|
int endBit = end & IntMask;
|
||||||
|
long endMask = (long)(ulong.MaxValue >> (IntMask - endBit));
|
||||||
|
|
||||||
|
if (startIndex == endIndex)
|
||||||
|
{
|
||||||
|
Masks[startIndex] |= startMask & endMask;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Masks[startIndex] |= startMask;
|
||||||
|
|
||||||
|
for (int i = startIndex + 1; i < endIndex; i++)
|
||||||
|
{
|
||||||
|
Masks[i] |= -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Masks[endIndex] |= endMask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clear a bit at a specific index to 0.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bit">The bit index to clear</param>
|
||||||
|
/// <returns>True if the bit was set, false if it was not</returns>
|
||||||
|
public bool Clear(int bit)
|
||||||
|
{
|
||||||
|
int wordIndex = bit >> IntShift;
|
||||||
|
int wordBit = bit & IntMask;
|
||||||
|
|
||||||
|
long wordMask = 1L << wordBit;
|
||||||
|
|
||||||
|
bool wasSet = (Masks[wordIndex] & wordMask) != 0;
|
||||||
|
|
||||||
|
Masks[wordIndex] &= ~wordMask;
|
||||||
|
|
||||||
|
return wasSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clear the bitmap entirely, setting all bits to 0.
|
||||||
|
/// </summary>
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < Masks.Length; i++)
|
||||||
|
{
|
||||||
|
Masks[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
161
Ryujinx.Memory/Tracking/ConcurrentBitmap.cs
Normal file
161
Ryujinx.Memory/Tracking/ConcurrentBitmap.cs
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace Ryujinx.Memory.Tracking
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A bitmap that can be safely modified from multiple threads.
|
||||||
|
/// </summary>
|
||||||
|
internal class ConcurrentBitmap
|
||||||
|
{
|
||||||
|
public const int IntSize = 64;
|
||||||
|
|
||||||
|
public const int IntShift = 6;
|
||||||
|
public const int IntMask = IntSize - 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Masks representing the bitmap. Least significant bit first, 64-bits per mask.
|
||||||
|
/// </summary>
|
||||||
|
public readonly long[] Masks;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a new multithreaded bitmap.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="count">The number of bits to reserve</param>
|
||||||
|
/// <param name="set">Whether the bits should be initially set or not</param>
|
||||||
|
public ConcurrentBitmap(int count, bool set)
|
||||||
|
{
|
||||||
|
Masks = new long[(count + IntMask) / IntSize];
|
||||||
|
|
||||||
|
if (set)
|
||||||
|
{
|
||||||
|
Array.Fill(Masks, -1L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if any bit in the bitmap is set.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>True if any bits are set, false otherwise</returns>
|
||||||
|
public bool AnySet()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < Masks.Length; i++)
|
||||||
|
{
|
||||||
|
if (Volatile.Read(ref Masks[i]) != 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if a bit in the bitmap is set.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bit">The bit index to check</param>
|
||||||
|
/// <returns>True if the bit is set, false otherwise</returns>
|
||||||
|
public bool IsSet(int bit)
|
||||||
|
{
|
||||||
|
int wordIndex = bit >> IntShift;
|
||||||
|
int wordBit = bit & IntMask;
|
||||||
|
|
||||||
|
long wordMask = 1L << wordBit;
|
||||||
|
|
||||||
|
return (Volatile.Read(ref Masks[wordIndex]) & wordMask) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if any bit in a range of bits in the bitmap are set. (inclusive)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="start">The first bit index to check</param>
|
||||||
|
/// <param name="end">The last bit index to check</param>
|
||||||
|
/// <returns>True if a bit is set, false otherwise</returns>
|
||||||
|
public bool IsSet(int start, int end)
|
||||||
|
{
|
||||||
|
if (start == end)
|
||||||
|
{
|
||||||
|
return IsSet(start);
|
||||||
|
}
|
||||||
|
|
||||||
|
int startIndex = start >> IntShift;
|
||||||
|
int startBit = start & IntMask;
|
||||||
|
long startMask = -1L << startBit;
|
||||||
|
|
||||||
|
int endIndex = end >> IntShift;
|
||||||
|
int endBit = end & IntMask;
|
||||||
|
long endMask = (long)(ulong.MaxValue >> (IntMask - endBit));
|
||||||
|
|
||||||
|
long startValue = Volatile.Read(ref Masks[startIndex]);
|
||||||
|
|
||||||
|
if (startIndex == endIndex)
|
||||||
|
{
|
||||||
|
return (startValue & startMask & endMask) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((startValue & startMask) != 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = startIndex + 1; i < endIndex; i++)
|
||||||
|
{
|
||||||
|
if (Volatile.Read(ref Masks[i]) != 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
long endValue = Volatile.Read(ref Masks[endIndex]);
|
||||||
|
|
||||||
|
if ((endValue & endMask) != 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set a bit at a specific index to either true or false.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bit">The bit index to set</param>
|
||||||
|
/// <param name="value">Whether the bit should be set or not</param>
|
||||||
|
public void Set(int bit, bool value)
|
||||||
|
{
|
||||||
|
int wordIndex = bit >> IntShift;
|
||||||
|
int wordBit = bit & IntMask;
|
||||||
|
|
||||||
|
long wordMask = 1L << wordBit;
|
||||||
|
|
||||||
|
long existing;
|
||||||
|
long newValue;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
existing = Volatile.Read(ref Masks[wordIndex]);
|
||||||
|
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
newValue = existing | wordMask;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newValue = existing & ~wordMask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (Interlocked.CompareExchange(ref Masks[wordIndex], newValue, existing) != existing);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clear the bitmap entirely, setting all bits to 0.
|
||||||
|
/// </summary>
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < Masks.Length; i++)
|
||||||
|
{
|
||||||
|
Volatile.Write(ref Masks[i], 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -176,6 +176,26 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Obtains a memory tracking handle for the given virtual region. This should be disposed when finished with.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="address">CPU virtual address of the region</param>
|
||||||
|
/// <param name="size">Size of the region</param>
|
||||||
|
/// <param name="bitmap">The bitmap owning the dirty flag for this handle</param>
|
||||||
|
/// <param name="bit">The bit of this handle within the dirty flag</param>
|
||||||
|
/// <returns>The memory tracking handle</returns>
|
||||||
|
internal RegionHandle BeginTrackingBitmap(ulong address, ulong size, ConcurrentBitmap bitmap, int bit)
|
||||||
|
{
|
||||||
|
(address, size) = PageAlign(address, size);
|
||||||
|
|
||||||
|
lock (TrackingLock)
|
||||||
|
{
|
||||||
|
RegionHandle handle = new RegionHandle(this, address, size, bitmap, bit, _memoryManager.IsRangeMapped(address, size));
|
||||||
|
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Signal that a virtual memory event happened at the given location (one byte).
|
/// Signal that a virtual memory event happened at the given location (one byte).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@@ -1,11 +1,15 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Numerics;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace Ryujinx.Memory.Tracking
|
namespace Ryujinx.Memory.Tracking
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A region handle that tracks a large region using many smaller handles, to provide
|
/// A region handle that tracks a large region using many smaller handles, to provide
|
||||||
/// granular tracking that can be used to track partial updates.
|
/// granular tracking that can be used to track partial updates. Backed by a bitmap
|
||||||
|
/// to improve performance when scanning large regions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class MultiRegionHandle : IMultiRegionHandle
|
public class MultiRegionHandle : IMultiRegionHandle
|
||||||
{
|
{
|
||||||
@@ -17,6 +21,12 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
private readonly ulong Granularity;
|
private readonly ulong Granularity;
|
||||||
private readonly ulong Size;
|
private readonly ulong Size;
|
||||||
|
|
||||||
|
private ConcurrentBitmap _dirtyBitmap;
|
||||||
|
|
||||||
|
private int _sequenceNumber;
|
||||||
|
private BitMap _sequenceNumberBitmap;
|
||||||
|
private int _uncheckedHandles;
|
||||||
|
|
||||||
public bool Dirty { get; private set; } = true;
|
public bool Dirty { get; private set; } = true;
|
||||||
|
|
||||||
internal MultiRegionHandle(MemoryTracking tracking, ulong address, ulong size, IEnumerable<IRegionHandle> handles, ulong granularity)
|
internal MultiRegionHandle(MemoryTracking tracking, ulong address, ulong size, IEnumerable<IRegionHandle> handles, ulong granularity)
|
||||||
@@ -24,6 +34,9 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
_handles = new RegionHandle[size / granularity];
|
_handles = new RegionHandle[size / granularity];
|
||||||
Granularity = granularity;
|
Granularity = granularity;
|
||||||
|
|
||||||
|
_dirtyBitmap = new ConcurrentBitmap(_handles.Length, true);
|
||||||
|
_sequenceNumberBitmap = new BitMap(_handles.Length);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
if (handles != null)
|
if (handles != null)
|
||||||
@@ -40,37 +53,43 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
// Fill any gap left before this handle.
|
// Fill any gap left before this handle.
|
||||||
while (i < startIndex)
|
while (i < startIndex)
|
||||||
{
|
{
|
||||||
RegionHandle fillHandle = tracking.BeginTracking(address + (ulong)i * granularity, granularity);
|
RegionHandle fillHandle = tracking.BeginTrackingBitmap(address + (ulong)i * granularity, granularity, _dirtyBitmap, i);
|
||||||
fillHandle.Parent = this;
|
fillHandle.Parent = this;
|
||||||
_handles[i++] = fillHandle;
|
_handles[i++] = fillHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handle.Size == granularity)
|
lock (tracking.TrackingLock)
|
||||||
{
|
{
|
||||||
handle.Parent = this;
|
if (handle is RegionHandle bitHandle && handle.Size == granularity)
|
||||||
_handles[i++] = handle;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int endIndex = (int)((handle.EndAddress - address) / granularity);
|
|
||||||
|
|
||||||
while (i < endIndex)
|
|
||||||
{
|
{
|
||||||
RegionHandle splitHandle = tracking.BeginTracking(address + (ulong)i * granularity, granularity);
|
handle.Parent = this;
|
||||||
splitHandle.Parent = this;
|
|
||||||
|
|
||||||
splitHandle.Reprotect(handle.Dirty);
|
bitHandle.ReplaceBitmap(_dirtyBitmap, i);
|
||||||
|
|
||||||
RegionSignal signal = handle.PreAction;
|
_handles[i++] = bitHandle;
|
||||||
if (signal != null)
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int endIndex = (int)((handle.EndAddress - address) / granularity);
|
||||||
|
|
||||||
|
while (i < endIndex)
|
||||||
{
|
{
|
||||||
splitHandle.RegisterAction(signal);
|
RegionHandle splitHandle = tracking.BeginTrackingBitmap(address + (ulong)i * granularity, granularity, _dirtyBitmap, i);
|
||||||
|
splitHandle.Parent = this;
|
||||||
|
|
||||||
|
splitHandle.Reprotect(handle.Dirty);
|
||||||
|
|
||||||
|
RegionSignal signal = handle.PreAction;
|
||||||
|
if (signal != null)
|
||||||
|
{
|
||||||
|
splitHandle.RegisterAction(signal);
|
||||||
|
}
|
||||||
|
|
||||||
|
_handles[i++] = splitHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
_handles[i++] = splitHandle;
|
handle.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
handle.Dispose();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,15 +97,27 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
// Fill any remaining space with new handles.
|
// Fill any remaining space with new handles.
|
||||||
while (i < _handles.Length)
|
while (i < _handles.Length)
|
||||||
{
|
{
|
||||||
RegionHandle handle = tracking.BeginTracking(address + (ulong)i * granularity, granularity);
|
RegionHandle handle = tracking.BeginTrackingBitmap(address + (ulong)i * granularity, granularity, _dirtyBitmap, i);
|
||||||
handle.Parent = this;
|
handle.Parent = this;
|
||||||
_handles[i++] = handle;
|
_handles[i++] = handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_uncheckedHandles = _handles.Length;
|
||||||
|
|
||||||
Address = address;
|
Address = address;
|
||||||
Size = size;
|
Size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SignalWrite()
|
||||||
|
{
|
||||||
|
Dirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<RegionHandle> GetHandles()
|
||||||
|
{
|
||||||
|
return _handles;
|
||||||
|
}
|
||||||
|
|
||||||
public void ForceDirty(ulong address, ulong size)
|
public void ForceDirty(ulong address, ulong size)
|
||||||
{
|
{
|
||||||
Dirty = true;
|
Dirty = true;
|
||||||
@@ -96,21 +127,15 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
|
|
||||||
for (int i = startHandle; i <= lastHandle; i++)
|
for (int i = startHandle; i <= lastHandle; i++)
|
||||||
{
|
{
|
||||||
_handles[i].SequenceNumber--;
|
if (_sequenceNumberBitmap.Clear(i))
|
||||||
|
{
|
||||||
|
_uncheckedHandles++;
|
||||||
|
}
|
||||||
|
|
||||||
_handles[i].ForceDirty();
|
_handles[i].ForceDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<RegionHandle> GetHandles()
|
|
||||||
{
|
|
||||||
return _handles;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SignalWrite()
|
|
||||||
{
|
|
||||||
Dirty = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void QueryModified(Action<ulong, ulong> modifiedAction)
|
public void QueryModified(Action<ulong, ulong> modifiedAction)
|
||||||
{
|
{
|
||||||
if (!Dirty)
|
if (!Dirty)
|
||||||
@@ -123,33 +148,95 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
QueryModified(Address, Size, modifiedAction);
|
QueryModified(Address, Size, modifiedAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void QueryModified(ulong address, ulong size, Action<ulong, ulong> modifiedAction)
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
private void ParseDirtyBits(long dirtyBits, ref int baseBit, ref int prevHandle, ref ulong rgStart, ref ulong rgSize, Action<ulong, ulong> modifiedAction)
|
||||||
{
|
{
|
||||||
int startHandle = (int)((address - Address) / Granularity);
|
while (dirtyBits != 0)
|
||||||
int lastHandle = (int)((address + (size - 1) - Address) / Granularity);
|
|
||||||
|
|
||||||
ulong rgStart = _handles[startHandle].Address;
|
|
||||||
ulong rgSize = 0;
|
|
||||||
|
|
||||||
for (int i = startHandle; i <= lastHandle; i++)
|
|
||||||
{
|
{
|
||||||
RegionHandle handle = _handles[i];
|
int bit = BitOperations.TrailingZeroCount(dirtyBits);
|
||||||
|
|
||||||
|
dirtyBits &= ~(1L << bit);
|
||||||
|
|
||||||
|
int handleIndex = baseBit + bit;
|
||||||
|
|
||||||
|
RegionHandle handle = _handles[handleIndex];
|
||||||
|
|
||||||
|
if (handleIndex != prevHandle + 1)
|
||||||
|
{
|
||||||
|
// Submit handles scanned until the gap as dirty
|
||||||
|
if (rgSize != 0)
|
||||||
|
{
|
||||||
|
modifiedAction(rgStart, rgSize);
|
||||||
|
rgSize = 0;
|
||||||
|
}
|
||||||
|
rgStart = handle.Address;
|
||||||
|
}
|
||||||
|
|
||||||
if (handle.Dirty)
|
if (handle.Dirty)
|
||||||
{
|
{
|
||||||
rgSize += handle.Size;
|
rgSize += handle.Size;
|
||||||
handle.Reprotect();
|
handle.Reprotect();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
prevHandle = handleIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
baseBit += ConcurrentBitmap.IntSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void QueryModified(ulong address, ulong size, Action<ulong, ulong> modifiedAction)
|
||||||
|
{
|
||||||
|
int startHandle = (int)((address - Address) / Granularity);
|
||||||
|
int lastHandle = (int)((address + (size - 1) - Address) / Granularity);
|
||||||
|
|
||||||
|
ulong rgStart = _handles[startHandle].Address;
|
||||||
|
|
||||||
|
if (startHandle == lastHandle)
|
||||||
|
{
|
||||||
|
RegionHandle handle = _handles[startHandle];
|
||||||
|
|
||||||
|
if (handle.Dirty)
|
||||||
{
|
{
|
||||||
// Submit the region scanned so far as dirty
|
handle.Reprotect();
|
||||||
if (rgSize != 0)
|
modifiedAction(rgStart, handle.Size);
|
||||||
{
|
|
||||||
modifiedAction(rgStart, rgSize);
|
|
||||||
rgSize = 0;
|
|
||||||
}
|
|
||||||
rgStart = handle.EndAddress;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ulong rgSize = 0;
|
||||||
|
|
||||||
|
long[] masks = _dirtyBitmap.Masks;
|
||||||
|
|
||||||
|
int startIndex = startHandle >> ConcurrentBitmap.IntShift;
|
||||||
|
int startBit = startHandle & ConcurrentBitmap.IntMask;
|
||||||
|
long startMask = -1L << startBit;
|
||||||
|
|
||||||
|
int endIndex = lastHandle >> ConcurrentBitmap.IntShift;
|
||||||
|
int endBit = lastHandle & ConcurrentBitmap.IntMask;
|
||||||
|
long endMask = (long)(ulong.MaxValue >> (ConcurrentBitmap.IntMask - endBit));
|
||||||
|
|
||||||
|
long startValue = Volatile.Read(ref masks[startIndex]);
|
||||||
|
|
||||||
|
int baseBit = startIndex << ConcurrentBitmap.IntShift;
|
||||||
|
int prevHandle = startHandle - 1;
|
||||||
|
|
||||||
|
if (startIndex == endIndex)
|
||||||
|
{
|
||||||
|
ParseDirtyBits(startValue & startMask & endMask, ref baseBit, ref prevHandle, ref rgStart, ref rgSize, modifiedAction);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ParseDirtyBits(startValue & startMask, ref baseBit, ref prevHandle, ref rgStart, ref rgSize, modifiedAction);
|
||||||
|
|
||||||
|
for (int i = startIndex + 1; i < endIndex; i++)
|
||||||
|
{
|
||||||
|
ParseDirtyBits(Volatile.Read(ref masks[i]), ref baseBit, ref prevHandle, ref rgStart, ref rgSize, modifiedAction);
|
||||||
|
}
|
||||||
|
|
||||||
|
long endValue = Volatile.Read(ref masks[endIndex]);
|
||||||
|
|
||||||
|
ParseDirtyBits(endValue & endMask, ref baseBit, ref prevHandle, ref rgStart, ref rgSize, modifiedAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rgSize != 0)
|
if (rgSize != 0)
|
||||||
@@ -158,35 +245,120 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void QueryModified(ulong address, ulong size, Action<ulong, ulong> modifiedAction, int sequenceNumber)
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
private void ParseDirtyBits(long dirtyBits, long mask, int index, long[] seqMasks, ref int baseBit, ref int prevHandle, ref ulong rgStart, ref ulong rgSize, Action<ulong, ulong> modifiedAction)
|
||||||
{
|
{
|
||||||
int startHandle = (int)((address - Address) / Granularity);
|
long seqMask = mask & ~seqMasks[index];
|
||||||
int lastHandle = (int)((address + (size - 1) - Address) / Granularity);
|
dirtyBits &= seqMask;
|
||||||
|
|
||||||
ulong rgStart = _handles[startHandle].Address;
|
while (dirtyBits != 0)
|
||||||
ulong rgSize = 0;
|
|
||||||
|
|
||||||
for (int i = startHandle; i <= lastHandle; i++)
|
|
||||||
{
|
{
|
||||||
RegionHandle handle = _handles[i];
|
int bit = BitOperations.TrailingZeroCount(dirtyBits);
|
||||||
|
|
||||||
if (sequenceNumber != handle.SequenceNumber && handle.DirtyOrVolatile())
|
dirtyBits &= ~(1L << bit);
|
||||||
|
|
||||||
|
int handleIndex = baseBit + bit;
|
||||||
|
|
||||||
|
RegionHandle handle = _handles[handleIndex];
|
||||||
|
|
||||||
|
if (handleIndex != prevHandle + 1)
|
||||||
{
|
{
|
||||||
rgSize += handle.Size;
|
// Submit handles scanned until the gap as dirty
|
||||||
handle.Reprotect();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Submit the region scanned so far as dirty
|
|
||||||
if (rgSize != 0)
|
if (rgSize != 0)
|
||||||
{
|
{
|
||||||
modifiedAction(rgStart, rgSize);
|
modifiedAction(rgStart, rgSize);
|
||||||
rgSize = 0;
|
rgSize = 0;
|
||||||
}
|
}
|
||||||
rgStart = handle.EndAddress;
|
rgStart = handle.Address;
|
||||||
}
|
}
|
||||||
|
|
||||||
handle.SequenceNumber = sequenceNumber;
|
rgSize += handle.Size;
|
||||||
|
handle.Reprotect();
|
||||||
|
|
||||||
|
prevHandle = handleIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
seqMasks[index] |= mask;
|
||||||
|
_uncheckedHandles -= BitOperations.PopCount((ulong)seqMask);
|
||||||
|
|
||||||
|
baseBit += ConcurrentBitmap.IntSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void QueryModified(ulong address, ulong size, Action<ulong, ulong> modifiedAction, int sequenceNumber)
|
||||||
|
{
|
||||||
|
int startHandle = (int)((address - Address) / Granularity);
|
||||||
|
int lastHandle = (int)((address + (size - 1) - Address) / Granularity);
|
||||||
|
|
||||||
|
ulong rgStart = Address + (ulong)startHandle * Granularity;
|
||||||
|
|
||||||
|
if (sequenceNumber != _sequenceNumber)
|
||||||
|
{
|
||||||
|
if (_uncheckedHandles != _handles.Length)
|
||||||
|
{
|
||||||
|
_sequenceNumberBitmap.Clear();
|
||||||
|
_uncheckedHandles = _handles.Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
_sequenceNumber = sequenceNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (startHandle == lastHandle)
|
||||||
|
{
|
||||||
|
var handle = _handles[startHandle];
|
||||||
|
if (_sequenceNumberBitmap.Set(startHandle))
|
||||||
|
{
|
||||||
|
_uncheckedHandles--;
|
||||||
|
|
||||||
|
if (handle.DirtyOrVolatile())
|
||||||
|
{
|
||||||
|
handle.Reprotect();
|
||||||
|
|
||||||
|
modifiedAction(rgStart, handle.Size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_uncheckedHandles == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ulong rgSize = 0;
|
||||||
|
|
||||||
|
long[] seqMasks = _sequenceNumberBitmap.Masks;
|
||||||
|
long[] masks = _dirtyBitmap.Masks;
|
||||||
|
|
||||||
|
int startIndex = startHandle >> ConcurrentBitmap.IntShift;
|
||||||
|
int startBit = startHandle & ConcurrentBitmap.IntMask;
|
||||||
|
long startMask = -1L << startBit;
|
||||||
|
|
||||||
|
int endIndex = lastHandle >> ConcurrentBitmap.IntShift;
|
||||||
|
int endBit = lastHandle & ConcurrentBitmap.IntMask;
|
||||||
|
long endMask = (long)(ulong.MaxValue >> (ConcurrentBitmap.IntMask - endBit));
|
||||||
|
|
||||||
|
long startValue = Volatile.Read(ref masks[startIndex]);
|
||||||
|
|
||||||
|
int baseBit = startIndex << ConcurrentBitmap.IntShift;
|
||||||
|
int prevHandle = startHandle - 1;
|
||||||
|
|
||||||
|
if (startIndex == endIndex)
|
||||||
|
{
|
||||||
|
ParseDirtyBits(startValue, startMask & endMask, startIndex, seqMasks, ref baseBit, ref prevHandle, ref rgStart, ref rgSize, modifiedAction);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ParseDirtyBits(startValue, startMask, startIndex, seqMasks, ref baseBit, ref prevHandle, ref rgStart, ref rgSize, modifiedAction);
|
||||||
|
|
||||||
|
for (int i = startIndex + 1; i < endIndex; i++)
|
||||||
|
{
|
||||||
|
ParseDirtyBits(Volatile.Read(ref masks[i]), -1L, i, seqMasks, ref baseBit, ref prevHandle, ref rgStart, ref rgSize, modifiedAction);
|
||||||
|
}
|
||||||
|
|
||||||
|
long endValue = Volatile.Read(ref masks[endIndex]);
|
||||||
|
|
||||||
|
ParseDirtyBits(endValue, endMask, endIndex, seqMasks, ref baseBit, ref prevHandle, ref rgStart, ref rgSize, modifiedAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rgSize != 0)
|
if (rgSize != 0)
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
using Ryujinx.Memory.Range;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
@@ -10,7 +9,7 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
/// A tracking handle for a given region of virtual memory. The Dirty flag is updated whenever any changes are made,
|
/// A tracking handle for a given region of virtual memory. The Dirty flag is updated whenever any changes are made,
|
||||||
/// and an action can be performed when the region is read to or written from.
|
/// and an action can be performed when the region is read to or written from.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class RegionHandle : IRegionHandle, IRange
|
public class RegionHandle : IRegionHandle
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// If more than this number of checks have been performed on a dirty flag since its last reprotect,
|
/// If more than this number of checks have been performed on a dirty flag since its last reprotect,
|
||||||
@@ -23,7 +22,20 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private static int VolatileThreshold = 5;
|
private static int VolatileThreshold = 5;
|
||||||
|
|
||||||
public bool Dirty { get; private set; }
|
public bool Dirty
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Bitmap.IsSet(DirtyBit);
|
||||||
|
}
|
||||||
|
protected set
|
||||||
|
{
|
||||||
|
Bitmap.Set(DirtyBit, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal int SequenceNumber { get; set; }
|
||||||
|
|
||||||
public bool Unmapped { get; private set; }
|
public bool Unmapped { get; private set; }
|
||||||
|
|
||||||
public ulong Address { get; }
|
public ulong Address { get; }
|
||||||
@@ -31,7 +43,6 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
public ulong EndAddress { get; }
|
public ulong EndAddress { get; }
|
||||||
|
|
||||||
internal IMultiRegionHandle Parent { get; set; }
|
internal IMultiRegionHandle Parent { get; set; }
|
||||||
internal int SequenceNumber { get; set; }
|
|
||||||
|
|
||||||
private event Action _onDirty;
|
private event Action _onDirty;
|
||||||
|
|
||||||
@@ -68,17 +79,26 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
|
|
||||||
internal RegionSignal PreAction => _preAction;
|
internal RegionSignal PreAction => _preAction;
|
||||||
|
|
||||||
|
internal ConcurrentBitmap Bitmap;
|
||||||
|
internal int DirtyBit;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new region handle. The handle is registered with the given tracking object,
|
/// Create a new bitmap backed region handle. The handle is registered with the given tracking object,
|
||||||
/// and will be notified of any changes to the specified region.
|
/// and will be notified of any changes to the specified region.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="tracking">Tracking object for the target memory block</param>
|
/// <param name="tracking">Tracking object for the target memory block</param>
|
||||||
/// <param name="address">Virtual address of the region to track</param>
|
/// <param name="address">Virtual address of the region to track</param>
|
||||||
/// <param name="size">Size of the region to track</param>
|
/// <param name="size">Size of the region to track</param>
|
||||||
|
/// <param name="bitmap">The bitmap the dirty flag for this handle is stored in</param>
|
||||||
|
/// <param name="bit">The bit index representing the dirty flag for this handle</param>
|
||||||
/// <param name="mapped">True if the region handle starts mapped</param>
|
/// <param name="mapped">True if the region handle starts mapped</param>
|
||||||
internal RegionHandle(MemoryTracking tracking, ulong address, ulong size, bool mapped = true)
|
internal RegionHandle(MemoryTracking tracking, ulong address, ulong size, ConcurrentBitmap bitmap, int bit, bool mapped = true)
|
||||||
{
|
{
|
||||||
|
Bitmap = bitmap;
|
||||||
|
DirtyBit = bit;
|
||||||
|
|
||||||
Dirty = mapped;
|
Dirty = mapped;
|
||||||
|
|
||||||
Unmapped = !mapped;
|
Unmapped = !mapped;
|
||||||
Address = address;
|
Address = address;
|
||||||
Size = size;
|
Size = size;
|
||||||
@@ -92,6 +112,54 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a new region handle. The handle is registered with the given tracking object,
|
||||||
|
/// and will be notified of any changes to the specified region.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tracking">Tracking object for the target memory block</param>
|
||||||
|
/// <param name="address">Virtual address of the region to track</param>
|
||||||
|
/// <param name="size">Size of the region to track</param>
|
||||||
|
/// <param name="mapped">True if the region handle starts mapped</param>
|
||||||
|
internal RegionHandle(MemoryTracking tracking, ulong address, ulong size, bool mapped = true)
|
||||||
|
{
|
||||||
|
Bitmap = new ConcurrentBitmap(1, mapped);
|
||||||
|
|
||||||
|
Unmapped = !mapped;
|
||||||
|
Address = address;
|
||||||
|
Size = size;
|
||||||
|
EndAddress = address + size;
|
||||||
|
|
||||||
|
_tracking = tracking;
|
||||||
|
_regions = tracking.GetVirtualRegionsForHandle(address, size);
|
||||||
|
foreach (var region in _regions)
|
||||||
|
{
|
||||||
|
region.Handles.Add(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replace the bitmap and bit index used to track dirty state.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// The tracking lock should be held when this is called, to ensure neither bitmap is modified.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="bitmap">The bitmap the dirty flag for this handle is stored in</param>
|
||||||
|
/// <param name="bit">The bit index representing the dirty flag for this handle</param>
|
||||||
|
internal void ReplaceBitmap(ConcurrentBitmap bitmap, int bit)
|
||||||
|
{
|
||||||
|
// Assumes the tracking lock is held, so nothing else can signal right now.
|
||||||
|
|
||||||
|
var oldBitmap = Bitmap;
|
||||||
|
var oldBit = DirtyBit;
|
||||||
|
|
||||||
|
bitmap.Set(bit, Dirty);
|
||||||
|
|
||||||
|
Bitmap = bitmap;
|
||||||
|
DirtyBit = bit;
|
||||||
|
|
||||||
|
Dirty |= oldBitmap.IsSet(oldBit);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clear the volatile state of this handle.
|
/// Clear the volatile state of this handle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -108,7 +176,7 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
public bool DirtyOrVolatile()
|
public bool DirtyOrVolatile()
|
||||||
{
|
{
|
||||||
_checkCount++;
|
_checkCount++;
|
||||||
return Dirty || _volatile;
|
return _volatile || Dirty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -195,6 +263,8 @@ namespace Ryujinx.Memory.Tracking
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void ForceDirty()
|
public void ForceDirty()
|
||||||
{
|
{
|
||||||
|
_checkCount++;
|
||||||
|
|
||||||
Dirty = true;
|
Dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user