Change SMAA filter texture clear method (#4685)

* Change SMAA filter texture clear method

* Alpha should be 1

* Delete more unnecessary code
This commit is contained in:
gdkchan
2023-04-16 14:26:22 -03:00
committed by GitHub
parent 69b6ef7a4a
commit 3e68a87d63
3 changed files with 19 additions and 89 deletions

View File

@ -118,20 +118,6 @@ namespace Ryujinx.Graphics.Vulkan.Effects
_intermediaryTexture = _renderer.CreateTexture(info, view.ScaleFactor) as TextureView;
}
Span<GAL.Viewport> viewports = stackalloc GAL.Viewport[1];
Span<Rectangle<int>> scissors = stackalloc Rectangle<int>[1];
viewports[0] = new GAL.Viewport(
new Rectangle<float>(0, 0, view.Width, view.Height),
ViewportSwizzle.PositiveX,
ViewportSwizzle.PositiveY,
ViewportSwizzle.PositiveZ,
ViewportSwizzle.PositiveW,
0f,
1f);
scissors[0] = new Rectangle<int>(0, 0, view.Width, view.Height);
_pipeline.SetCommandBuffer(cbs);
_pipeline.SetProgram(_scalingProgram);
_pipeline.SetTextureAndSampler(ShaderStage.Compute, 1, view, _sampler);
@ -169,23 +155,10 @@ namespace Ryujinx.Graphics.Vulkan.Effects
var bufferRanges = new BufferRange(bufferHandle, 0, rangeSize);
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(2, bufferRanges) });
_pipeline.SetScissors(scissors);
_pipeline.SetViewports(viewports, false);
_pipeline.SetImage(0, _intermediaryTexture, GAL.Format.R8G8B8A8Unorm);
_pipeline.DispatchCompute(dispatchX, dispatchY, 1);
_pipeline.ComputeBarrier();
viewports[0] = new GAL.Viewport(
new Rectangle<float>(0, 0, width, height),
ViewportSwizzle.PositiveX,
ViewportSwizzle.PositiveY,
ViewportSwizzle.PositiveZ,
ViewportSwizzle.PositiveW,
0f,
1f);
scissors[0] = new Rectangle<int>(0, 0, width, height);
// Sharpening pass
_pipeline.SetCommandBuffer(cbs);
_pipeline.SetProgram(_sharpeningProgram);
@ -193,8 +166,6 @@ namespace Ryujinx.Graphics.Vulkan.Effects
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(2, bufferRanges) });
var sharpeningRange = new BufferRange(sharpeningBufferHandle, 0, sizeof(float));
_pipeline.SetUniformBuffers(stackalloc[] { new BufferAssignment(4, sharpeningRange) });
_pipeline.SetScissors(scissors);
_pipeline.SetViewports(viewports, false);
_pipeline.SetImage(0, destinationTexture);
_pipeline.DispatchCompute(dispatchX, dispatchY, 1);
_pipeline.ComputeBarrier();