Remove utils::GetDefaultSamplerDescriptor

This helper is no longer needed now that the descriptor has full
defaults and is even optional in CreateSampler.

Bug: dawn:599
Change-Id: I0d25233ebb1e817ad27f3ddaca988e01e2a5298c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/40520
Commit-Queue: Stephen White <senorblanco@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Corentin Wallez
2021-02-05 20:26:54 +00:00
committed by Commit Bot service account
parent 14a2398e71
commit fb2e77106a
12 changed files with 36 additions and 67 deletions

View File

@@ -51,10 +51,7 @@ class BindGroupValidationTest : public ValidationTest {
descriptor.usage = wgpu::BufferUsage::Storage;
mSSBO = device.CreateBuffer(&descriptor);
}
{
wgpu::SamplerDescriptor descriptor = utils::GetDefaultSamplerDescriptor();
mSampler = device.CreateSampler(&descriptor);
}
{ mSampler = device.CreateSampler(); }
{
mSampledTexture =
CreateTexture(wgpu::TextureUsage::Sampled, wgpu::TextureFormat::RGBA8Unorm, 1);
@@ -164,7 +161,7 @@ TEST_F(BindGroupValidationTest, SamplerBindingType) {
// Setting the sampler to an error sampler is an error.
{
wgpu::SamplerDescriptor samplerDesc = utils::GetDefaultSamplerDescriptor();
wgpu::SamplerDescriptor samplerDesc;
samplerDesc.minFilter = static_cast<wgpu::FilterMode>(0xFFFFFFFF);
wgpu::Sampler errorSampler;

View File

@@ -24,27 +24,24 @@ namespace {
// Test NaN and INFINITY values are not allowed
TEST_F(SamplerValidationTest, InvalidLOD) {
{ device.CreateSampler(); }
{
wgpu::SamplerDescriptor samplerDesc = utils::GetDefaultSamplerDescriptor();
device.CreateSampler(&samplerDesc);
}
{
wgpu::SamplerDescriptor samplerDesc = utils::GetDefaultSamplerDescriptor();
wgpu::SamplerDescriptor samplerDesc;
samplerDesc.lodMinClamp = NAN;
ASSERT_DEVICE_ERROR(device.CreateSampler(&samplerDesc));
}
{
wgpu::SamplerDescriptor samplerDesc = utils::GetDefaultSamplerDescriptor();
wgpu::SamplerDescriptor samplerDesc;
samplerDesc.lodMaxClamp = NAN;
ASSERT_DEVICE_ERROR(device.CreateSampler(&samplerDesc));
}
{
wgpu::SamplerDescriptor samplerDesc = utils::GetDefaultSamplerDescriptor();
wgpu::SamplerDescriptor samplerDesc;
samplerDesc.lodMaxClamp = INFINITY;
device.CreateSampler(&samplerDesc);
}
{
wgpu::SamplerDescriptor samplerDesc = utils::GetDefaultSamplerDescriptor();
wgpu::SamplerDescriptor samplerDesc;
samplerDesc.lodMaxClamp = INFINITY;
samplerDesc.lodMinClamp = INFINITY;
device.CreateSampler(&samplerDesc);

View File

@@ -617,8 +617,7 @@ TEST_F(StorageTextureValidationTests, StorageTextureBindingTypeInBindGroup) {
// Samplers are not allowed to be used as storage textures in a bind group.
{
wgpu::SamplerDescriptor descriptor = utils::GetDefaultSamplerDescriptor();
wgpu::Sampler sampler = device.CreateSampler(&descriptor);
wgpu::Sampler sampler = device.CreateSampler();
ASSERT_DEVICE_ERROR(utils::MakeBindGroup(device, bindGroupLayout, {{0, sampler}}));
}