diff --git a/src/intrinsic_table_test.cc b/src/intrinsic_table_test.cc index 9cad7dd5dc..3b1c527026 100644 --- a/src/intrinsic_table_test.cc +++ b/src/intrinsic_table_test.cc @@ -242,7 +242,7 @@ TEST_F(IntrinsicTableTest, MatchSampler) { auto* vec2_f32 = create(f32, 2); auto* vec4_f32 = create(f32, 4); auto* tex = create(ast::TextureDimension::k2d, f32); - auto sampler = ty.sampler(ast::SamplerKind::kSampler); + auto* sampler = create(ast::SamplerKind::kSampler); auto result = table->Lookup(*this, IntrinsicType::kTextureSample, {tex, sampler, vec2_f32}, Source{}); ASSERT_NE(result.intrinsic, nullptr); diff --git a/src/program_builder.h b/src/program_builder.h index da8aa40505..8313c57971 100644 --- a/src/program_builder.h +++ b/src/program_builder.h @@ -751,16 +751,14 @@ class ProgramBuilder { /// @param kind the kind of sampler /// @returns the sampler typ::Sampler sampler(ast::SamplerKind kind) const { - return {builder->create(kind), - builder->create(kind)}; + return {builder->create(kind)}; } /// @param source the Source of the node /// @param kind the kind of sampler /// @returns the sampler typ::Sampler sampler(const Source& source, ast::SamplerKind kind) const { - return {builder->create(source, kind), - builder->create(kind)}; + return {builder->create(source, kind)}; } /// @param dims the dimensionality of the texture diff --git a/src/typepair.h b/src/typepair.h index 61dfe0684a..31c3c50d89 100644 --- a/src/typepair.h +++ b/src/typepair.h @@ -239,7 +239,6 @@ using Type = TypePair; using Matrix = TypePair; using Pointer = TypePair; -using Sampler = TypePair; using Struct = TypePair; using Vector = TypePair; @@ -254,6 +253,7 @@ using MultisampledTexture = Ptr; using SampledTexture = Ptr; using StorageTexture = Ptr; using Texture = Ptr; +using Sampler = Ptr; // Helpers diff --git a/src/writer/msl/generator_impl_type_test.cc b/src/writer/msl/generator_impl_type_test.cc index e9becc1ef4..cf3f14127b 100644 --- a/src/writer/msl/generator_impl_type_test.cc +++ b/src/writer/msl/generator_impl_type_test.cc @@ -656,7 +656,7 @@ TEST_F(MslGeneratorImplTest, EmitType_Void) { } TEST_F(MslGeneratorImplTest, EmitType_Sampler) { - auto sampler = ty.sampler(ast::SamplerKind::kSampler); + auto* sampler = create(ast::SamplerKind::kSampler); GeneratorImpl& gen = Build(); @@ -665,7 +665,7 @@ TEST_F(MslGeneratorImplTest, EmitType_Sampler) { } TEST_F(MslGeneratorImplTest, EmitType_SamplerComparison) { - auto sampler = ty.sampler(ast::SamplerKind::kComparisonSampler); + auto* sampler = create(ast::SamplerKind::kComparisonSampler); GeneratorImpl& gen = Build();