Minor improvement to Vulkan pipeline state and bindings management (#3829)
* Minor improvement to Vulkan pipeline state and bindings management * Clean up buffer textures too * Use glBindTextureUnit
This commit is contained in:
parent
c6d05301aa
commit
a6a67a2b7a
6 changed files with 103 additions and 124 deletions
|
@ -708,11 +708,12 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool dataMatches = _currentData != null && data.SequenceEqual(_currentData);
|
bool dataMatches = _currentData != null && data.SequenceEqual(_currentData);
|
||||||
_currentData = data.ToArray();
|
|
||||||
if (dataMatches)
|
if (dataMatches)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_currentData = data.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,5 +34,11 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
||||||
GL.ActiveTexture(TextureUnit.Texture0 + unit);
|
GL.ActiveTexture(TextureUnit.Texture0 + unit);
|
||||||
GL.BindTexture(target, Handle);
|
GL.BindTexture(target, Handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void ClearBinding(int unit)
|
||||||
|
{
|
||||||
|
GL.ActiveTexture(TextureUnit.Texture0 + unit);
|
||||||
|
GL.BindTextureUnit(unit, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -919,6 +919,7 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
|
|
||||||
if (texture == null)
|
if (texture == null)
|
||||||
{
|
{
|
||||||
|
GL.BindImageTexture(binding, 0, 0, true, 0, TextureAccess.ReadWrite, SizedInternalFormat.Rgba8);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1275,6 +1276,10 @@ namespace Ryujinx.Graphics.OpenGL
|
||||||
((TextureBase)texture).Bind(binding);
|
((TextureBase)texture).Bind(binding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TextureBase.ClearBinding(binding);
|
||||||
|
}
|
||||||
|
|
||||||
Sampler glSampler = (Sampler)sampler;
|
Sampler glSampler = (Sampler)sampler;
|
||||||
|
|
||||||
|
|
|
@ -138,11 +138,6 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
public void SetImage(int binding, ITexture image, GAL.Format imageFormat)
|
public void SetImage(int binding, ITexture image, GAL.Format imageFormat)
|
||||||
{
|
{
|
||||||
if (image == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (image is TextureBuffer imageBuffer)
|
if (image is TextureBuffer imageBuffer)
|
||||||
{
|
{
|
||||||
_bufferImageRefs[binding] = imageBuffer;
|
_bufferImageRefs[binding] = imageBuffer;
|
||||||
|
@ -152,6 +147,12 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
_imageRefs[binding] = view.GetView(imageFormat).GetIdentityImageView();
|
_imageRefs[binding] = view.GetView(imageFormat).GetIdentityImageView();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_imageRefs[binding] = null;
|
||||||
|
_bufferImageRefs[binding] = null;
|
||||||
|
_bufferImageFormats[binding] = default;
|
||||||
|
}
|
||||||
|
|
||||||
SignalDirty(DirtyFlags.Image);
|
SignalDirty(DirtyFlags.Image);
|
||||||
}
|
}
|
||||||
|
@ -215,24 +216,23 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
public void SetTextureAndSampler(CommandBufferScoped cbs, ShaderStage stage, int binding, ITexture texture, ISampler sampler)
|
public void SetTextureAndSampler(CommandBufferScoped cbs, ShaderStage stage, int binding, ITexture texture, ISampler sampler)
|
||||||
{
|
{
|
||||||
if (texture == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (texture is TextureBuffer textureBuffer)
|
if (texture is TextureBuffer textureBuffer)
|
||||||
{
|
{
|
||||||
_bufferTextureRefs[binding] = textureBuffer;
|
_bufferTextureRefs[binding] = textureBuffer;
|
||||||
}
|
}
|
||||||
else
|
else if (texture is TextureView view)
|
||||||
{
|
{
|
||||||
TextureView view = (TextureView)texture;
|
|
||||||
|
|
||||||
view.Storage.InsertBarrier(cbs, AccessFlags.AccessShaderReadBit, stage.ConvertToPipelineStageFlags());
|
view.Storage.InsertBarrier(cbs, AccessFlags.AccessShaderReadBit, stage.ConvertToPipelineStageFlags());
|
||||||
|
|
||||||
_textureRefs[binding] = view.GetImageView();
|
_textureRefs[binding] = view.GetImageView();
|
||||||
_samplerRefs[binding] = ((SamplerHolder)sampler)?.GetSampler();
|
_samplerRefs[binding] = ((SamplerHolder)sampler)?.GetSampler();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_textureRefs[binding] = null;
|
||||||
|
_samplerRefs[binding] = null;
|
||||||
|
_bufferTextureRefs[binding] = null;
|
||||||
|
}
|
||||||
|
|
||||||
SignalDirty(DirtyFlags.Texture);
|
SignalDirty(DirtyFlags.Texture);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,232 +81,208 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
set => Internal.Id5 = (Internal.Id5 & 0xFFFFFFFF) | ((ulong)(uint)BitConverter.SingleToInt32Bits(value) << 32);
|
set => Internal.Id5 = (Internal.Id5 & 0xFFFFFFFF) | ((ulong)(uint)BitConverter.SingleToInt32Bits(value) << 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float BlendConstantR
|
|
||||||
{
|
|
||||||
get => BitConverter.Int32BitsToSingle((int)((Internal.Id6 >> 0) & 0xFFFFFFFF));
|
|
||||||
set => Internal.Id6 = (Internal.Id6 & 0xFFFFFFFF00000000) | ((ulong)(uint)BitConverter.SingleToInt32Bits(value) << 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public float BlendConstantG
|
|
||||||
{
|
|
||||||
get => BitConverter.Int32BitsToSingle((int)((Internal.Id6 >> 32) & 0xFFFFFFFF));
|
|
||||||
set => Internal.Id6 = (Internal.Id6 & 0xFFFFFFFF) | ((ulong)(uint)BitConverter.SingleToInt32Bits(value) << 32);
|
|
||||||
}
|
|
||||||
|
|
||||||
public float BlendConstantB
|
|
||||||
{
|
|
||||||
get => BitConverter.Int32BitsToSingle((int)((Internal.Id7 >> 0) & 0xFFFFFFFF));
|
|
||||||
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFF00000000) | ((ulong)(uint)BitConverter.SingleToInt32Bits(value) << 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public float BlendConstantA
|
|
||||||
{
|
|
||||||
get => BitConverter.Int32BitsToSingle((int)((Internal.Id7 >> 32) & 0xFFFFFFFF));
|
|
||||||
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFF) | ((ulong)(uint)BitConverter.SingleToInt32Bits(value) << 32);
|
|
||||||
}
|
|
||||||
|
|
||||||
public PolygonMode PolygonMode
|
public PolygonMode PolygonMode
|
||||||
{
|
{
|
||||||
get => (PolygonMode)((Internal.Id8 >> 0) & 0x3FFFFFFF);
|
get => (PolygonMode)((Internal.Id6 >> 0) & 0x3FFFFFFF);
|
||||||
set => Internal.Id8 = (Internal.Id8 & 0xFFFFFFFFC0000000) | ((ulong)value << 0);
|
set => Internal.Id6 = (Internal.Id6 & 0xFFFFFFFFC0000000) | ((ulong)value << 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint StagesCount
|
public uint StagesCount
|
||||||
{
|
{
|
||||||
get => (byte)((Internal.Id8 >> 30) & 0xFF);
|
get => (byte)((Internal.Id6 >> 30) & 0xFF);
|
||||||
set => Internal.Id8 = (Internal.Id8 & 0xFFFFFFC03FFFFFFF) | ((ulong)value << 30);
|
set => Internal.Id6 = (Internal.Id6 & 0xFFFFFFC03FFFFFFF) | ((ulong)value << 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint VertexAttributeDescriptionsCount
|
public uint VertexAttributeDescriptionsCount
|
||||||
{
|
{
|
||||||
get => (byte)((Internal.Id8 >> 38) & 0xFF);
|
get => (byte)((Internal.Id6 >> 38) & 0xFF);
|
||||||
set => Internal.Id8 = (Internal.Id8 & 0xFFFFC03FFFFFFFFF) | ((ulong)value << 38);
|
set => Internal.Id6 = (Internal.Id6 & 0xFFFFC03FFFFFFFFF) | ((ulong)value << 38);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint VertexBindingDescriptionsCount
|
public uint VertexBindingDescriptionsCount
|
||||||
{
|
{
|
||||||
get => (byte)((Internal.Id8 >> 46) & 0xFF);
|
get => (byte)((Internal.Id6 >> 46) & 0xFF);
|
||||||
set => Internal.Id8 = (Internal.Id8 & 0xFFC03FFFFFFFFFFF) | ((ulong)value << 46);
|
set => Internal.Id6 = (Internal.Id6 & 0xFFC03FFFFFFFFFFF) | ((ulong)value << 46);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint ViewportsCount
|
public uint ViewportsCount
|
||||||
{
|
{
|
||||||
get => (byte)((Internal.Id8 >> 54) & 0xFF);
|
get => (byte)((Internal.Id6 >> 54) & 0xFF);
|
||||||
set => Internal.Id8 = (Internal.Id8 & 0xC03FFFFFFFFFFFFF) | ((ulong)value << 54);
|
set => Internal.Id6 = (Internal.Id6 & 0xC03FFFFFFFFFFFFF) | ((ulong)value << 54);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint ScissorsCount
|
public uint ScissorsCount
|
||||||
{
|
{
|
||||||
get => (byte)((Internal.Id9 >> 0) & 0xFF);
|
get => (byte)((Internal.Id7 >> 0) & 0xFF);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFFFFFFF00) | ((ulong)value << 0);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFFFFFFFF00) | ((ulong)value << 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint ColorBlendAttachmentStateCount
|
public uint ColorBlendAttachmentStateCount
|
||||||
{
|
{
|
||||||
get => (byte)((Internal.Id9 >> 8) & 0xFF);
|
get => (byte)((Internal.Id7 >> 8) & 0xFF);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFFFFF00FF) | ((ulong)value << 8);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFFFFFF00FF) | ((ulong)value << 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PrimitiveTopology Topology
|
public PrimitiveTopology Topology
|
||||||
{
|
{
|
||||||
get => (PrimitiveTopology)((Internal.Id9 >> 16) & 0xF);
|
get => (PrimitiveTopology)((Internal.Id7 >> 16) & 0xF);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFFFF0FFFF) | ((ulong)value << 16);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFFFFF0FFFF) | ((ulong)value << 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LogicOp LogicOp
|
public LogicOp LogicOp
|
||||||
{
|
{
|
||||||
get => (LogicOp)((Internal.Id9 >> 20) & 0xF);
|
get => (LogicOp)((Internal.Id7 >> 20) & 0xF);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFFF0FFFFF) | ((ulong)value << 20);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFFFF0FFFFF) | ((ulong)value << 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompareOp DepthCompareOp
|
public CompareOp DepthCompareOp
|
||||||
{
|
{
|
||||||
get => (CompareOp)((Internal.Id9 >> 24) & 0x7);
|
get => (CompareOp)((Internal.Id7 >> 24) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFF8FFFFFF) | ((ulong)value << 24);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFFF8FFFFFF) | ((ulong)value << 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StencilOp StencilFrontFailOp
|
public StencilOp StencilFrontFailOp
|
||||||
{
|
{
|
||||||
get => (StencilOp)((Internal.Id9 >> 27) & 0x7);
|
get => (StencilOp)((Internal.Id7 >> 27) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFC7FFFFFF) | ((ulong)value << 27);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFFC7FFFFFF) | ((ulong)value << 27);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StencilOp StencilFrontPassOp
|
public StencilOp StencilFrontPassOp
|
||||||
{
|
{
|
||||||
get => (StencilOp)((Internal.Id9 >> 30) & 0x7);
|
get => (StencilOp)((Internal.Id7 >> 30) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFE3FFFFFFF) | ((ulong)value << 30);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFE3FFFFFFF) | ((ulong)value << 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StencilOp StencilFrontDepthFailOp
|
public StencilOp StencilFrontDepthFailOp
|
||||||
{
|
{
|
||||||
get => (StencilOp)((Internal.Id9 >> 33) & 0x7);
|
get => (StencilOp)((Internal.Id7 >> 33) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFF1FFFFFFFF) | ((ulong)value << 33);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFF1FFFFFFFF) | ((ulong)value << 33);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompareOp StencilFrontCompareOp
|
public CompareOp StencilFrontCompareOp
|
||||||
{
|
{
|
||||||
get => (CompareOp)((Internal.Id9 >> 36) & 0x7);
|
get => (CompareOp)((Internal.Id7 >> 36) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFF8FFFFFFFFF) | ((ulong)value << 36);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFF8FFFFFFFFF) | ((ulong)value << 36);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StencilOp StencilBackFailOp
|
public StencilOp StencilBackFailOp
|
||||||
{
|
{
|
||||||
get => (StencilOp)((Internal.Id9 >> 39) & 0x7);
|
get => (StencilOp)((Internal.Id7 >> 39) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFC7FFFFFFFFF) | ((ulong)value << 39);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFFC7FFFFFFFFF) | ((ulong)value << 39);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StencilOp StencilBackPassOp
|
public StencilOp StencilBackPassOp
|
||||||
{
|
{
|
||||||
get => (StencilOp)((Internal.Id9 >> 42) & 0x7);
|
get => (StencilOp)((Internal.Id7 >> 42) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFFE3FFFFFFFFFF) | ((ulong)value << 42);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFFE3FFFFFFFFFF) | ((ulong)value << 42);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StencilOp StencilBackDepthFailOp
|
public StencilOp StencilBackDepthFailOp
|
||||||
{
|
{
|
||||||
get => (StencilOp)((Internal.Id9 >> 45) & 0x7);
|
get => (StencilOp)((Internal.Id7 >> 45) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFFF1FFFFFFFFFFF) | ((ulong)value << 45);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFFF1FFFFFFFFFFF) | ((ulong)value << 45);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompareOp StencilBackCompareOp
|
public CompareOp StencilBackCompareOp
|
||||||
{
|
{
|
||||||
get => (CompareOp)((Internal.Id9 >> 48) & 0x7);
|
get => (CompareOp)((Internal.Id7 >> 48) & 0x7);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFF8FFFFFFFFFFFF) | ((ulong)value << 48);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFF8FFFFFFFFFFFF) | ((ulong)value << 48);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CullModeFlags CullMode
|
public CullModeFlags CullMode
|
||||||
{
|
{
|
||||||
get => (CullModeFlags)((Internal.Id9 >> 51) & 0x3);
|
get => (CullModeFlags)((Internal.Id7 >> 51) & 0x3);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFE7FFFFFFFFFFFF) | ((ulong)value << 51);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFE7FFFFFFFFFFFF) | ((ulong)value << 51);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool PrimitiveRestartEnable
|
public bool PrimitiveRestartEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 53) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 53) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFDFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 53);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFDFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 53);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DepthClampEnable
|
public bool DepthClampEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 54) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 54) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFFBFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 54);
|
set => Internal.Id7 = (Internal.Id7 & 0xFFBFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 54);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RasterizerDiscardEnable
|
public bool RasterizerDiscardEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 55) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 55) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFF7FFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 55);
|
set => Internal.Id7 = (Internal.Id7 & 0xFF7FFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 55);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FrontFace FrontFace
|
public FrontFace FrontFace
|
||||||
{
|
{
|
||||||
get => (FrontFace)((Internal.Id9 >> 56) & 0x1);
|
get => (FrontFace)((Internal.Id7 >> 56) & 0x1);
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFEFFFFFFFFFFFFFF) | ((ulong)value << 56);
|
set => Internal.Id7 = (Internal.Id7 & 0xFEFFFFFFFFFFFFFF) | ((ulong)value << 56);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DepthBiasEnable
|
public bool DepthBiasEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 57) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 57) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFDFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 57);
|
set => Internal.Id7 = (Internal.Id7 & 0xFDFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 57);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DepthTestEnable
|
public bool DepthTestEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 58) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 58) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xFBFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 58);
|
set => Internal.Id7 = (Internal.Id7 & 0xFBFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 58);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DepthWriteEnable
|
public bool DepthWriteEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 59) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 59) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xF7FFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 59);
|
set => Internal.Id7 = (Internal.Id7 & 0xF7FFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 59);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DepthBoundsTestEnable
|
public bool DepthBoundsTestEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 60) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 60) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xEFFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 60);
|
set => Internal.Id7 = (Internal.Id7 & 0xEFFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool StencilTestEnable
|
public bool StencilTestEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 61) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 61) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xDFFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 61);
|
set => Internal.Id7 = (Internal.Id7 & 0xDFFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 61);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool LogicOpEnable
|
public bool LogicOpEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 62) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 62) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0xBFFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 62);
|
set => Internal.Id7 = (Internal.Id7 & 0xBFFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 62);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool HasDepthStencil
|
public bool HasDepthStencil
|
||||||
{
|
{
|
||||||
get => ((Internal.Id9 >> 63) & 0x1) != 0UL;
|
get => ((Internal.Id7 >> 63) & 0x1) != 0UL;
|
||||||
set => Internal.Id9 = (Internal.Id9 & 0x7FFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 63);
|
set => Internal.Id7 = (Internal.Id7 & 0x7FFFFFFFFFFFFFFF) | ((value ? 1UL : 0UL) << 63);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint PatchControlPoints
|
public uint PatchControlPoints
|
||||||
{
|
{
|
||||||
get => (uint)((Internal.Id10 >> 0) & 0xFFFFFFFF);
|
get => (uint)((Internal.Id8 >> 0) & 0xFFFFFFFF);
|
||||||
set => Internal.Id10 = (Internal.Id10 & 0xFFFFFFFF00000000) | ((ulong)value << 0);
|
set => Internal.Id8 = (Internal.Id8 & 0xFFFFFFFF00000000) | ((ulong)value << 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint SamplesCount
|
public uint SamplesCount
|
||||||
{
|
{
|
||||||
get => (uint)((Internal.Id10 >> 32) & 0xFFFFFFFF);
|
get => (uint)((Internal.Id8 >> 32) & 0xFFFFFFFF);
|
||||||
set => Internal.Id10 = (Internal.Id10 & 0xFFFFFFFF) | ((ulong)value << 32);
|
set => Internal.Id8 = (Internal.Id8 & 0xFFFFFFFF) | ((ulong)value << 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AlphaToCoverageEnable
|
public bool AlphaToCoverageEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id11 >> 0) & 0x1) != 0UL;
|
get => ((Internal.Id9 >> 0) & 0x1) != 0UL;
|
||||||
set => Internal.Id11 = (Internal.Id11 & 0xFFFFFFFFFFFFFFFE) | ((value ? 1UL : 0UL) << 0);
|
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFFFFFFFFE) | ((value ? 1UL : 0UL) << 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AlphaToOneEnable
|
public bool AlphaToOneEnable
|
||||||
{
|
{
|
||||||
get => ((Internal.Id11 >> 1) & 0x1) != 0UL;
|
get => ((Internal.Id9 >> 1) & 0x1) != 0UL;
|
||||||
set => Internal.Id11 = (Internal.Id11 & 0xFFFFFFFFFFFFFFFD) | ((value ? 1UL : 0UL) << 1);
|
set => Internal.Id9 = (Internal.Id9 & 0xFFFFFFFFFFFFFFFD) | ((value ? 1UL : 0UL) << 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public NativeArray<PipelineShaderStageCreateInfo> Stages;
|
public NativeArray<PipelineShaderStageCreateInfo> Stages;
|
||||||
|
@ -356,7 +332,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
Pipeline pipelineHandle = default;
|
Pipeline pipelineHandle = default;
|
||||||
|
|
||||||
bool hasSpec = program.SpecDescriptions != null;
|
bool hasSpec = program.SpecDescriptions != null;
|
||||||
|
|
||||||
var desc = hasSpec ? program.SpecDescriptions[0] : SpecDescription.Empty;
|
var desc = hasSpec ? program.SpecDescriptions[0] : SpecDescription.Empty;
|
||||||
|
|
||||||
if (hasSpec && SpecializationData.Length < (int)desc.Info.DataSize)
|
if (hasSpec && SpecializationData.Length < (int)desc.Info.DataSize)
|
||||||
|
@ -510,11 +486,6 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
PAttachments = pColorBlendAttachmentState
|
PAttachments = pColorBlendAttachmentState
|
||||||
};
|
};
|
||||||
|
|
||||||
colorBlendState.BlendConstants[0] = BlendConstantR;
|
|
||||||
colorBlendState.BlendConstants[1] = BlendConstantG;
|
|
||||||
colorBlendState.BlendConstants[2] = BlendConstantB;
|
|
||||||
colorBlendState.BlendConstants[3] = BlendConstantA;
|
|
||||||
|
|
||||||
bool supportsExtDynamicState = gd.Capabilities.SupportsExtendedDynamicState;
|
bool supportsExtDynamicState = gd.Capabilities.SupportsExtendedDynamicState;
|
||||||
int dynamicStatesCount = supportsExtDynamicState ? 9 : 8;
|
int dynamicStatesCount = supportsExtDynamicState ? 9 : 8;
|
||||||
|
|
||||||
|
|
|
@ -21,15 +21,13 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
|
|
||||||
public ulong Id8;
|
public ulong Id8;
|
||||||
public ulong Id9;
|
public ulong Id9;
|
||||||
public ulong Id10;
|
|
||||||
public ulong Id11;
|
|
||||||
|
|
||||||
private uint VertexAttributeDescriptionsCount => (byte)((Id8 >> 38) & 0xFF);
|
private uint VertexAttributeDescriptionsCount => (byte)((Id6 >> 38) & 0xFF);
|
||||||
private uint VertexBindingDescriptionsCount => (byte)((Id8 >> 46) & 0xFF);
|
private uint VertexBindingDescriptionsCount => (byte)((Id6 >> 46) & 0xFF);
|
||||||
private uint ViewportsCount => (byte)((Id8 >> 54) & 0xFF);
|
private uint ViewportsCount => (byte)((Id6 >> 54) & 0xFF);
|
||||||
private uint ScissorsCount => (byte)((Id9 >> 0) & 0xFF);
|
private uint ScissorsCount => (byte)((Id7 >> 0) & 0xFF);
|
||||||
private uint ColorBlendAttachmentStateCount => (byte)((Id9 >> 8) & 0xFF);
|
private uint ColorBlendAttachmentStateCount => (byte)((Id7 >> 8) & 0xFF);
|
||||||
private bool HasDepthStencil => ((Id9 >> 63) & 0x1) != 0UL;
|
private bool HasDepthStencil => ((Id7 >> 63) & 0x1) != 0UL;
|
||||||
|
|
||||||
public Array32<VertexInputAttributeDescription> VertexAttributeDescriptions;
|
public Array32<VertexInputAttributeDescription> VertexAttributeDescriptions;
|
||||||
public Array33<VertexInputBindingDescription> VertexBindingDescriptions;
|
public Array33<VertexInputBindingDescription> VertexBindingDescriptions;
|
||||||
|
@ -47,7 +45,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
{
|
{
|
||||||
if (!Unsafe.As<ulong, Vector256<byte>>(ref Id0).Equals(Unsafe.As<ulong, Vector256<byte>>(ref other.Id0)) ||
|
if (!Unsafe.As<ulong, Vector256<byte>>(ref Id0).Equals(Unsafe.As<ulong, Vector256<byte>>(ref other.Id0)) ||
|
||||||
!Unsafe.As<ulong, Vector256<byte>>(ref Id4).Equals(Unsafe.As<ulong, Vector256<byte>>(ref other.Id4)) ||
|
!Unsafe.As<ulong, Vector256<byte>>(ref Id4).Equals(Unsafe.As<ulong, Vector256<byte>>(ref other.Id4)) ||
|
||||||
!Unsafe.As<ulong, Vector256<byte>>(ref Id8).Equals(Unsafe.As<ulong, Vector256<byte>>(ref other.Id8)))
|
!Unsafe.As<ulong, Vector128<byte>>(ref Id8).Equals(Unsafe.As<ulong, Vector128<byte>>(ref other.Id8)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -91,9 +89,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
Id6 * 23 ^
|
Id6 * 23 ^
|
||||||
Id7 * 23 ^
|
Id7 * 23 ^
|
||||||
Id8 * 23 ^
|
Id8 * 23 ^
|
||||||
Id9 * 23 ^
|
Id9 * 23;
|
||||||
Id10 * 23 ^
|
|
||||||
Id11 * 23;
|
|
||||||
|
|
||||||
for (int i = 0; i < (int)VertexAttributeDescriptionsCount; i++)
|
for (int i = 0; i < (int)VertexAttributeDescriptionsCount; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue