| 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 | { |
no test coverage detected