memset(pFeatures, 0, sizeof(*pFeatures));
*pFeatures = (VkPhysicalDeviceFeatures) {
- .robustBufferAccess = false,
+ .robustBufferAccess = true,
.fullDrawIndexUint32 = true,
.imageCubeArray = true,
.independentBlend = true,
.geometryShader = true,
- .tessellationShader = false,
+ .tessellationShader = true,
.sampleRateShading = true,
.dualSrcBlend = true,
.logicOp = true,
features->geometryStreams = false;
break;
}
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: {
+ VkPhysicalDeviceIndexTypeUint8FeaturesEXT *features =
+ (VkPhysicalDeviceIndexTypeUint8FeaturesEXT *)ext;
+ features->indexTypeUint8 = true;
+ break;
+ }
default:
break;
}
properties->filterMinmaxSingleComponentFormats = true;
break;
}
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES: {
+ VkPhysicalDeviceSubgroupProperties *properties =
+ (VkPhysicalDeviceSubgroupProperties *)ext;
+ properties->subgroupSize = 64;
+ properties->supportedStages = VK_SHADER_STAGE_COMPUTE_BIT;
+ properties->supportedOperations = VK_SUBGROUP_FEATURE_BASIC_BIT |
+ VK_SUBGROUP_FEATURE_VOTE_BIT;
+ properties->quadOperationsInAllStages = false;
+ break;
+ }
default:
break;
vk_free2(&device->alloc, pAllocator, fb);
}
-static enum a6xx_tex_clamp
-tu6_tex_wrap(VkSamplerAddressMode address_mode)
-{
- switch (address_mode) {
- case VK_SAMPLER_ADDRESS_MODE_REPEAT:
- return A6XX_TEX_REPEAT;
- case VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT:
- return A6XX_TEX_MIRROR_REPEAT;
- case VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE:
- return A6XX_TEX_CLAMP_TO_EDGE;
- case VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER:
- return A6XX_TEX_CLAMP_TO_BORDER;
- case VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE:
- /* only works for PoT.. need to emulate otherwise! */
- return A6XX_TEX_MIRROR_CLAMP;
- default:
- unreachable("illegal tex wrap mode");
- break;
- }
-}
-
-static enum a6xx_tex_filter
-tu6_tex_filter(VkFilter filter, unsigned aniso)
-{
- switch (filter) {
- case VK_FILTER_NEAREST:
- return A6XX_TEX_NEAREST;
- case VK_FILTER_LINEAR:
- return aniso ? A6XX_TEX_ANISO : A6XX_TEX_LINEAR;
- case VK_FILTER_CUBIC_EXT:
- return A6XX_TEX_CUBIC;
- default:
- unreachable("illegal texture filter");
- break;
- }
-}
-
-static inline enum adreno_compare_func
-tu6_compare_func(VkCompareOp op)
-{
- return (enum adreno_compare_func) op;
-}
-
-static inline enum a6xx_reduction_mode
-tu6_reduction_mode(VkSamplerReductionMode reduction_mode)
-{
- /* note: vulkan enum matches hw */
-
- return (enum a6xx_reduction_mode) reduction_mode;
-}
-
static void
tu_init_sampler(struct tu_device *device,
struct tu_sampler *sampler,
unsigned aniso = pCreateInfo->anisotropyEnable ?
util_last_bit(MIN2((uint32_t)pCreateInfo->maxAnisotropy >> 1, 8)) : 0;
bool miplinear = (pCreateInfo->mipmapMode == VK_SAMPLER_MIPMAP_MODE_LINEAR);
+ float min_lod = CLAMP(pCreateInfo->minLod, 0.0f, 4095.0f / 256.0f);
+ float max_lod = CLAMP(pCreateInfo->maxLod, 0.0f, 4095.0f / 256.0f);
sampler->descriptor[0] =
COND(miplinear, A6XX_TEX_SAMP_0_MIPFILTER_LINEAR_NEAR) |
sampler->descriptor[1] =
/* COND(!cso->seamless_cube_map, A6XX_TEX_SAMP_1_CUBEMAPSEAMLESSFILTOFF) | */
COND(pCreateInfo->unnormalizedCoordinates, A6XX_TEX_SAMP_1_UNNORM_COORDS) |
- A6XX_TEX_SAMP_1_MIN_LOD(pCreateInfo->minLod) |
- A6XX_TEX_SAMP_1_MAX_LOD(pCreateInfo->maxLod) |
+ A6XX_TEX_SAMP_1_MIN_LOD(min_lod) |
+ A6XX_TEX_SAMP_1_MAX_LOD(max_lod) |
COND(pCreateInfo->compareEnable,
A6XX_TEX_SAMP_1_COMPARE_FUNC(tu6_compare_func(pCreateInfo->compareOp)));
/* This is an offset into the border_color BO, which we fill with all the