From 25a6576785b3c3049eadfdba8d1f0ff437c648d6 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Thu, 20 Jun 2024 22:14:31 -0300 Subject: [PATCH] Remove more obsolete code. --- src/modules/graphics/Graphics.cpp | 5 ----- src/modules/graphics/Mesh.cpp | 6 ------ src/modules/graphics/opengl/OpenGL.cpp | 5 ----- src/modules/graphics/opengl/OpenGL.h | 2 -- 4 files changed, 18 deletions(-) diff --git a/src/modules/graphics/Graphics.cpp b/src/modules/graphics/Graphics.cpp index 4bc9812f7..7fc301682 100644 --- a/src/modules/graphics/Graphics.cpp +++ b/src/modules/graphics/Graphics.cpp @@ -1045,8 +1045,6 @@ void Graphics::setRenderTargets(const RenderTargets &rts) if (rtcount > capabilities.limits[LIMIT_RENDER_TARGETS]) throw love::Exception("This system can't simultaneously render to %d textures.", rtcount); - bool multiformatsupported = capabilities.features[FEATURE_MULTI_RENDER_TARGET_FORMATS]; - PixelFormat firstcolorformat = PIXELFORMAT_UNKNOWN; if (!rts.colors.empty()) firstcolorformat = rts.colors[0].texture->getPixelFormat(); @@ -1087,9 +1085,6 @@ void Graphics::setRenderTargets(const RenderTargets &rts) if (c->getPixelWidth(mip) != pixelw || c->getPixelHeight(mip) != pixelh) throw love::Exception("All textures must have the same pixel dimensions."); - if (!multiformatsupported && format != firstcolorformat) - throw love::Exception("This system doesn't support multi-render-target rendering with different texture formats."); - if (c->getRequestedMSAA() != reqmsaa) throw love::Exception("All textures must have the same MSAA value."); diff --git a/src/modules/graphics/Mesh.cpp b/src/modules/graphics/Mesh.cpp index d4ea341dd..b8565b9b0 100644 --- a/src/modules/graphics/Mesh.cpp +++ b/src/modules/graphics/Mesh.cpp @@ -163,9 +163,6 @@ void Mesh::finalizeAttribute(Graphics *gfx, BufferAttribute &attrib) const if ((attrib.buffer->getUsageFlags() & BUFFERUSAGEFLAG_VERTEX) == 0) throw love::Exception("Buffer must be created with vertex buffer support to be used as a Mesh vertex attribute."); - if (attrib.step == STEP_PER_INSTANCE && !gfx->getCapabilities().features[Graphics::FEATURE_INSTANCING]) - throw love::Exception("Vertex attribute instancing is not supported on this system."); - if (attrib.startArrayIndex < 0 || attrib.startArrayIndex >= (int)attrib.buffer->getArrayLength()) throw love::Exception("Invalid start array index %d.", attrib.startArrayIndex + 1); @@ -562,9 +559,6 @@ void Mesh::drawInternal(Graphics *gfx, const Matrix4 &m, int instancecount, Buff if (vertexCount <= 0 || (instancecount <= 0 && indirectargs == nullptr)) return; - if (instancecount > 1 && !gfx->getCapabilities().features[Graphics::FEATURE_INSTANCING]) - throw love::Exception("Instancing is not supported on this system."); - if (indirectargs != nullptr) { if (primitiveType == PRIMITIVE_TRIANGLE_FAN) diff --git a/src/modules/graphics/opengl/OpenGL.cpp b/src/modules/graphics/opengl/OpenGL.cpp index b37059739..cb8f8a1f3 100644 --- a/src/modules/graphics/opengl/OpenGL.cpp +++ b/src/modules/graphics/opengl/OpenGL.cpp @@ -248,11 +248,6 @@ void OpenGL::setupContext() glGetIntegerv(GL_SCISSOR_BOX, (GLint *) &state.scissor.x); state.scissor.y = state.viewport.h - (state.scissor.y + state.scissor.h); - if (GLAD_VERSION_1_0) - glGetFloatv(GL_POINT_SIZE, &state.pointSize); - else - state.pointSize = 1.0f; - for (int i = 0; i < 2; i++) state.boundFramebuffers[i] = std::numeric_limits::max(); bindFramebuffer(FRAMEBUFFER_ALL, getDefaultFBO()); diff --git a/src/modules/graphics/opengl/OpenGL.h b/src/modules/graphics/opengl/OpenGL.h index b43c1d751..624d3a1d9 100644 --- a/src/modules/graphics/opengl/OpenGL.h +++ b/src/modules/graphics/opengl/OpenGL.h @@ -511,8 +511,6 @@ private: Rect viewport; Rect scissor; - float pointSize; - bool depthWritesEnabled = true; uint32 stencilWriteMask = LOVE_UINT32_MAX; uint32 colorWriteMask = LOVE_UINT32_MAX;