[D3D] Add B5G6R5 and B4G4R4 texture formats - #258
Conversation
LukasBanana
left a comment
There was a problem hiding this comment.
I'm happy to add those new entries if you have a use for them. Preferably, new entries to the public interface should implement them for all backends or otherwise document what backends supported them.
LukasBanana
left a comment
There was a problem hiding this comment.
I left a few more comments, but mostly looks good.
| case Format::RG11B10Float: return MTLPixelFormatRG11B10Float; | ||
| case Format::RGB9E5Float: return MTLPixelFormatRGB9E5Float; | ||
| case Format::BGR5A1UNorm: break; //return MTLPixelFormatBGR5A1Unorm; | ||
| case Format::B5G6R5UNorm: return MTLPixelFormatB5G6R5Unorm; |
There was a problem hiding this comment.
Please add a dummy case for BGRA4UNorm here analogous to BGRA8SInt above, to make it clear that this is intentionally left out.
| InitializeGLTextureSwizzle(target, swizzle); | ||
| break; | ||
|
|
||
| case GLSwizzleFormat::BGR: |
There was a problem hiding this comment.
This should have its own case and new functions that set TextureSwizzleRGBA::a to TextureSwizzle::Zero analogous to GetTextureSwizzlePermutationBGRAComponent() and GetTextureSwizzlePermutationBGRA() that acknowledge that no alpha component exists.
| switch (swizzle) | ||
| { | ||
| case GLSwizzleFormat::Alpha: return MapGLSwizzleFormatAlpha(format); | ||
| case GLSwizzleFormat::BGR: return format; |
There was a problem hiding this comment.
Can you please add a brief comment here why we forward the input for BGR? I presume this is because we only use GL_RGB565 and GL_RGBA4 for BGR/BGRA formats.
7ec5c01 to
e08bb6b
Compare
Adds the missing format mappings and unit-test coverage for the two packed 16-bit formats.