1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 09:23:06 +08:00

Update UBO usages inline with framework changes

This commit is contained in:
Salman Ahmed 2023-03-16 14:06:35 +03:00
parent 15c44a2817
commit 678e8ed736
6 changed files with 14 additions and 13 deletions

View File

@ -252,13 +252,14 @@ namespace osu.Game.Rulesets.Osu.Skinning
renderer.SetBlend(BlendingParameters.Additive);
renderer.PushLocalMatrix(DrawInfo.Matrix);
TextureShader.Bind();
BindTextureShader(renderer);
texture.Bind();
for (int i = 0; i < points.Count; i++)
drawPointQuad(points[i], textureRect, i + firstVisiblePointIndex);
TextureShader.Unbind();
UnbindTextureShader(renderer);
renderer.PopLocalMatrix();
}

View File

@ -100,8 +100,10 @@ namespace osu.Game.Tests.Visual.Background
private IUniformBuffer<TriangleBorderData>? borderDataBuffer;
public override void Draw(IRenderer renderer)
protected override void BindUniformResources(IShader shader, IRenderer renderer)
{
base.BindUniformResources(shader, renderer);
borderDataBuffer ??= renderer.CreateUniformBuffer<TriangleBorderData>();
borderDataBuffer.Data = borderDataBuffer.Data with
{
@ -109,9 +111,7 @@ namespace osu.Game.Tests.Visual.Background
TexelSize = texelSize
};
TextureShader.BindUniformBlock("m_BorderData", borderDataBuffer);
base.Draw(renderer);
shader.BindUniformBlock("m_BorderData", borderDataBuffer);
}
protected override bool CanDrawOpaqueInterior => false;

View File

@ -306,7 +306,7 @@ namespace osu.Game.Graphics.Backgrounds
};
shader.Bind();
shader.BindUniformBlock("m_BorderData", borderDataBuffer);
shader.BindUniformBlock(@"m_BorderData", borderDataBuffer);
foreach (TriangleParticle particle in parts)
{

View File

@ -249,7 +249,7 @@ namespace osu.Game.Graphics.Backgrounds
};
shader.Bind();
shader.BindUniformBlock("m_BorderData", borderDataBuffer);
shader.BindUniformBlock(@"m_BorderData", borderDataBuffer);
Vector2 relativeSize = Vector2.Divide(triangleSize, size);

View File

@ -59,14 +59,14 @@ namespace osu.Game.Graphics.Sprites
private IUniformBuffer<AnimationData> animationDataBuffer;
protected override void Blit(IRenderer renderer)
protected override void BindUniformResources(IShader shader, IRenderer renderer)
{
base.BindUniformResources(shader, renderer);
animationDataBuffer ??= renderer.CreateUniformBuffer<AnimationData>();
animationDataBuffer.Data = animationDataBuffer.Data with { Progress = progress };
TextureShader.BindUniformBlock("m_AnimationData", animationDataBuffer);
base.Blit(renderer);
shader.BindUniformBlock(@"m_AnimationData", animationDataBuffer);
}
protected override bool CanDrawOpaqueInterior => false;

View File

@ -273,7 +273,7 @@ namespace osu.Game.Rulesets.Mods
};
shader.Bind();
shader.BindUniformBlock("m_FlashlightParameters", flashlightParametersBuffer);
shader.BindUniformBlock(@"m_FlashlightParameters", flashlightParametersBuffer);
renderer.DrawQuad(renderer.WhitePixel, screenSpaceDrawQuad, DrawColourInfo.Colour, vertexAction: addAction);