Merge pull request #9742 from Pokechu22/sw-resolution
Software: Fix bad backbuffer size
This commit is contained in:
commit
46120a6108
|
@ -27,7 +27,8 @@
|
||||||
namespace SW
|
namespace SW
|
||||||
{
|
{
|
||||||
SWRenderer::SWRenderer(std::unique_ptr<SWOGLWindow> window)
|
SWRenderer::SWRenderer(std::unique_ptr<SWOGLWindow> window)
|
||||||
: ::Renderer(static_cast<int>(MAX_XFB_WIDTH), static_cast<int>(MAX_XFB_HEIGHT), 1.0f,
|
: ::Renderer(static_cast<int>(std::max(window->GetContext()->GetBackBufferWidth(), 1u)),
|
||||||
|
static_cast<int>(std::max(window->GetContext()->GetBackBufferHeight(), 1u)), 1.0f,
|
||||||
AbstractTextureFormat::RGBA8),
|
AbstractTextureFormat::RGBA8),
|
||||||
m_window(std::move(window))
|
m_window(std::move(window))
|
||||||
{
|
{
|
||||||
|
@ -56,6 +57,18 @@ SWRenderer::CreateFramebuffer(AbstractTexture* color_attachment, AbstractTexture
|
||||||
static_cast<SWTexture*>(depth_attachment));
|
static_cast<SWTexture*>(depth_attachment));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SWRenderer::BindBackbuffer(const ClearColor& clear_color)
|
||||||
|
{
|
||||||
|
// Look for framebuffer resizes
|
||||||
|
if (!m_surface_resized.TestAndClear())
|
||||||
|
return;
|
||||||
|
|
||||||
|
GLContext* context = m_window->GetContext();
|
||||||
|
context->Update();
|
||||||
|
m_backbuffer_width = context->GetBackBufferWidth();
|
||||||
|
m_backbuffer_height = context->GetBackBufferHeight();
|
||||||
|
}
|
||||||
|
|
||||||
class SWShader final : public AbstractShader
|
class SWShader final : public AbstractShader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -27,6 +27,8 @@ public:
|
||||||
std::unique_ptr<AbstractFramebuffer>
|
std::unique_ptr<AbstractFramebuffer>
|
||||||
CreateFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment) override;
|
CreateFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment) override;
|
||||||
|
|
||||||
|
void BindBackbuffer(const ClearColor& clear_color = {}) override;
|
||||||
|
|
||||||
std::unique_ptr<AbstractShader> CreateShaderFromSource(ShaderStage stage,
|
std::unique_ptr<AbstractShader> CreateShaderFromSource(ShaderStage stage,
|
||||||
std::string_view source) override;
|
std::string_view source) override;
|
||||||
std::unique_ptr<AbstractShader> CreateShaderFromBinary(ShaderStage stage, const void* data,
|
std::unique_ptr<AbstractShader> CreateShaderFromBinary(ShaderStage stage, const void* data,
|
||||||
|
|
Loading…
Reference in New Issue