diff --git a/irr/src/COpenGLCoreTexture.h b/irr/src/COpenGLCoreTexture.h index 433acbb6b..fd175658a 100644 --- a/irr/src/COpenGLCoreTexture.h +++ b/irr/src/COpenGLCoreTexture.h @@ -163,7 +163,7 @@ public: OriginalSize = size; Size = OriginalSize; - if (Size.Width == 0 || Size.Height == 0) { + if (core::min_(Size.Width, Size.Height) == 0 || core::max_(Size.Width, Size.Height) > Driver->MaxTextureSize) { char buf[64]; snprintf_irr(buf, sizeof(buf), "%dx%d", Size.Width, Size.Height); os::Printer::log("Invalid size for render target", buf, ELL_ERROR); diff --git a/src/client/render/pipeline.cpp b/src/client/render/pipeline.cpp index e34a55dd9..9812c4476 100644 --- a/src/client/render/pipeline.cpp +++ b/src/client/render/pipeline.cpp @@ -136,6 +136,14 @@ bool TextureBuffer::ensureTexture(video::ITexture **texture, const TextureDefini return false; } + const core::dimension2du max_size = m_driver->getMaxTextureSize(); + if (size.Width > max_size.Width || size.Height > max_size.Height) { + errorstream << "Failed to create texture \"" << definition.name + << "\": exceeds limit " << size.Width << "x" << size.Height + << std::endl; + return false; + } + if (definition.clear) { // We're not able to clear a render target texture // We're not able to create a normal texture with MSAA diff --git a/src/client/render/secondstage.cpp b/src/client/render/secondstage.cpp index b00a54575..10887b860 100644 --- a/src/client/render/secondstage.cpp +++ b/src/client/render/secondstage.cpp @@ -93,8 +93,8 @@ RenderStep *addPostProcessing(RenderPipeline *pipeline, RenderStep *previousStep video::ECOLOR_FORMAT depth_format = selectDepthFormat(driver); verbosestream << "addPostProcessing(): color = " - << video::ColorFormatNames[color_format] << " depth = " - << video::ColorFormatNames[depth_format] << std::endl; + << video::ColorFormatName(color_format) << " depth = " + << video::ColorFormatName(depth_format) << std::endl; // init post-processing buffer static const u8 TEXTURE_COLOR = 0; @@ -134,6 +134,10 @@ RenderStep *addPostProcessing(RenderPipeline *pipeline, RenderStep *previousStep const bool enable_ssaa = antialiasing == "ssaa"; const bool enable_fxaa = antialiasing == "fxaa"; + verbosestream << "addPostProcessing(): AA = " + << (enable_msaa ? "msaa" : enable_ssaa ? "ssaa" : enable_fxaa ? "fxaa" : "none") + << " " << antialiasing_scale << "x" << std::endl; + // Super-sampling is simply rendering into a larger texture. // Downscaling is done by the final step when rendering to the screen. if (enable_ssaa) {