VkSamplerCreateInfo sci = {0};
VkSamplerCustomBorderColorCreateInfoEXT cbci = {0};
sci.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
+ sci.unnormalizedCoordinates = !state->normalized_coords;
sci.magFilter = zink_filter(state->mag_img_filter);
- sci.minFilter = zink_filter(state->min_img_filter);
+ if (sci.unnormalizedCoordinates)
+ sci.minFilter = sci.magFilter;
+ else
+ sci.minFilter = zink_filter(state->min_img_filter);
VkSamplerReductionModeCreateInfo rci;
rci.sType = VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO;
if (state->reduction_mode)
sci.pNext = &rci;
- if (state->min_mip_filter != PIPE_TEX_MIPFILTER_NONE) {
+ if (sci.unnormalizedCoordinates) {
+ sci.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST;
+ } else if (state->min_mip_filter != PIPE_TEX_MIPFILTER_NONE) {
sci.mipmapMode = sampler_mipmap_mode(state->min_mip_filter);
sci.minLod = state->min_lod;
sci.maxLod = state->max_lod;
sci.maxLod = 0.25f;
}
- sci.addressModeU = sampler_address_mode(state->wrap_s);
- sci.addressModeV = sampler_address_mode(state->wrap_t);
- sci.addressModeW = sampler_address_mode(state->wrap_r);
+ if (!sci.unnormalizedCoordinates) {
+ sci.addressModeU = sampler_address_mode(state->wrap_s);
+ sci.addressModeV = sampler_address_mode(state->wrap_t);
+ sci.addressModeW = sampler_address_mode(state->wrap_r);
+ } else {
+ sci.addressModeU = sci.addressModeV = sci.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
+ }
sci.mipLodBias = state->lod_bias;
need_custom |= wrap_needs_border_color(state->wrap_s);
assert(check <= screen->info.border_color_props.maxCustomBorderColorSamplers);
} else
sci.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK; // TODO with custom shader if we're super interested?
+ if (sci.unnormalizedCoordinates)
+ sci.addressModeU = sci.addressModeV = sci.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER;
}
- sci.unnormalizedCoordinates = !state->normalized_coords;
-
if (state->max_anisotropy > 1) {
sci.maxAnisotropy = state->max_anisotropy;
sci.anisotropyEnable = VK_TRUE;