Bind TextureBuffers

This commit is contained in:
Isaac Marovitz 2024-07-27 11:32:45 +01:00 committed by Isaac Marovitz
parent 62602e58b7
commit 3214a4cf8e
2 changed files with 65 additions and 83 deletions

View file

@ -54,10 +54,10 @@ namespace Ryujinx.Graphics.Metal
record struct TextureRef record struct TextureRef
{ {
public ShaderStage Stage; public ShaderStage Stage;
public Texture Storage; public TextureBase Storage;
public Sampler Sampler; public Sampler Sampler;
public TextureRef(ShaderStage stage, Texture storage, Sampler sampler) public TextureRef(ShaderStage stage, TextureBase storage, Sampler sampler)
{ {
Stage = stage; Stage = stage;
Storage = storage; Storage = storage;

View file

@ -805,13 +805,9 @@ namespace Ryujinx.Graphics.Metal
public readonly void UpdateTextureAndSampler(ShaderStage stage, ulong binding, TextureBase texture, Sampler sampler) public readonly void UpdateTextureAndSampler(ShaderStage stage, ulong binding, TextureBase texture, Sampler sampler)
{ {
if (texture is TextureBuffer) if (texture != null)
{ {
// TODO: Texture buffers _currentState.TextureRefs[binding] = new(stage, texture, sampler);
}
else if (texture is Texture view)
{
_currentState.TextureRefs[binding] = new(stage, view, sampler);
} }
else else
{ {
@ -1123,8 +1119,6 @@ namespace Ryujinx.Graphics.Metal
break; break;
case MetalRenderer.TextureSetIndex: case MetalRenderer.TextureSetIndex:
if (!segment.IsArray) if (!segment.IsArray)
{
if (segment.Type != ResourceType.BufferTexture)
{ {
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
@ -1175,11 +1169,6 @@ namespace Ryujinx.Graphics.Metal
} }
} }
else else
{
// TODO: Buffer textures
}
}
else
{ {
// TODO: Texture arrays // TODO: Texture arrays
} }
@ -1342,8 +1331,6 @@ namespace Ryujinx.Graphics.Metal
break; break;
case MetalRenderer.TextureSetIndex: case MetalRenderer.TextureSetIndex:
if (!segment.IsArray) if (!segment.IsArray)
{
if (segment.Type != ResourceType.BufferTexture)
{ {
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
@ -1375,11 +1362,6 @@ namespace Ryujinx.Graphics.Metal
} }
} }
else else
{
// TODO: Buffer textures
}
}
else
{ {
// TODO: Texture arrays // TODO: Texture arrays
} }