Lines Matching defs:const

85 	operator vk::VkImageViewType () const
90 bool isNormalized () const
104 const char* name,
119 bool sampleStencil) const;
121 tcu::Vec4 swizzle (tcu::Vec4 inputData, VkComponentMapping componentMapping, float zeroOrOneValue) const;
122 virtual void initPrograms (SourceCollections& sourceCollections) const;
123 virtual void checkSupport (Context& context) const;
124 virtual TestInstance* createInstance (Context& context) const;
125 virtual tcu::UVec2 getRenderSize (SamplerViewType viewType) const;
126 virtual std::vector<Vertex4Tex4> createVertices (void) const;
127 virtual VkSamplerCreateInfo getSamplerCreateInfo (void) const;
128 virtual VkComponentMapping getComponentMapping (void) const;
130 static std::string getGlslSamplerType (const tcu::TextureFormat& format, SamplerViewType type, bool sampleStencil);
148 const char* name,
155 virtual VkSamplerCreateInfo getSamplerCreateInfo (void) const;
165 const char* name,
172 virtual VkSamplerCreateInfo getSamplerCreateInfo (void) const;
182 const char* name,
191 virtual VkSamplerCreateInfo getSamplerCreateInfo (void) const;
192 virtual VkComponentMapping getComponentMapping (void) const;
195 const VkSamplerReductionModeCreateInfo m_reductionCreaterInfo;
203 const char* name,
212 virtual VkSamplerCreateInfo getSamplerCreateInfo (void) const;
213 virtual VkComponentMapping getComponentMapping (void) const;
216 const VkSamplerReductionModeCreateInfo m_reductionCreaterInfo;
224 const char* name,
235 virtual VkSamplerCreateInfo getSamplerCreateInfo (void) const;
236 virtual void checkSupport (Context& context) const;
245 void SamplerLodTest::checkSupport (Context& context) const
262 const char* name,
275 virtual tcu::UVec2 getRenderSize (SamplerViewType viewType) const;
276 virtual std::vector<Vertex4Tex4> createVertices (void) const;
277 virtual VkSamplerCreateInfo getSamplerCreateInfo (void) const;
279 VkSamplerCustomBorderColorCreateInfoEXT getSamplerCustomBorderColorCreateInfo (VkFormat format, rr::GenericVec4 customBorderColorValue, bool customBorderColorFormatless) const;
287 const VkSamplerCustomBorderColorCreateInfoEXT m_customBorderColorCreateInfo;
294 const char* name,
320 bool sampleStencil) const
322 const tcu::UVec2 renderSize = getRenderSize(imageViewType);
323 const std::vector<Vertex4Tex4> vertices = createVertices();
324 const VkSamplerCreateInfo samplerParams = getSamplerCreateInfo();
325 const VkComponentMapping componentMapping = getComponentMapping();
327 const auto isDSFormat = isDepthStencilFormat(imageFormat);
328 const auto tcuFormat = (isDSFormat ? mapVkFormat(imageFormat) : tcu::TextureFormat());
329 const auto hasDepth = (isDSFormat && tcu::hasDepthComponent(tcuFormat.order));
330 const auto hasStencil = (isDSFormat && tcu::hasStencilComponent(tcuFormat.order));
331 const auto imageAspect = (isDSFormat ? (sampleStencil ? VK_IMAGE_ASPECT_STENCIL_BIT : VK_IMAGE_ASPECT_DEPTH_BIT) : VK_IMAGE_ASPECT_COLOR_BIT);
332 const deUint32 mipLevels = (imageViewType.isNormalized() ? static_cast<deUint32>(deLog2Floor32(imageSize)) + 1u : 1u);
339 const VkImageSubresourceRange subresourceRange =
355 void SamplerTest::checkSupport (Context& context) const
365 tcu::Vec4 SamplerTest::swizzle (tcu::Vec4 inputData, VkComponentMapping componentMapping, float zeroOrOneValue) const
368 const vk::VkComponentMapping nonIdentityMapping =
377 const float channelValues[] =
395 void SamplerTest::initPrograms (SourceCollections& sourceCollections) const
399 const char* texCoordSwizzle = DE_NULL;
470 TestInstance* SamplerTest::createInstance (Context& context) const
475 tcu::UVec2 SamplerTest::getRenderSize (SamplerViewType viewType) const
487 std::vector<Vertex4Tex4> SamplerTest::createVertices (void) const
496 const float imageSize = static_cast<float>(m_imageSize);
504 VkSamplerCreateInfo SamplerTest::getSamplerCreateInfo (void) const
506 const VkSamplerCreateInfo defaultSamplerParams =
509 DE_NULL, // const void* pNext;
531 VkComponentMapping SamplerTest::getComponentMapping (void) const
533 const VkComponentMapping componentMapping = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A };
537 std::string SamplerTest::getGlslSamplerType (const tcu::TextureFormat& format, SamplerViewType type, bool sampleStencil)
625 const char* name,
636 VkSamplerCreateInfo SamplerMagFilterTest::getSamplerCreateInfo (void) const
648 const char* name,
659 VkSamplerCreateInfo SamplerMinFilterTest::getSamplerCreateInfo (void) const
675 const VkSamplerReductionModeCreateInfo ret =
678 DE_NULL, // const void* pNext
690 const char* name,
703 VkSamplerCreateInfo SamplerMagReduceFilterTest::getSamplerCreateInfo (void) const
712 VkComponentMapping SamplerMagReduceFilterTest::getComponentMapping (void) const
720 const char* name,
733 VkSamplerCreateInfo SamplerMinReduceFilterTest::getSamplerCreateInfo (void) const
742 VkComponentMapping SamplerMinReduceFilterTest::getComponentMapping (void) const
750 const char* name,
768 VkSamplerCreateInfo SamplerLodTest::getSamplerCreateInfo (void) const
784 const char* name,
805 tcu::UVec2 SamplerAddressModesTest::getRenderSize (SamplerViewType viewType) const
810 std::vector<Vertex4Tex4> SamplerAddressModesTest::createVertices (void) const
846 VkSamplerCreateInfo SamplerAddressModesTest::getSamplerCreateInfo (void) const
863 VkSamplerCustomBorderColorCreateInfoEXT SamplerAddressModesTest::getSamplerCustomBorderColorCreateInfo (VkFormat format, rr::GenericVec4 customBorderColorValue, bool customBorderColorFormatless) const
865 const VkSamplerCustomBorderColorCreateInfoEXT defaultSamplerCustomBorderColorParams =
879 std::string getFormatCaseName (const VkFormat format)
881 const std::string fullName = getFormatName(format);
915 const VkComponentMapping reduceFilterComponentMappings[] =
929 const std::string fullName = getComponentSwizzleName(componentSwizzle);
930 const char* prefix = "VK_COMPONENT_SWIZZLE_";
937 static std::string getComponentMappingGroupName (const VkComponentMapping& componentMapping)
957 const VkComponentMapping& mapping = reduceFilterComponentMappings[i];
981 const VkComponentMapping& mapping = reduceFilterComponentMappings[i];
1003 const char* name;
1032 const TestCaseConfig& config = testCaseConfigs[configNdx];
1062 static const char* borderColorNames[BORDER_COLOR_COUNT] =
1074 const std::string fullName = getSamplerAddressModeName(u);
1087 const std::string fullNameU = getSamplerAddressModeName(u);
1088 const std::string fullNameV = getSamplerAddressModeName(v);
1089 const std::string fullNameW = getSamplerAddressModeName(w);
1144 const TestCaseConfig testCaseConfigs[] =
1206 const TestCaseConfig& config = testCaseConfigs[configNdx];
1225 const bool isDSFormat = isDepthStencilFormat(imageFormat);
1226 const bool sampleStencil = (i > 0);
1236 const auto tcuFormat = mapVkFormat(imageFormat);
1292 ExactSamplingCase (tcu::TestContext& testCtx, const std::string& name, const Params& params);
1295 virtual void initPrograms (vk::SourceCollections& programCollection) const;
1296 virtual TestInstance* createInstance (Context& context) const;
1297 virtual void checkSupport (Context& context) const;
1308 ExactSamplingInstance (Context& context, const Params& params);
1313 vk::VkExtent3D getTextureExtent (void) const;
1321 static const vk::VkVertexInputBindingDescription desc =
1333 static const std::vector<vk::VkVertexInputAttributeDescription> desc =
1353 ExactSamplingCase::ExactSamplingCase (tcu::TestContext& testCtx, const std::string& name, const Params& params)
1358 void ExactSamplingCase::initPrograms (vk::SourceCollections& programCollection) const
1401 const std::string samplerType = typePrefix + "sampler2D";
1402 const std::string colorType = typePrefix + "vec4";
1429 TestInstance* ExactSamplingCase::createInstance (Context& context) const
1434 void ExactSamplingCase::checkSupport (Context& context) const
1441 const auto& vki = context.getInstanceInterface();
1442 const auto physicalDevice = context.getPhysicalDevice();
1443 const auto props = vk::getPhysicalDeviceFormatProperties(vki, physicalDevice, m_params.format);
1444 const vk::VkFormatFeatureFlags requiredFeatures =
1458 ExactSamplingInstance::ExactSamplingInstance (Context& context, const Params& params)
1463 vk::VkExtent3D ExactSamplingInstance::getTextureExtent (void) const
1470 const auto& vki = m_context.getInstanceInterface();
1471 const auto& vkd = m_context.getDeviceInterface();
1472 const auto physDevice = m_context.getPhysicalDevice();
1473 const auto device = m_context.getDevice();
1475 const auto queue = m_context.getUniversalQueue();
1476 const auto queueIndex = m_context.getUniversalQueueFamilyIndex();
1478 const auto tcuFormat = vk::mapVkFormat(m_params.format);
1479 const auto formatInfo = tcu::getTextureFormatInfo(tcuFormat);
1480 const auto texExtent = getTextureExtent();
1481 const auto texUsage = (vk::VK_IMAGE_USAGE_TRANSFER_DST_BIT | vk::VK_IMAGE_USAGE_SAMPLED_BIT);
1482 const auto fbUsage = (vk::VK_IMAGE_USAGE_TRANSFER_SRC_BIT | vk::VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
1483 const auto descType = vk::VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
1484 const auto texLayout = vk::VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
1485 const bool& unnorm = m_params.unnormalizedCoordinates;
1490 const vk::VkImageCreateInfo texImgCreateInfo =
1493 nullptr, // const void* pNext;
1505 &queueIndex, // const deUint32* pQueueFamilyIndices;
1509 const vk::VkImageCreateInfo fbImgCreateInfo =
1512 nullptr, // const void* pNext;
1524 &queueIndex, // const deUint32* pQueueFamilyIndices;
1529 const vk::ImageWithMemory texImage {vkd, device, allocator, texImgCreateInfo, vk::MemoryRequirement::Any};
1530 const vk::ImageWithMemory fbImage {vkd, device, allocator, fbImgCreateInfo, vk::MemoryRequirement::Any};
1533 const auto colorSubresourceRange = vk::makeImageSubresourceRange(vk::VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u);
1534 const auto texView = vk::makeImageView(vkd, device, texImage.get(), vk::VK_IMAGE_VIEW_TYPE_2D, m_params.format, colorSubresourceRange);
1535 const auto fbView = vk::makeImageView(vkd, device, fbImage.get(), vk::VK_IMAGE_VIEW_TYPE_2D, m_params.format, colorSubresourceRange);
1538 const vk::VkDeviceSize texBufferSize = static_cast<vk::VkDeviceSize>(static_cast<deUint32>(tcu::getPixelSize(tcuFormat)) * texExtent.width * texExtent.height * texExtent.depth);
1539 const auto texBufferInfo = vk::makeBufferCreateInfo(texBufferSize, vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT);
1540 const auto resultsBufferInfo = vk::makeBufferCreateInfo(texBufferSize, vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT);
1541 const vk::BufferWithMemory texBuffer {vkd, device, allocator, texBufferInfo, vk::MemoryRequirement::HostVisible};
1542 const vk::BufferWithMemory resultsBuffer {vkd, device, allocator, resultsBufferInfo, vk::MemoryRequirement::HostVisible};
1545 const tcu::IVec2 iImgSize {static_cast<int>(texExtent.width), static_cast<int>(texExtent.height)};
1548 const tcu::PixelBufferAccess texPixels {tcuFormat, iImgSize[0], iImgSize[1], 1, texBufferPtr};
1550 const int W = texPixels.getWidth();
1551 const int H = texPixels.getHeight();
1552 const int D = texPixels.getDepth();
1554 const float divX = static_cast<float>(W - 1);
1555 const float divY = static_cast<float>(H - 1);
1571 const float colorX = static_cast<float>(x) / divX;
1572 const float colorY = static_cast<float>(y) / divY;
1573 const float colorZ = std::min(colorX, colorY);
1577 const tcu::Vec4 finalColor = (texColor - formatInfo.lookupBias) / formatInfo.lookupScale;
1591 const float sign = m_params.offsetSign.get(); DE_ASSERT(sign == 1.0f || sign == -1.0f);
1592 const float offsetWidth = 0.499f / static_cast<float>(texExtent.width);
1593 const float offsetHeight = 0.499f / static_cast<float>(texExtent.height);
1601 const std::vector<ExactSamplingCase::VertexData> fullScreenQuad =
1612 const vk::VkDeviceSize vertexBufferSize = static_cast<vk::VkDeviceSize>(fullScreenQuad.size() * sizeof(decltype(fullScreenQuad)::value_type));
1613 const auto vertexBufferInfo = vk::makeBufferCreateInfo(vertexBufferSize, vk::VK_BUFFER_USAGE_VERTEX_BUFFER_BIT);
1614 const vk::BufferWithMemory vertexBuffer {vkd, device, allocator, vertexBufferInfo, vk::MemoryRequirement::HostVisible};
1617 const auto& vertexAlloc = vertexBuffer.getAllocation();
1618 const auto vertexDataPtr = reinterpret_cast<char*>(vertexAlloc.getHostPtr()) + vertexAlloc.getOffset();
1625 const auto descriptorSetLayout = layoutBuilder.build(vkd, device);
1630 const auto descriptorPool = poolBuilder.build(vkd, device, vk::VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, 1u);
1633 const auto descriptorSet = vk::makeDescriptorSet(vkd, device, descriptorPool.get(), descriptorSetLayout.get());
1637 const auto minMagFilter = (m_params.solidColor ? vk::VK_FILTER_LINEAR : vk::VK_FILTER_NEAREST);
1638 const auto addressMode = (unnorm ? vk::VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE : vk::VK_SAMPLER_ADDRESS_MODE_REPEAT);
1639 const auto unnormalizedCoordinates = (unnorm ? VK_TRUE : VK_FALSE);
1641 const vk::VkSamplerCreateInfo samplerCreateInfo =
1644 nullptr, // const void* pNext;
1662 const auto texSampler = vk::createSampler(vkd, device, &samplerCreateInfo);
1666 const auto descriptorImageInfo = vk::makeDescriptorImageInfo(texSampler.get(), texView.get(), texLayout);
1671 const auto vertexModule = vk::ShaderWrapper(vkd, device, m_context.getBinaryCollection().get("vert"), 0u);
1672 const auto fragModule = vk::ShaderWrapper(vkd, device, m_context.getBinaryCollection().get("frag"), 0u);
1675 const vk::VkAttachmentDescription fbAttachment =
1688 const vk::VkAttachmentReference colorRef =
1694 const vk::VkSubpassDescription subpass =
1699 nullptr, // const VkAttachmentReference* pInputAttachments;
1701 &colorRef, // const VkAttachmentReference* pColorAttachments;
1702 0u, // const VkAttachmentReference* pResolveAttachments;
1703 nullptr, // const VkAttachmentReference* pDepthStencilAttachment;
1705 nullptr, // const deUint32* pPreserveAttachments;
1708 const vk::VkRenderPassCreateInfo renderPassInfo =
1711 nullptr, // const void* pNext;
1714 &fbAttachment, // const VkAttachmentDescription* pAttachments;
1716 &subpass, // const VkSubpassDescription* pSubpasses;
1718 nullptr, // const VkSubpassDependency* pDependencies;
1728 const vk::VkPushConstantRange pcRange =
1736 const vk::VkPipelineLayoutCreateInfo pipelineLayoutInfo =
1739 nullptr, // const void* pNext;
1742 &descriptorSetLayout.get(), // const VkDescriptorSetLayout* pSetLayouts;
1744 &pcRange, // const VkPushConstantRange* pPushConstantRanges;
1746 const vk::PipelineLayoutWrapper pipelineLayout (m_params.pipelineConstructionType, vkd, device, &pipelineLayoutInfo);
1749 const std::vector<vk::VkViewport> viewports { vk::makeViewport(texExtent) };
1750 const vk::VkRect2D renderArea = vk::makeRect2D(texExtent);
1751 const std::vector<vk::VkRect2D> scissors { renderArea };
1753 const auto vtxBindingDescription = ExactSamplingCase::VertexData::getBindingDescription();
1754 const auto vtxAttributeDescriptions = ExactSamplingCase::VertexData::getAttributeDescriptions();
1756 const vk::VkPipelineVertexInputStateCreateInfo vertexInputInfo =
1759 nullptr, // const void* pNext
1762 &vtxBindingDescription, // const VkVertexInputBindingDescription* pVertexBindingDescriptions
1764 vtxAttributeDescriptions.data(), // const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
1785 const auto cmdPool = vk::createCommandPool(vkd, device, vk::VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueIndex);
1786 const auto cmdBufferPtr = vk::allocateCommandBuffer(vkd, device, cmdPool.get(), vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY);
1787 const auto cmdBuffer = cmdBufferPtr.get();
1790 const ExactSamplingCase::PushConstants pushConstants =
1796 const tcu::Vec4 clearFbColor (0.0f, 0.0f, 0.0f, 1.0f);
1797 const vk::VkDeviceSize vertexBufferOffset = 0ull;
1799 const auto vertexBufferBarrier = vk::makeBufferMemoryBarrier(vk::VK_ACCESS_HOST_WRITE_BIT, vk::VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT, vertexBuffer.get(), 0ull, vertexBufferSize);
1800 const auto preBufferCopyBarrier = vk::makeBufferMemoryBarrier(vk::VK_ACCESS_HOST_WRITE_BIT, vk::VK_ACCESS_TRANSFER_READ_BIT, texBuffer.get(), 0ull, texBufferSize);
1801 const auto preTexCopyBarrier = vk::makeImageMemoryBarrier(0u, vk::VK_ACCESS_TRANSFER_WRITE_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, texImage.get(), colorSubresourceRange);
1802 const auto postTexCopyBarrier = vk::makeImageMemoryBarrier(vk::VK_ACCESS_TRANSFER_WRITE_BIT, vk::VK_ACCESS_SHADER_READ_BIT, vk::VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, texLayout, texImage.get(), colorSubresourceRange);
1803 const auto texCopyRange = vk::makeImageSubresourceLayers(vk::VK_IMAGE_ASPECT_COLOR_BIT, 0u, 0u, 1u);
1804 const auto texImageCopy = vk::makeBufferImageCopy(texExtent, texCopyRange);
1828 const auto& resultsBufferAlloc = resultsBuffer.getAllocation();
1831 const auto resultsBufferPtr = reinterpret_cast<const char*>(resultsBufferAlloc.getHostPtr()) + resultsBufferAlloc.getOffset();
1832 const tcu::ConstPixelBufferAccess resultPixels {tcuFormat, iImgSize[0], iImgSize[1], 1, resultsBufferPtr};
1834 const tcu::TextureFormat diffFormat {tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8};
1835 const auto diffBytes = tcu::getPixelSize(diffFormat) * iImgSize[0] * iImgSize[1];
1837 const tcu::PixelBufferAccess diffImg {diffFormat, iImgSize[0], iImgSize[1], 1, diffData.get()};
1839 const tcu::Vec4 colorRed {1.0f, 0.0f, 0.0f, 1.0f};
1840 const tcu::Vec4 colorGreen {0.0f, 1.0f, 0.0f, 1.0f};
1850 const auto inPix = texPixels.getPixel(x, y, z);
1851 const auto outPix = resultPixels.getPixel(x, y, z);
1908 const PipelineConstructionType pipelineConstructionType;
1909 const LodBiasCase lodBiasCase;
1915 MaxSamplerLodBiasCase (tcu::TestContext& testCtx, const std::string& name, const MaxSamplerLodBiasParams& params)
1921 void checkSupport (Context& context) const override;
1922 void initPrograms (vk::SourceCollections& programCollection) const override;
1923 TestInstance* createInstance (Context& context) const override;
1926 const MaxSamplerLodBiasParams m_params;
1932 MaxSamplerLodBiasInstance (Context& context, const MaxSamplerLodBiasParams& params)
1941 const MaxSamplerLodBiasParams m_params;
1944 void MaxSamplerLodBiasCase::checkSupport (Context& context) const
1952 void MaxSamplerLodBiasCase::initPrograms (vk::SourceCollections& programCollection) const
1965 const std::string sampleCoords = "vec2(gl_FragCoord.x / pc.fbWidth, gl_FragCoord.y / pc.fbHeight)";
1993 TestInstance* MaxSamplerLodBiasCase::createInstance (Context& context) const
2000 const auto ctx = m_context.getContextCommonData();
2001 const auto vkFormat = VK_FORMAT_R8G8B8A8_UNORM;
2002 const auto tcuFormat = mapVkFormat(vkFormat);
2003 const auto imageType = VK_IMAGE_TYPE_2D;
2004 const auto tiling = VK_IMAGE_TILING_OPTIMAL;
2005 const auto textureUsage = (VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT);
2006 const auto fbUsage = (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT);
2007 const auto sampleCount = VK_SAMPLE_COUNT_1_BIT;
2008 const auto descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
2009 const auto maxLodBias = getPhysicalDeviceProperties(ctx.vki, ctx.physicalDevice).limits.maxSamplerLodBias;
2010 const auto roundedBias = deFloatFloor(maxLodBias + 0.5f);
2011 const auto textureProperties = getPhysicalDeviceImageFormatProperties(ctx.vki, ctx.physicalDevice, vkFormat, imageType, tiling, textureUsage, 0u);
2012 const auto textureExtent = makeExtent3D(textureProperties.maxExtent.width, 1u, 1u);
2013 const auto fbExtent = tcu::IVec3(1, 1, 1);
2014 const auto vkExtent = makeExtent3D(fbExtent);
2015 const auto baseSeed = 1687852938u;
2017 const VkImageCreateInfo textureCreateInfo =
2020 nullptr, // const void* pNext;
2032 nullptr, // const uint32_t* pQueueFamilyIndices;
2036 const auto textureColorSRR = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, textureCreateInfo.mipLevels, 0u, 1u);
2037 const auto accessedLevel = std::min(roundedBias, static_cast<float>(textureCreateInfo.mipLevels - 1u));
2051 const VkImageViewCreateInfo viewCreateInfo =
2055 viewMinLodPtr.get(), // const void* pNext;
2057 nullptr, // const void* pNext;
2071 const auto textureView = createImageView(ctx.vkd, ctx.device, &viewCreateInfo);
2077 const float samplerMipLodBias = ((m_params.lodBiasCase == LodBiasCase::SAMPLER_BIAS) ? maxLodBias : 0.0f);
2078 const float samplerMinLod = ((m_params.lodBiasCase == LodBiasCase::SAMPLER_MINLOD) ? maxLodBias : 0.0f);
2079 const VkSamplerCreateInfo samplerCreateInfo =
2082 nullptr, // const void* pNext;
2100 const auto sampler = createSampler(ctx.vkd, ctx.device, &samplerCreateInfo);
2103 const std::vector<tcu::Vec4> vertices
2110 const auto vertexBufferSize = static_cast<VkDeviceSize>(de::dataSize(vertices));
2111 const auto vertexBufferInfo = makeBufferCreateInfo(vertexBufferSize, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT);
2115 const auto vertexBufferOffset = static_cast<VkDeviceSize>(0);
2125 const std::vector<float> pcValues { maxLodBias, static_cast<float>(vkExtent.width), static_cast<float>(vkExtent.height) };
2126 const auto pcSize = static_cast<uint32_t>(de::dataSize(pcValues));
2127 const auto pcStages = VK_SHADER_STAGE_FRAGMENT_BIT;
2128 const auto pcRange = makePushConstantRange(pcStages, 0u, pcSize);
2133 const auto descriptorSetLayout = setLayoutBuilder.build(ctx.vkd, ctx.device);
2134 const PipelineLayoutWrapper pipelineLayout (m_params.pipelineConstructionType, ctx.vkd, ctx.device, *descriptorSetLayout, &pcRange);
2138 const auto descriptorPool = descriptorPoolBuilder.build(ctx.vkd, ctx.device, VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, 1u);
2139 const auto descriptorSet = makeDescriptorSet(ctx.vkd, ctx.device, *descriptorPool, *descriptorSetLayout);
2142 const auto samplerDescriptorInfo = makeDescriptorImageInfo(*sampler, *textureView, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
2147 const auto& binaries = m_context.getBinaryCollection();
2148 const auto vertMod = ShaderWrapper(ctx.vkd, ctx.device, binaries.get("vert"));
2149 const auto fragMod = ShaderWrapper(ctx.vkd, ctx.device, binaries.get("frag"));
2151 const std::vector<VkViewport> viewports (1u, makeViewport(vkExtent));
2152 const std::vector<VkRect2D> scissors (1u, makeRect2D(vkExtent));
2173 const auto cmdBuffer = *cmd.cmdBuffer;
2178 const auto preFillBarrier = makeImageMemoryBarrier(0u, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, texture.get(), textureColorSRR);
2189 const auto levelRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, level, 1u, 0u, 1u);
2191 const auto red = rnd.getFloat(0.0f, 1.0f);
2192 const auto green = rnd.getFloat(0.0f, 1.0f);
2193 const auto blue = rnd.getFloat(0.0f, 1.0f);
2194 const tcu::Vec4 clearValue (red, green, blue, 1.0f);
2195 const auto clearValueColor = makeClearValueColorVec4(clearValue);
2203 const auto preReadBarrier = makeImageMemoryBarrier(VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, texture.get(), textureColorSRR);
2206 const tcu::Vec4 fbClearColor (0.0f, 0.0f, 0.0f, 0.0f);
2232 const auto& colorBufferAlloc = colorBuffer.getBufferAllocation();
2235 const tcu::ConstPixelBufferAccess resultAccess (tcuFormat, fbExtent, colorBufferAlloc.getHostPtr());
2236 const auto channelThreshold = 0.005f; // 1/255 < 0.005 < 2/255
2237 const tcu::Vec4 threshold (channelThreshold, channelThreshold, channelThreshold, 0.0f);
2249 const struct
2252 const char* name;
2267 const VkFormat formats[] =
2368 const SamplerViewType viewType = imageViewTypes[viewTypeNdx].type;
2374 const VkFormat format = formats[formatNdx];
2375 const bool isCompressed = isCompressedFormat(format);
2376 const bool isDepthStencil = !isCompressed
2434 static const std::vector<vk::VkFormat> formats =
2477 static const struct
2479 const bool unnormalized;
2480 const std::string name;
2489 static const struct
2491 const tcu::Maybe<float> offset;
2492 const std::string name;
2503 static const std::vector<std::pair<bool, std::string>> solidColor =
2509 for (const auto format : formats)
2511 const std::string formatName = getFormatCaseName(format);
2515 for (const auto& solid : solidColor)
2521 const auto& unnorm = unnormalizedCoordinates[unIdx];
2526 const auto& edges = testEdges[edgeIdx];
2527 const ExactSamplingCase::Params params = { pipelineConstructionType, format, unnorm.unnormalized, solid.first, edges.offset };
2549 const auto caseValue = static_cast<LodBiasCase>(caseIdx);
2550 const auto testName = getLodBiasCaseName(caseValue);
2551 const MaxSamplerLodBiasParams params {pipelineConstructionType, caseValue};