Browse Source

Remove more obsolete code.

Sasha Szpakowski 1 year ago
parent
commit
25a6576785

+ 0 - 5
src/modules/graphics/Graphics.cpp

@@ -1045,8 +1045,6 @@ void Graphics::setRenderTargets(const RenderTargets &rts)
 	if (rtcount > capabilities.limits[LIMIT_RENDER_TARGETS])
 	if (rtcount > capabilities.limits[LIMIT_RENDER_TARGETS])
 		throw love::Exception("This system can't simultaneously render to %d textures.", rtcount);
 		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;
 	PixelFormat firstcolorformat = PIXELFORMAT_UNKNOWN;
 	if (!rts.colors.empty())
 	if (!rts.colors.empty())
 		firstcolorformat = rts.colors[0].texture->getPixelFormat();
 		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)
 		if (c->getPixelWidth(mip) != pixelw || c->getPixelHeight(mip) != pixelh)
 			throw love::Exception("All textures must have the same pixel dimensions.");
 			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)
 		if (c->getRequestedMSAA() != reqmsaa)
 			throw love::Exception("All textures must have the same MSAA value.");
 			throw love::Exception("All textures must have the same MSAA value.");
 
 

+ 0 - 6
src/modules/graphics/Mesh.cpp

@@ -163,9 +163,6 @@ void Mesh::finalizeAttribute(Graphics *gfx, BufferAttribute &attrib) const
 	if ((attrib.buffer->getUsageFlags() & BUFFERUSAGEFLAG_VERTEX) == 0)
 	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.");
 		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())
 	if (attrib.startArrayIndex < 0 || attrib.startArrayIndex >= (int)attrib.buffer->getArrayLength())
 		throw love::Exception("Invalid start array index %d.", attrib.startArrayIndex + 1);
 		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))
 	if (vertexCount <= 0 || (instancecount <= 0 && indirectargs == nullptr))
 		return;
 		return;
 
 
-	if (instancecount > 1 && !gfx->getCapabilities().features[Graphics::FEATURE_INSTANCING])
-		throw love::Exception("Instancing is not supported on this system.");
-
 	if (indirectargs != nullptr)
 	if (indirectargs != nullptr)
 	{
 	{
 		if (primitiveType == PRIMITIVE_TRIANGLE_FAN)
 		if (primitiveType == PRIMITIVE_TRIANGLE_FAN)

+ 0 - 5
src/modules/graphics/opengl/OpenGL.cpp

@@ -248,11 +248,6 @@ void OpenGL::setupContext()
 	glGetIntegerv(GL_SCISSOR_BOX, (GLint *) &state.scissor.x);
 	glGetIntegerv(GL_SCISSOR_BOX, (GLint *) &state.scissor.x);
 	state.scissor.y = state.viewport.h - (state.scissor.y + state.scissor.h);
 	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++)
 	for (int i = 0; i < 2; i++)
 		state.boundFramebuffers[i] = std::numeric_limits<GLuint>::max();
 		state.boundFramebuffers[i] = std::numeric_limits<GLuint>::max();
 	bindFramebuffer(FRAMEBUFFER_ALL, getDefaultFBO());
 	bindFramebuffer(FRAMEBUFFER_ALL, getDefaultFBO());

+ 0 - 2
src/modules/graphics/opengl/OpenGL.h

@@ -511,8 +511,6 @@ private:
 		Rect viewport;
 		Rect viewport;
 		Rect scissor;
 		Rect scissor;
 
 
-		float pointSize;
-
 		bool depthWritesEnabled = true;
 		bool depthWritesEnabled = true;
 		uint32 stencilWriteMask = LOVE_UINT32_MAX;
 		uint32 stencilWriteMask = LOVE_UINT32_MAX;
 		uint32 colorWriteMask = LOVE_UINT32_MAX;
 		uint32 colorWriteMask = LOVE_UINT32_MAX;