render/vulkan: use VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE for default sampler

We don't actually need the REPEAT mode, and this makes things more
consistent with the YCbCr sampler (which requires CLAMP_TO_EDGE for
spec compliance).

Also drop borderColor which is unused for this mode.
This commit is contained in:
Simon Ser 2023-05-22 19:33:08 +02:00
parent fe7c998666
commit 9755016422

View file

@ -2405,13 +2405,11 @@ static bool init_static_render_data(struct wlr_vk_renderer *renderer) {
.magFilter = VK_FILTER_LINEAR, .magFilter = VK_FILTER_LINEAR,
.minFilter = VK_FILTER_LINEAR, .minFilter = VK_FILTER_LINEAR,
.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST, .mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST,
.addressModeU = VK_SAMPLER_ADDRESS_MODE_REPEAT, .addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT, .addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT, .addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
.maxAnisotropy = 1.f,
.minLod = 0.f, .minLod = 0.f,
.maxLod = 0.25f, .maxLod = 0.25f,
.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK,
}; };
res = vkCreateSampler(dev, &sampler_info, NULL, &renderer->sampler); res = vkCreateSampler(dev, &sampler_info, NULL, &renderer->sampler);