mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-04-27 13:35:12 -06:00
Move getting the effective res into SetUniformParameters
This commit is contained in:
parent
c98a0c3ae5
commit
6074e90497
@ -570,13 +570,10 @@ void OpenGLRenderer::DrawBackbufferQuad(LatteTextureView* texView, RendererOutpu
|
||||
g_renderer->ClearColorbuffer(padView);
|
||||
}
|
||||
|
||||
sint32 effectiveWidth, effectiveHeight;
|
||||
texView->baseTexture->GetEffectiveSize(effectiveWidth, effectiveHeight, 0);
|
||||
|
||||
shader_unbind(RendererShader::ShaderType::kGeometry);
|
||||
shader_bind(shader->GetVertexShader());
|
||||
shader_bind(shader->GetFragmentShader());
|
||||
shader->SetUniformParameters(*texView, { effectiveWidth, effectiveHeight }, { imageWidth, imageHeight });
|
||||
shader->SetUniformParameters(*texView, {imageWidth, imageHeight});
|
||||
|
||||
// set viewport
|
||||
glViewportIndexedf(0, imageX, imageY, imageWidth, imageHeight);
|
||||
|
||||
@ -142,14 +142,16 @@ RendererOutputShader::RendererOutputShader(const std::string& vertex_source, con
|
||||
}
|
||||
}
|
||||
|
||||
void RendererOutputShader::SetUniformParameters(const LatteTextureView& texture_view, const Vector2i& input_res, const Vector2i& output_res) const
|
||||
void RendererOutputShader::SetUniformParameters(const LatteTextureView& texture_view, const Vector2i& output_res) const
|
||||
{
|
||||
sint32 effectiveWidth, effectiveHeight;
|
||||
texture_view.baseTexture->GetEffectiveSize(effectiveWidth, effectiveHeight, 0);
|
||||
auto setUniforms = [&](RendererShader* shader, const UniformLocations& attributes){
|
||||
float res[2];
|
||||
if (attributes.m_loc_textureSrcResolution != -1)
|
||||
{
|
||||
res[0] = (float)input_res.x;
|
||||
res[1] = (float)input_res.y;
|
||||
res[0] = (float)effectiveWidth;
|
||||
res[1] = (float)effectiveHeight;
|
||||
shader->SetUniform2fv(attributes.m_loc_textureSrcResolution, res, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ public:
|
||||
RendererOutputShader(const std::string& vertex_source, const std::string& fragment_source);
|
||||
virtual ~RendererOutputShader() = default;
|
||||
|
||||
void SetUniformParameters(const LatteTextureView& texture_view, const Vector2i& input_res, const Vector2i& output_res) const;
|
||||
void SetUniformParameters(const LatteTextureView& texture_view, const Vector2i& output_res) const;
|
||||
|
||||
RendererShader* GetVertexShader() const
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user