Files
RetroArch/samples/gfx/vulkan_surface_format/Makefile
LibretroAdmin 9628c86f07 Vulkan: prefer B8G8R8A8_UNORM for the 8-bit swapchain
The 8-bit SDR swapchain takes B8G8R8A8_UNORM in the sRGB colour space
whenever the surface lists it, and the first 8-bit UNORM format only
when it does not. B8G8R8A8 maps to DRM XRGB8888, which every primary
plane scans out, so a compositor can give a fullscreen window direct
scanout regardless of the order the driver lists its formats in (the
NVIDIA Wayland WSI lists R8G8B8A8 first, which mutter cannot put on
the plane). See #19841.

The choice lives in gfx/common/vulkan_surface_format.h; the
samples/gfx/vulkan_surface_format lane checks it against RGBA-first,
BGRA-first, wide-first and BGRA-less format lists.
2026-10-15 23:57:25 +02:00

24 lines
858 B
Makefile

# gfx/common/vulkan_surface_format.h: which 8-bit surface format the
# swapchain is created with - B8G8R8A8_UNORM in the sRGB colour space
# wherever the surface lists it, whatever order the driver lists it in.
# No device needed.
TARGET := vulkan_surface_format_test
REPO_ROOT := ../../..
SOURCES := vulkan_surface_format_test.c
CFLAGS += -Wall -Wextra -std=c89 -pedantic -Wno-long-long -g1 -O0 \
-I$(REPO_ROOT)/libretro-common/include -I$(REPO_ROOT)/gfx/include
ifneq ($(SANITIZER),)
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
endif
all: $(TARGET)
$(TARGET): $(SOURCES) $(REPO_ROOT)/gfx/common/vulkan_surface_format.h
$(CC) $(CFLAGS) -o $@ $(SOURCES) $(LDFLAGS)
check: $(TARGET)
./$(TARGET)
clean:
rm -f $(TARGET) $(TARGET).exe
.PHONY: all check clean