mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-05 22:56:26 +02:00
Add support for bindless textures from shader input (vertex buffer) on Vulkan (#6577)
* Add support for bindless textures from shader input (vertex buffer) * Shader cache version bump * Format whitespace * Remove cache entries on pool removal, disable for OpenGL * PR feedback
This commit is contained in:
parent
9b94662b4b
commit
c6f8bfed90
39 changed files with 1091 additions and 311 deletions
|
@ -185,11 +185,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
|||
{
|
||||
if (texture.ArrayLength > 1)
|
||||
{
|
||||
bool isBuffer = (texture.Type & SamplerType.Mask) == SamplerType.TextureBuffer;
|
||||
|
||||
ResourceType type = isBuffer
|
||||
? (isImage ? ResourceType.BufferImage : ResourceType.BufferTexture)
|
||||
: (isImage ? ResourceType.Image : ResourceType.TextureAndSampler);
|
||||
ResourceType type = GetTextureResourceType(texture, isImage);
|
||||
|
||||
_resourceDescriptors[setIndex].Add(new ResourceDescriptor(texture.Binding, texture.ArrayLength, type, stages));
|
||||
}
|
||||
|
@ -242,16 +238,38 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
|||
{
|
||||
foreach (TextureDescriptor texture in textures)
|
||||
{
|
||||
bool isBuffer = (texture.Type & SamplerType.Mask) == SamplerType.TextureBuffer;
|
||||
|
||||
ResourceType type = isBuffer
|
||||
? (isImage ? ResourceType.BufferImage : ResourceType.BufferTexture)
|
||||
: (isImage ? ResourceType.Image : ResourceType.TextureAndSampler);
|
||||
ResourceType type = GetTextureResourceType(texture, isImage);
|
||||
|
||||
_resourceUsages[setIndex].Add(new ResourceUsage(texture.Binding, texture.ArrayLength, type, stages));
|
||||
}
|
||||
}
|
||||
|
||||
private static ResourceType GetTextureResourceType(TextureDescriptor texture, bool isImage)
|
||||
{
|
||||
bool isBuffer = (texture.Type & SamplerType.Mask) == SamplerType.TextureBuffer;
|
||||
|
||||
if (isBuffer)
|
||||
{
|
||||
return isImage ? ResourceType.BufferImage : ResourceType.BufferTexture;
|
||||
}
|
||||
else if (isImage)
|
||||
{
|
||||
return ResourceType.Image;
|
||||
}
|
||||
else if (texture.Type == SamplerType.None)
|
||||
{
|
||||
return ResourceType.Sampler;
|
||||
}
|
||||
else if (texture.Separate)
|
||||
{
|
||||
return ResourceType.Texture;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ResourceType.TextureAndSampler;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new shader information structure from the added information.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue