vk: Add support for anisotropic bits
This commit is contained in:
@@ -1688,6 +1688,7 @@ VkResult anv_CreateSampler(
|
|||||||
{
|
{
|
||||||
struct anv_device *device = (struct anv_device *) _device;
|
struct anv_device *device = (struct anv_device *) _device;
|
||||||
struct anv_sampler *sampler;
|
struct anv_sampler *sampler;
|
||||||
|
uint32_t mag_filter, min_filter, max_anisotropy;
|
||||||
|
|
||||||
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO);
|
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO);
|
||||||
|
|
||||||
@@ -1726,8 +1727,15 @@ VkResult anv_CreateSampler(
|
|||||||
[VK_COMPARE_OP_ALWAYS] = PREFILTEROPALWAYS,
|
[VK_COMPARE_OP_ALWAYS] = PREFILTEROPALWAYS,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (pCreateInfo->maxAnisotropy > 0)
|
if (pCreateInfo->maxAnisotropy > 1) {
|
||||||
anv_finishme("missing support for anisotropic filtering");
|
mag_filter = MAPFILTER_ANISOTROPIC;
|
||||||
|
min_filter = MAPFILTER_ANISOTROPIC;
|
||||||
|
max_anisotropy = (pCreateInfo->maxAnisotropy - 2) / 2;
|
||||||
|
} else {
|
||||||
|
mag_filter = vk_to_gen_tex_filter[pCreateInfo->magFilter];
|
||||||
|
min_filter = vk_to_gen_tex_filter[pCreateInfo->minFilter];
|
||||||
|
max_anisotropy = RATIO21;
|
||||||
|
}
|
||||||
|
|
||||||
struct GEN8_SAMPLER_STATE sampler_state = {
|
struct GEN8_SAMPLER_STATE sampler_state = {
|
||||||
.SamplerDisable = false,
|
.SamplerDisable = false,
|
||||||
@@ -1735,8 +1743,8 @@ VkResult anv_CreateSampler(
|
|||||||
.LODPreClampMode = 0,
|
.LODPreClampMode = 0,
|
||||||
.BaseMipLevel = 0,
|
.BaseMipLevel = 0,
|
||||||
.MipModeFilter = vk_to_gen_mipmap_mode[pCreateInfo->mipMode],
|
.MipModeFilter = vk_to_gen_mipmap_mode[pCreateInfo->mipMode],
|
||||||
.MagModeFilter = vk_to_gen_tex_filter[pCreateInfo->magFilter],
|
.MagModeFilter = mag_filter,
|
||||||
.MinModeFilter = vk_to_gen_tex_filter[pCreateInfo->minFilter],
|
.MinModeFilter = min_filter,
|
||||||
.TextureLODBias = pCreateInfo->mipLodBias * 256,
|
.TextureLODBias = pCreateInfo->mipLodBias * 256,
|
||||||
.AnisotropicAlgorithm = EWAApproximation,
|
.AnisotropicAlgorithm = EWAApproximation,
|
||||||
.MinLOD = pCreateInfo->minLod * 256,
|
.MinLOD = pCreateInfo->minLod * 256,
|
||||||
@@ -1749,10 +1757,10 @@ VkResult anv_CreateSampler(
|
|||||||
|
|
||||||
.IndirectStatePointer =
|
.IndirectStatePointer =
|
||||||
device->float_border_colors.offset +
|
device->float_border_colors.offset +
|
||||||
pCreateInfo->borderColor * sizeof(float) * 4;
|
pCreateInfo->borderColor * sizeof(float) * 4,
|
||||||
|
|
||||||
.LODClampMagnificationMode = MIPNONE,
|
.LODClampMagnificationMode = MIPNONE,
|
||||||
.MaximumAnisotropy = 0,
|
.MaximumAnisotropy = max_anisotropy,
|
||||||
.RAddressMinFilterRoundingEnable = 0,
|
.RAddressMinFilterRoundingEnable = 0,
|
||||||
.RAddressMagFilterRoundingEnable = 0,
|
.RAddressMagFilterRoundingEnable = 0,
|
||||||
.VAddressMinFilterRoundingEnable = 0,
|
.VAddressMinFilterRoundingEnable = 0,
|
||||||
|
Reference in New Issue
Block a user