MCPcopy Create free account
hub / github.com/defold/defold / CheckRenderTargetSize

Function CheckRenderTargetSize

engine/render/src/render/render_script.cpp:642–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

640 }
641
642 static void CheckRenderTargetSize(lua_State* L, RenderScriptInstance* i, lua_Integer width, lua_Integer height)
643 {
644 int32_t width_i = (int32_t) width;
645 int32_t height_i = (int32_t) height;
646
647 if (width <= 0 || height <= 0)
648 {
649 luaL_error(L, "Invalid render target size: width %d and height %d. Width and height must be greater than 0.",
650 width_i, height_i);
651 }
652
653 uint32_t max_tex_size = dmGraphics::GetMaxTextureSize(i->m_RenderContext->m_GraphicsContext);
654 if ((uint32_t) width > max_tex_size || (uint32_t) height > max_tex_size)
655 {
656 luaL_error(L, "Render target size %d x %d exceeds max supported texture size %u for this platform.",
657 width_i, height_i, max_tex_size);
658 }
659 }
660
661 bool InsertCommand(RenderScriptInstance* i, const Command& command)
662 {

Callers 2

Calls 2

luaL_errorFunction · 0.85
GetMaxTextureSizeFunction · 0.85

Tested by

no test coverage detected