Simplify logic for bindless texture handling (#1667)

* Simplify logic for bindless texture handling

* Nits
This commit is contained in:
gdkchan 2020-11-09 19:35:04 -03:00 committed by GitHub
parent eda6b78894
commit 934a78005e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 131 additions and 191 deletions

View file

@ -5,46 +5,21 @@ namespace Ryujinx.Graphics.Shader
public int Binding { get; }
public SamplerType Type { get; }
public TextureFormat Format { get; }
public int CbufSlot { get; }
public int HandleIndex { get; }
public bool IsBindless { get; }
public int CbufSlot { get; }
public int CbufOffset { get; }
public TextureUsageFlags Flags { get; set; }
public TextureDescriptor(int binding, SamplerType type, TextureFormat format, int handleIndex)
public TextureDescriptor(int binding, SamplerType type, TextureFormat format, int cbufSlot, int handleIndex)
{
Binding = binding;
Type = type;
Format = format;
CbufSlot = cbufSlot;
HandleIndex = handleIndex;
IsBindless = false;
CbufSlot = 0;
CbufOffset = 0;
Flags = TextureUsageFlags.None;
}
public TextureDescriptor(int binding, SamplerType type, int cbufSlot, int cbufOffset)
{
Binding = binding;
Type = type;
Format = TextureFormat.Unknown;
HandleIndex = 0;
IsBindless = true;
CbufSlot = cbufSlot;
CbufOffset = cbufOffset;
Flags = TextureUsageFlags.None;
Flags = TextureUsageFlags.None;
}
public TextureDescriptor SetFlag(TextureUsageFlags flag)