Skip to content

Instantly share code, notes, and snippets.

@zeux
Last active December 20, 2022 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeux/1ebc5e04030a681f7957ded0f5957015 to your computer and use it in GitHub Desktop.
Save zeux/1ebc5e04030a681f7957ded0f5957015 to your computer and use it in GitHub Desktop.
Gather best meshlet configurations (from the topology perspective) for each meshlet size limit
tl = 512
for vl in [32, 64, 96, 128, 256]:
bestx = 0
besty = 0
bests = vl
for x in range(1, vl):
for y in range(1, vl):
v = (x+1)*(y+1)
t = 2*x*y
p = 2*(x+y)
s = p / t
if v <= vl and t <= tl and bests > s:
bestx = x
besty = y
bestv = v
bestt = t
bestp = p
bests = s
print("v limit", vl, ": best", bestx, "x", besty, "v", bestv, "t", bestt, "p", bestp, "; p/t", "%.02f" % (bestp/bestt), "acmr", "%.02f" % (bestv/bestt))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment