garrysmod-issues icon indicating copy to clipboard operation
garrysmod-issues copied to clipboard

drawing circles does not work right with multicore enabled

Open mcNuggets1 opened this issue 9 years ago • 5 comments

bugs and flickers around.

mcNuggets1 avatar Jul 17 '16 21:07 mcNuggets1

Anybody still able to reproduce this? I know it's a thing but I need more details on how to cause it.

Edit: It's surface.DrawPoly btw, but my question still stands.

sohpeach avatar Nov 25 '16 02:11 sohpeach

https://pastebin.com/7HhAApkc

This should be code which could reproduce the issue.

mcNuggets1 avatar Jun 15 '18 21:06 mcNuggets1

This has been mentioned to me a couple times. Apparently it happens more in certain areas of maps and/or when physgun is being used - probably due to an increased number of things to render. How reproducible is it with that code?

Bo98 avatar Jun 20 '18 20:06 Bo98

I only have it happening in very rare situations, but it's there.

mcNuggets1 avatar Jun 20 '18 21:06 mcNuggets1

Is this thread too old to get any attention, or can someone still look into this? I have code that can reproduce this problem pretty much 100% of the time. Instructions are in the link.

mat_queue_mode has something to do with this as well, since it involves switching between modes of single and multithreading.

Assuming gmod_mcore_test is set to 1, mat_queue_mode being set to 2 (multithreaded) causes this issue. mat_queue_mode 0 or 1 does not, but that sets the material system to single threading, which lowers performance.

https://gist.github.com/Jova1106/dfa175f15514913ed07b1a5eb12e2fc6

https://www.youtube.com/watch?v=LWISGaAqibM Here's a video of the problem.

I just discovered that multithreading apparently doesn't even have to be on for surface.DrawPoly to have the same issue, just under different circumstances. This is unfortunate.

I also recently discovered that running the following function before rendering something with surface.DrawPoly seems to minimize the issue significantly with mcore enabled, in the event that turning it off does nothing, although I don't think it solves it completely.

https://gist.github.com/Jova1106/e7cad1dc162cf511d2279f139e61ea2e

Jova1106 avatar Jun 20 '22 17:06 Jova1106