Turn off automatic batching in version 11?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Rickton
Party member
Posts: 128
Joined: Tue Mar 19, 2013 4:59 pm
Contact:

Turn off automatic batching in version 11?

Post by Rickton »

Is there any way to turn off the automatic spritebatching? Something's causing a weird display issue for me that wasn't there when I was on 10.2 (the tile that the player character's sprite is moving to flashes briefly with a black border around it), and I want to disable the batching to see if it's related.
Possession - Escape from the Nether Regions, my roguelike made in LÖVE for the 2013 7-Day Roguelike Challenge
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Turn off automatic batching in version 11?

Post by raidho36 »

It's most definitely not related. Batching simply moves multiple quads for rendering at a time, as opposed to doing it one by one. You can use flushBatch function to force it to render whatever's in the batch and clear it.
Rickton
Party member
Posts: 128
Joined: Tue Mar 19, 2013 4:59 pm
Contact:

Re: Turn off automatic batching in version 11?

Post by Rickton »

Yeah, I know what batching is, I was using it manually before 11 came out.
If something's wrong, it's my code interacting with the batching in some weird way, but I'd like to be able to turn the auto-batching off so I know whether I need to even look in that direction. I agree it's probably a dead end, but I didn't have this problem in 10.2 and I do now in 11, and I don't see what else changed that could be causing it, so it'd be nice to be able to check.
Possession - Escape from the Nether Regions, my roguelike made in LÖVE for the 2013 7-Day Roguelike Challenge
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
User avatar
slime
Solid Snayke
Posts: 3131
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Turn off automatic batching in version 11?

Post by slime »

Rickton wrote: Thu Apr 19, 2018 1:02 amI don't see what else changed that could be causing it, so it'd be nice to be able to check.
The internals of love.graphics have been substantially rewritten since 0.10. It takes advantage of more OpenGL 3+ features when available than before, which runs more risk of encountering bugs inside graphics drivers.

You can't turn off batching because there's no other codepath. You can test using OpenGL 2 features instead of OpenGL 3 (set the environment variable LOVE_GRAPHICS_USE_GL2=1 in a command prompt before running love from that command prompt), which will force love to use a different / often slower method of sending automatically batched vertices to the GPU, if your system was previously using OpenGL 3 features.

SpriteBatches use a different rendering path than love.graphics.draw(image) as well. If the issue only happens when a spritebatch is used but not when love.graphics.draw(image) is used (or vice versa) it can help narrow down where the problem is happening.

In any case I'd recommend making sure your graphics drivers are as up to date as possible.
Rickton
Party member
Posts: 128
Joined: Tue Mar 19, 2013 4:59 pm
Contact:

Re: Turn off automatic batching in version 11?

Post by Rickton »

slime wrote: Thu Apr 19, 2018 1:27 am
Rickton wrote: Thu Apr 19, 2018 1:02 amI don't see what else changed that could be causing it, so it'd be nice to be able to check.
The internals of love.graphics have been substantially rewritten since 0.10. It takes advantage of more OpenGL 3+ features when available than before, which runs more risk of encountering bugs inside graphics drivers.

You can't turn off batching because there's no other codepath. You can test using OpenGL 2 features instead of OpenGL 3 (set the environment variable LOVE_GRAPHICS_USE_GL2=1 in a command prompt before running love from that command prompt), which will force love to use a different / often slower method of sending automatically batched vertices to the GPU, if your system was previously using OpenGL 3 features.

SpriteBatches use a different rendering path than love.graphics.draw(image) as well. If the issue only happens when a spritebatch is used but not when love.graphics.draw(image) is used (or vice versa) it can help narrow down where the problem is happening.

In any case I'd recommend making sure your graphics drivers are as up to date as possible.
Cool, thanks for the information. One more question, is there any way to tell if something's being automatically batched vs straight up drawn? I've got some stuff I'm manually batching, and some other stuff that's probably a candidate for batching, but since it's not necessarily being drawn consecutively I'm not sure what's being batched and what's not (although when I check the number of draw calls it's pretty high so that makes me think it's not).
Possession - Escape from the Nether Regions, my roguelike made in LÖVE for the 2013 7-Day Roguelike Challenge
And its sequel, simply called Possession , which is available on itch.io or Steam, and whose engine I've open-sourced!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 56 guests