webrender: Don't issue zero-instance draw calls

We sometimes happen to start a batch but don’t end up putting any primitives to it (e.g. with B_Blend). This is bad for breaking the batch, introducing state changes, and finally triggering anger looks from the driver (https://github.com/szeged/webrender/pull/169).

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (11 by maintainers)

Commits related to this issue

Most upvoted comments

sorry for the delay on this (I just graduated from university 🎉). Here is a list of the reftests that create empty batches.

I’m still getting used to the codebase. Would it make sense to wrap up the args to draw_instanced_batch and draw_instanced_batch_with_previously_bound_textures in a struct, create a builder for that struct (with a bool for the textures), and return a result from the builder with an err on empty data? Then it would be handled at the callsites to draw_instanced_batched.

Or should passing empty data be handled somewhere higher up in the stack? I haven’t fully digested the “life of a task” and “path to the screen” docs yet.

No problem, I had actually told @kvark that I wouldn’t be available to work on it for another week.