Browse Source

push new

lizzie/sgsr
lizzie 4 weeks ago
parent
commit
5abc178341
  1. 28
      .patch/snapdragon_gsr/0001-fix-glsl.patch
  2. 3
      src/video_core/renderer_vulkan/present/sgsr.cpp

28
.patch/snapdragon_gsr/0001-fix-glsl.patch

@ -1,15 +1,14 @@
diff --git a/sgsr/v1/include/glsl/sgsr1_shader_mobile.frag b/sgsr/v1/include/glsl/sgsr1_shader_mobile.frag
index 7074999..2d322fb 100644
index 7074999..4f76e1a 100644
--- a/sgsr/v1/include/glsl/sgsr1_shader_mobile.frag
+++ b/sgsr/v1/include/glsl/sgsr1_shader_mobile.frag
@@ -1,4 +1,5 @@
@@ -1,4 +1,4 @@
-#version 300 es
+#version 310 es
+#extension GL_EXT_spec_constant_composites:require
+#version 460 core
//============================================================================================================
//
@@ -34,11 +35,10 @@ precision highp int;
@@ -34,11 +34,10 @@ precision highp int;
////////////////////////
#if defined(UseUniformBlock)
@ -20,11 +19,11 @@ index 7074999..2d322fb 100644
+ highp vec4 ViewportInfo[1];
};
-layout(set = 0, binding = 1) uniform mediump sampler2D ps0;
+layout(set = 0, binding = 0) uniform mediump sampler2D ps0;
+layout(set = 0, binding = 0) uniform sampler2D ps0;
#else
uniform highp vec4 ViewportInfo[1];
uniform mediump sampler2D ps0;
@@ -63,9 +63,9 @@ vec2 weightY(float dx, float dy,float c, float std)
@@ -63,9 +62,9 @@ vec2 weightY(float dx, float dy,float c, float std)
void main()
{
@ -37,7 +36,7 @@ index 7074999..2d322fb 100644
vec4 color;
if(mode == 1)
@@ -93,10 +93,13 @@ void main()
@@ -93,10 +92,13 @@ void main()
{
coord.x += ViewportInfo[0].x;
@ -55,17 +54,16 @@ index 7074999..2d322fb 100644
float mean = (left.y+left.z+right.x+right.w)*0.25;
left = left - vec4(mean);
diff --git a/sgsr/v1/include/glsl/sgsr1_shader_mobile_edge_direction.frag b/sgsr/v1/include/glsl/sgsr1_shader_mobile_edge_direction.frag
index d2df646..875cdbf 100644
index d2df646..116c572 100644
--- a/sgsr/v1/include/glsl/sgsr1_shader_mobile_edge_direction.frag
+++ b/sgsr/v1/include/glsl/sgsr1_shader_mobile_edge_direction.frag
@@ -1,4 +1,5 @@
@@ -1,4 +1,4 @@
-#version 300 es
+#version 310 es
+#extension GL_EXT_spec_constant_composites:require
+#version 460 core
//============================================================================================================
//
@@ -40,11 +41,10 @@ precision highp int;
@@ -40,11 +40,10 @@ precision highp int;
////////////////////////
#if defined(UseUniformBlock)
@ -76,11 +74,11 @@ index d2df646..875cdbf 100644
+ highp vec4 ViewportInfo[1];
};
-layout(set = 0, binding = 1) uniform mediump sampler2D ps0;
+layout(set = 0, binding = 0) uniform mediump sampler2D ps0;
+layout(set = 0, binding = 0) uniform sampler2D ps0;
#else
uniform highp vec4 ViewportInfo[1];
uniform mediump sampler2D ps0;
@@ -124,10 +124,13 @@ void main()
@@ -124,10 +123,13 @@ void main()
{
coord.x += ViewportInfo[0].x;

3
src/video_core/renderer_vulkan/present/sgsr.cpp

@ -17,7 +17,7 @@
namespace Vulkan {
using PushConstants = std::array<u32, 4 * 4>;
using PushConstants = std::array<u32, 4>;
SGSR::SGSR(const Device& device, MemoryAllocator& memory_allocator, size_t image_count, VkExtent2D extent)
: m_device{device}, m_memory_allocator{memory_allocator}
@ -65,7 +65,6 @@ SGSR::SGSR(const Device& device, MemoryAllocator& memory_allocator, size_t image
.pPushConstantRanges = &range,
};
m_pipeline_layout = m_device.GetLogical().CreatePipelineLayout(ci);
m_stage_pipeline[0] = CreateWrappedPipeline(m_device, m_renderpass, m_pipeline_layout, std::tie(m_vert_shader, m_stage_shader[0]));
m_stage_pipeline[1] = CreateWrappedPipeline(m_device, m_renderpass, m_pipeline_layout, std::tie(m_vert_shader, m_stage_shader[1]));
}

Loading…
Cancel
Save