summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJordan Halase <jordan@halase.me>2019-11-01 23:58:18 -0500
committerJordan Halase <jordan@halase.me>2019-11-01 23:58:18 -0500
commit1956c720cd96e3d3d95d2d1930038f74fd03aafb (patch)
treee73bbce244ba5bedaaa2b630c43bdd6adee66a9b /main.c
parent3af08aac52d6c382f5c61be66f1fe9ca1fcebe4b (diff)
Use Vulkan color
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/main.c b/main.c
index eed82b1..77b2d3b 100644
--- a/main.c
+++ b/main.c
@@ -1065,7 +1065,11 @@ static int rvkCreateRawSwapchain(struct RenderVulkan *vk, int width, int height)
uint32_t i;
for (i = 0; i < nFormats; ++i) {
const VkSurfaceFormatKHR want = {
- VK_FORMAT_B8G8R8A8_SRGB, // BGRA sRGB
+ /* UNORM is *NOT* recommended for color blending, but is
+ * useful for getting simple "HTML" colors to the screen
+ * without manually converting to a linear color space.
+ */
+ VK_FORMAT_B8G8R8A8_UNORM,
VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
};
if (surfaceFormats[i].format == VK_FORMAT_UNDEFINED) {
@@ -1184,10 +1188,10 @@ static void freeCommandBuffers(struct RenderVulkan *vk)
static int recordCommandBuffers(struct RenderVulkan *vk)
{
VkClearColorValue clearValue = { 0 };
- clearValue.float32[0] = 1.0f; // R
- clearValue.float32[1] = 0.0f; // G
- clearValue.float32[2] = 0.5f; // B
- clearValue.float32[3] = 1.0f; // A
+ clearValue.float32[0] = (float)0xa4/0x100; // R
+ clearValue.float32[1] = (float)0x1e/0x100; // G
+ clearValue.float32[2] = (float)0x22/0x100; // B
+ clearValue.float32[3] = (float)0xff/0x100; // A
VkImageSubresourceRange range = { 0 };
range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;