mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-16 18:01:40 +00:00
parent
fd3588d49c
commit
6da927a548
3 changed files with 15 additions and 3 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue