Request for new format A1B5G5R5

Hello,

I’m working on PSX emulator, and the PSX gpu’s pixels format is A1B5G5R5.

I looked at opengl, and there seem to be the format GL_UNSIGNED_SHORT_1_5_5_5_REV which does what I need.
Vulkan has more formats than opengl, it has 3 similar formats, but not exactly the same

typedef enum VkFormat {
    VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
    VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
    VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
} VkFormat;

So, can this format be added?

Thanks

Use VK_FORMAT_A1R5G5B5_UNORM_PACK16 and pretend red is blue. Route serious requests to GitHub. I don’t think this forum is really seriously monitored by insiders.

1 Like

Thanks for the link, I’ll post it there

The problem with using blue for red is that I’m getting 16bit integer packed already, so I would need to transform the pixels manually if I go with this solution.

I would assume if you are making an emulator you need to do bunch of stuff manually anyway.

Can’t you just use a swizzle mask to swap them?

1 Like

I didn’t think about this at all, I think it’s very possible. I’ll test it later today. Thanks for the suggestion

I tried using swizzle, but it does not work for rendering target. It only works for texturing.
In the end I used A1R5G5B5 , and then used swizzling to copy the whole image to another manually using graphics pipeline. I’m not sure but is there a way to blit image with component swizzle?