Skip to content

Conversation

@mardy
Copy link
Collaborator

@mardy mardy commented Oct 13, 2024

The biggest commits are about changing the handling of glDrawElements() and glDrawArrays() inside glCallList(): instead of merging different lists together, now each command is played back individually (allowing the stencil buffer to update in between). Also, fix the handling of vertex normals when they were not specified at list creation time (we must use the current normal vector in that case).

A couple of commits are about implementing glPolygonMode() (which would have been impossible to implement in call lists if we hadn't changed the list implementation).

Other commits are smallers and don't need additional explanation beside what is in their commit message.

mardy and others added 9 commits October 13, 2024 21:13
Use a similar logic as for the color attribute: add it to the display
lists only if it was issued within a glBegin()/glEnd() pair.
As a matter of fact, this does not seem to make any difference, but it
seems more correct nevertheless.
The hardcoded one was a copy-paste mistake.
GX_GetTexObjAll() returns the address to the physical pixel buffer,
exactly like GX_GetTexObjData() does. We need to convert it to a virtual
address.

This mistake was causing no issues in Dolphin, but on the hardware it
was causing cache coherency issues.
The tex_maps is a pointer, and we want to print its contents.
This fixes wrong shading in the dinoshade sample[1]: the program draws
a dinosaur using call lists in which the normal coordinates are not
given; instead, normals are set using glNormal() at the time when the
list is executed, which is something we did not support before, since
all our vertex data was encoded in the GX call lists.

Now, if the color or normal is not given, encode them as indexed data,
which will point to the current color and normal at the time when the
list is executed.

[1]: https://www.opengl.org/archives/resources/code/samples/glut_examples/examples/dinoshade.c
This command is now not issued anymore.
Support glPolygonMode() by patching the GX_Begin() operand in the stored
call lists.
@WinterMute WinterMute merged commit d704e7a into devkitPro:master Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants