yuzu icon indicating copy to clipboard operation
yuzu copied to clipboard

VideoCore: Fix draw error when InstanceId is used in the vertex shader

Open vonchenplus opened this issue 2 years ago • 4 comments

The gpu will split multi-instance drawing into multiple drawing commands, and the current drawing scheduling scheme incorrectly identifies this kind of drawing, resulting in the vertex shader unable to obtain the correct instance number.

The currently adopted scheme is consistent with the MME drawing scheduling scheme, accumulating drawing instances and then performing a unified drawing.

Fixed the gpu_console black screen problem, which should also fix other games. image

vonchenplus avatar Jun 16 '22 08:06 vonchenplus

Fwiw just wanted to mention that the Hw does the draw on setIndexCount and setVertexCount rather than vertexEndGl, you might wanna take that into account if it could lead to a cleaner impl

bylaws avatar Jun 16 '22 09:06 bylaws

@FernandoS27 this change appears to be safe, tested 20 games, we can tag ea if we want to make entirely sure

gidoly avatar Jul 13 '22 09:07 gidoly

@vonchenplus PR this against YFC

liamwhite avatar Jul 28 '22 15:07 liamwhite

I am waiting for the merge of yfc.

vonchenplus avatar Jul 29 '22 10:07 vonchenplus

@vonchenplus Is this ready for review?

liamwhite avatar Oct 17 '22 11:10 liamwhite

@vonchenplus Is this ready for review?

Yes, keep it that way for now

vonchenplus avatar Oct 18 '22 01:10 vonchenplus