1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 06:52:56 +08:00

Merge pull request #23374 from EVAST9919/ruleset-shaders-test

Add missing ruleset shader tests
This commit is contained in:
Dean Herbert 2023-05-02 19:52:09 +09:00 committed by GitHub
commit 2aaa52e904
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 30 deletions

View File

@ -1,11 +1,14 @@
#include "sh_Utils.h"
#define HIGH_PRECISION_VERTEX
varying mediump vec2 v_TexCoord;
varying mediump vec4 v_TexRect;
#include "sh_Utils.h"
#include "sh_Masking.h"
layout(location = 2) in highp vec2 v_TexCoord;
layout(location = 0) out vec4 o_Colour;
void main(void)
{
float hueValue = v_TexCoord.x / (v_TexRect[2] - v_TexRect[0]);
gl_FragColor = hsv2rgb(vec4(hueValue, 1, 1, 1));
highp float hueValue = v_TexCoord.x / (v_TexRect[2] - v_TexRect[0]);
o_Colour = getRoundedColor(hsv2rgb(vec4(hueValue, 1, 1, 1)), v_TexCoord);
}

View File

@ -1,19 +1,14 @@
#include "sh_Utils.h"
layout(location = 0) in highp vec2 m_Position;
layout(location = 1) in lowp vec4 m_Colour;
layout(location = 2) in highp vec2 m_TexCoord;
layout(location = 3) in highp vec4 m_TexRect;
layout(location = 4) in mediump vec2 m_BlendRange;
attribute highp vec2 m_Position;
attribute lowp vec4 m_Colour;
attribute mediump vec2 m_TexCoord;
attribute mediump vec4 m_TexRect;
attribute mediump vec2 m_BlendRange;
varying highp vec2 v_MaskingPosition;
varying lowp vec4 v_Colour;
varying mediump vec2 v_TexCoord;
varying mediump vec4 v_TexRect;
varying mediump vec2 v_BlendRange;
uniform highp mat4 g_ProjMatrix;
uniform highp mat3 g_ToMaskingSpace;
layout(location = 0) out highp vec2 v_MaskingPosition;
layout(location = 1) out lowp vec4 v_Colour;
layout(location = 2) out highp vec2 v_TexCoord;
layout(location = 3) out highp vec4 v_TexRect;
layout(location = 4) out mediump vec2 v_BlendRange;
void main(void)
{
@ -26,6 +21,5 @@ void main(void)
v_TexRect = m_TexRect;
v_BlendRange = m_BlendRange;
gl_Position = gProjMatrix * vec4(m_Position, 1.0, 1.0);
gl_Position = g_ProjMatrix * vec4(m_Position, 1.0, 1.0);
}

View File

@ -53,6 +53,8 @@ namespace osu.Game.Tests.Testing
{
Dependencies.Get<ShaderManager>().GetRawData(@"sh_TestVertex.vs");
Dependencies.Get<ShaderManager>().GetRawData(@"sh_TestFragment.fs");
Dependencies.Get<ShaderManager>().Load(@"TestVertex", @"TestFragment");
Dependencies.Get<ShaderManager>().Load(VertexShaderDescriptor.TEXTURE_2, @"TestFragment");
});
}