gsdx-ogl/d3d11: Add a assert when texture is too small or too big.

Add an assert for when texture is below 1 on direct3d/ogl.
Add an assert for when texture is above direct3d limit.
This commit is contained in:
lightningterror 2019-08-19 12:33:07 +02:00
parent de7a3b70c9
commit 99f814d376
2 changed files with 6 additions and 0 deletions

View File

@ -638,6 +638,9 @@ void GSDevice11::ClearStencil(GSTexture* t, uint8 c)
GSTexture* GSDevice11::CreateSurface(int type, int w, int h, int format)
{
ASSERT(w > 0 && w <= m_d3d_texsize);
ASSERT(h > 0 && h <= m_d3d_texsize);
HRESULT hr;
D3D11_TEXTURE2D_DESC desc;

View File

@ -155,6 +155,9 @@ namespace PboPool {
GSTextureOGL::GSTextureOGL(int type, int w, int h, int format, GLuint fbo_read, bool mipmap)
: m_clean(false), m_generate_mipmap(true), m_local_buffer(nullptr), m_r_x(0), m_r_y(0), m_r_w(0), m_r_h(0), m_layer(0)
{
ASSERT(w > 0);
ASSERT(h > 0);
// OpenGL didn't like dimensions of size 0
m_size.x = std::max(1,w);
m_size.y = std::max(1,h);