Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
af1906ea04 | ||
|
68848000f7 | ||
|
d98da47a0f | ||
|
306f7e93a0 | ||
|
8954ff3af2 |
@@ -32,10 +32,10 @@
|
|||||||
<ListBox.ItemsPanel>
|
<ListBox.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<flex:FlexPanel
|
<flex:FlexPanel
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
AlignContent="FlexStart"
|
AlignContent="FlexStart"
|
||||||
JustifyContent="Center" />
|
JustifyContent="FlexStart" />
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ListBox.ItemsPanel>
|
</ListBox.ItemsPanel>
|
||||||
<ListBox.Styles>
|
<ListBox.Styles>
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
|
using Ryujinx.Common.Logging;
|
||||||
using System;
|
using System;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
@@ -18,12 +19,14 @@ namespace Ryujinx.Common.Utilities
|
|||||||
public override TEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
public override TEnum Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||||
{
|
{
|
||||||
var enumValue = reader.GetString();
|
var enumValue = reader.GetString();
|
||||||
if (string.IsNullOrEmpty(enumValue))
|
|
||||||
|
if (Enum.TryParse(enumValue, out TEnum value))
|
||||||
{
|
{
|
||||||
return default;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Enum.Parse<TEnum>(enumValue);
|
Logger.Warning?.Print(LogClass.Configuration, $"Failed to parse enum value \"{enumValue}\" for {typeof(TEnum)}, using default \"{default(TEnum)}\"");
|
||||||
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Write(Utf8JsonWriter writer, TEnum value, JsonSerializerOptions options)
|
public override void Write(Utf8JsonWriter writer, TEnum value, JsonSerializerOptions options)
|
||||||
|
@@ -151,8 +151,6 @@ namespace Ryujinx.Graphics.Gpu.Engine.Compute
|
|||||||
|
|
||||||
ShaderProgramInfo info = cs.Shaders[0].Info;
|
ShaderProgramInfo info = cs.Shaders[0].Info;
|
||||||
|
|
||||||
bool hasUnaligned = _channel.BufferManager.HasUnalignedStorageBuffers;
|
|
||||||
|
|
||||||
for (int index = 0; index < info.SBuffers.Count; index++)
|
for (int index = 0; index < info.SBuffers.Count; index++)
|
||||||
{
|
{
|
||||||
BufferDescriptor sb = info.SBuffers[index];
|
BufferDescriptor sb = info.SBuffers[index];
|
||||||
@@ -177,9 +175,17 @@ namespace Ryujinx.Graphics.Gpu.Engine.Compute
|
|||||||
_channel.BufferManager.SetComputeStorageBuffer(sb.Slot, sbDescriptor.PackAddress(), size, sb.Flags);
|
_channel.BufferManager.SetComputeStorageBuffer(sb.Slot, sbDescriptor.PackAddress(), size, sb.Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_channel.BufferManager.HasUnalignedStorageBuffers) != hasUnaligned)
|
if (_channel.BufferManager.HasUnalignedStorageBuffers != computeState.HasUnalignedStorageBuffer)
|
||||||
{
|
{
|
||||||
// Refetch the shader, as assumptions about storage buffer alignment have changed.
|
// Refetch the shader, as assumptions about storage buffer alignment have changed.
|
||||||
|
computeState = new GpuChannelComputeState(
|
||||||
|
qmd.CtaThreadDimension0,
|
||||||
|
qmd.CtaThreadDimension1,
|
||||||
|
qmd.CtaThreadDimension2,
|
||||||
|
localMemorySize,
|
||||||
|
sharedMemorySize,
|
||||||
|
_channel.BufferManager.HasUnalignedStorageBuffers);
|
||||||
|
|
||||||
cs = memoryManager.Physical.ShaderCache.GetComputeShader(_channel, poolState, computeState, shaderGpuVa);
|
cs = memoryManager.Physical.ShaderCache.GetComputeShader(_channel, poolState, computeState, shaderGpuVa);
|
||||||
|
|
||||||
_context.Renderer.Pipeline.SetProgram(cs.HostProgram);
|
_context.Renderer.Pipeline.SetProgram(cs.HostProgram);
|
||||||
|
@@ -90,6 +90,7 @@ namespace Ryujinx.Graphics.Texture
|
|||||||
|
|
||||||
mipOffsets[level] = layerSize;
|
mipOffsets[level] = layerSize;
|
||||||
sliceSizes[level] = totalBlocksOfGobsInY * robSize;
|
sliceSizes[level] = totalBlocksOfGobsInY * robSize;
|
||||||
|
levelSizes[level] = totalBlocksOfGobsInZ * sliceSizes[level];
|
||||||
|
|
||||||
if (is3D)
|
if (is3D)
|
||||||
{
|
{
|
||||||
@@ -116,11 +117,14 @@ namespace Ryujinx.Graphics.Texture
|
|||||||
// The slice only covers up to the end of this slice's depth, rather than the full aligned size.
|
// The slice only covers up to the end of this slice's depth, rather than the full aligned size.
|
||||||
// Avoids size being too large on partial views of 3d textures.
|
// Avoids size being too large on partial views of 3d textures.
|
||||||
|
|
||||||
sliceSizes[level] -= gobSize * (mipGobBlocksInZ - gobRemainderZ);
|
levelSizes[level] -= gobSize * (mipGobBlocksInZ - gobRemainderZ);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
levelSizes[level] = totalBlocksOfGobsInZ * sliceSizes[level];
|
if (sliceSizes[level] > levelSizes[level])
|
||||||
|
{
|
||||||
|
sliceSizes[level] = levelSizes[level];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
layerSize += levelSizes[level];
|
layerSize += levelSizes[level];
|
||||||
|
|
||||||
|
@@ -1,47 +1,14 @@
|
|||||||
using System;
|
using Ryujinx.Common.Memory;
|
||||||
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrlGpu.Types
|
namespace Ryujinx.HLE.HOS.Services.Nv.NvDrvServices.NvHostCtrlGpu.Types
|
||||||
{
|
{
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
struct ZbcColorArray
|
|
||||||
{
|
|
||||||
private uint element0;
|
|
||||||
private uint element1;
|
|
||||||
private uint element2;
|
|
||||||
private uint element3;
|
|
||||||
|
|
||||||
public uint this[int index]
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (index == 0)
|
|
||||||
{
|
|
||||||
return element0;
|
|
||||||
}
|
|
||||||
else if (index == 1)
|
|
||||||
{
|
|
||||||
return element1;
|
|
||||||
}
|
|
||||||
else if (index == 2)
|
|
||||||
{
|
|
||||||
return element2;
|
|
||||||
}
|
|
||||||
else if (index == 2)
|
|
||||||
{
|
|
||||||
return element3;
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new IndexOutOfRangeException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
struct ZbcSetTableArguments
|
struct ZbcSetTableArguments
|
||||||
{
|
{
|
||||||
public ZbcColorArray ColorDs;
|
public Array4<uint> ColorDs;
|
||||||
public ZbcColorArray ColorL2;
|
public Array4<uint> ColorL2;
|
||||||
public uint Depth;
|
public uint Depth;
|
||||||
public uint Format;
|
public uint Format;
|
||||||
public uint Type;
|
public uint Type;
|
||||||
|
Reference in New Issue
Block a user