-
Notifications
You must be signed in to change notification settings - Fork 12
psx/gpu: Extend TexPage to support bit depths other than 4 #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| /// Texture Blend mode. | ||
| #[derive(Clone, Copy, PartialEq, Eq, Debug)] | ||
| pub enum Blend { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how you eventually plan to use this, but my guess is that it would be useful to make this repr(u8) or something and explicitly define the first discriminant like this
#[repr(u8)]
pub enum Blend {
Mix = 0,
Add,
Sub,
Inc,
}
That way you can do conversions to the repr type more easily like this
let x = Blend::Add;
let y: u8 = x as u8;
| /// bits `0` to `3`: texture page X base | ||
| /// bit `4`: texture page Y base | ||
| /// bits `5` to `6`: semi-transparency (0=B/2+F/2, 1=B+F, 2=B-F, 3=B+F/4) | ||
| /// bits `7` to `8`: Bpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is bit 8 in the texpage field or _pad? At a glance it looks like a typo to me.
|
I remember when I added |
| /// bit `4`: texture page Y base | ||
| pub type TexPage = PackedVertex<2, 4, 1>; | ||
| #[repr(C)] | ||
| #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Would derive(Default) be useful? (and a valid value?)
No description provided.