Use FilterMode::Nearest in TextureFormatSamplingTests

Currently TextureFormatTest.R8Uint fails on the Vulkan backend with
Vulkan validation layer enabled because we wrongly use a Linear filter
on a texture with R8Uint format.

This patch fixes this issue by using the Nearest filter in that test
instead.

BUG=dawn:588
TEST=dawn_end2end_tests/TextureFormatTest.R8Uint

Change-Id: I39714784c8f2db25923b50eb2e07b7aa111cb4c0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34280
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Jiawei Shao 2020-11-30 17:54:50 +00:00 committed by Commit Bot service account
parent 2fe7335d34
commit 5fc12c314a
1 changed files with 5 additions and 1 deletions

View File

@ -229,7 +229,11 @@ class TextureFormatTest : public DawnTest {
// Prepare objects needed to sample from texture in the renderpass
wgpu::RenderPipeline pipeline = CreateSamplePipeline(sampleFormatInfo, renderFormatInfo);
wgpu::SamplerDescriptor samplerDesc = utils::GetDefaultSamplerDescriptor();
// In this test we always use the default values of mag/min/mipmap filter
// (FilterMode::Nearest) because integer/unsigned integer textures must be sampled with
// FilterMode::Nearest.
wgpu::SamplerDescriptor samplerDesc;
wgpu::Sampler sampler = device.CreateSampler(&samplerDesc);
wgpu::BindGroup bindGroup =
utils::MakeBindGroup(device, pipeline.GetBindGroupLayout(0),