Skip to content

Conversation

@mardy
Copy link
Collaborator

@mardy mardy commented Oct 23, 2024

No description provided.

@WinterMute
Copy link
Member

whoops, sorry. I'll let you rebase this when you get a chance.

mardy and others added 17 commits October 24, 2024 21:04
Remove constructors with parameters and instead add separate methods to
set the desired texel data.
Do not instantiate the Texture object for a single pixel, but just once
at the beginning of the texture creation. This does not save us any
memory allocations (as a matter of fact, the Texel object is allocated
on the stack at no cost), but allows us to implement some optimizations
in the conversion process.
It's easier if we consider the texel as a single 16-bit element, rather
than two different bytes.
This code is all about C++ templates, which we will be using from
another file, too.
This will be used in glReadPixels, where we have to convert an EFB image
into OpenGL pixel data.
These can be used by raster.c as well.
This will be used by glReadPixels().
Partial implementation, where we read the color buffer only.
This makes it easier to lookup the type in the GL.h header file.
The simplest way to support them is by using the RGBA8 format, but the
optimal way would be using I8 in order to save memory; however, that
would require playing a bit with the TEV setup and these would cease to
be just simple textures.
The I8 format used by GX sets the alpha value to the intensity of the
pixel, but GL_LUMINANCE should be completely opaque. Therefore, setup
the TEV so that the alpha is not read from the texture, but from a
register where we've set it to 255.
We also support the GL_DEPTH_BIAS and GL_DEPTH_OFFSET, because they help
in visualizing the Z buffer if it's drawn back to the screen (otherwise
most Z-changes are too subtle to be perceived when printed as a colour).
@mardy
Copy link
Collaborator Author

mardy commented Oct 24, 2024

whoops, sorry. I'll let you rebase this when you get a chance.

Rebased :-)

@WinterMute WinterMute merged commit 432e615 into devkitPro:master Oct 24, 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