Have TypesBuilder::sampler() return ast::Sampler
Bug: tint:724 Change-Id: Ifdba69a24d65e2f874ea8bdb3984d36a8cfa2bd7 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/51663 Commit-Queue: Ben Clayton <bclayton@google.com> Auto-Submit: Ben Clayton <bclayton@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
parent
55ecfc4a24
commit
b966265f5a
|
@ -242,7 +242,7 @@ TEST_F(IntrinsicTableTest, MatchSampler) {
|
||||||
auto* vec2_f32 = create<sem::Vector>(f32, 2);
|
auto* vec2_f32 = create<sem::Vector>(f32, 2);
|
||||||
auto* vec4_f32 = create<sem::Vector>(f32, 4);
|
auto* vec4_f32 = create<sem::Vector>(f32, 4);
|
||||||
auto* tex = create<sem::SampledTexture>(ast::TextureDimension::k2d, f32);
|
auto* tex = create<sem::SampledTexture>(ast::TextureDimension::k2d, f32);
|
||||||
auto sampler = ty.sampler(ast::SamplerKind::kSampler);
|
auto* sampler = create<sem::Sampler>(ast::SamplerKind::kSampler);
|
||||||
auto result = table->Lookup(*this, IntrinsicType::kTextureSample,
|
auto result = table->Lookup(*this, IntrinsicType::kTextureSample,
|
||||||
{tex, sampler, vec2_f32}, Source{});
|
{tex, sampler, vec2_f32}, Source{});
|
||||||
ASSERT_NE(result.intrinsic, nullptr);
|
ASSERT_NE(result.intrinsic, nullptr);
|
||||||
|
|
|
@ -751,16 +751,14 @@ class ProgramBuilder {
|
||||||
/// @param kind the kind of sampler
|
/// @param kind the kind of sampler
|
||||||
/// @returns the sampler
|
/// @returns the sampler
|
||||||
typ::Sampler sampler(ast::SamplerKind kind) const {
|
typ::Sampler sampler(ast::SamplerKind kind) const {
|
||||||
return {builder->create<ast::Sampler>(kind),
|
return {builder->create<ast::Sampler>(kind)};
|
||||||
builder->create<sem::Sampler>(kind)};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @param source the Source of the node
|
/// @param source the Source of the node
|
||||||
/// @param kind the kind of sampler
|
/// @param kind the kind of sampler
|
||||||
/// @returns the sampler
|
/// @returns the sampler
|
||||||
typ::Sampler sampler(const Source& source, ast::SamplerKind kind) const {
|
typ::Sampler sampler(const Source& source, ast::SamplerKind kind) const {
|
||||||
return {builder->create<ast::Sampler>(source, kind),
|
return {builder->create<ast::Sampler>(source, kind)};
|
||||||
builder->create<sem::Sampler>(kind)};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @param dims the dimensionality of the texture
|
/// @param dims the dimensionality of the texture
|
||||||
|
|
|
@ -239,7 +239,6 @@ using Type = TypePair<ast::Type, sem::Type>;
|
||||||
|
|
||||||
using Matrix = TypePair<ast::Matrix, sem::Matrix>;
|
using Matrix = TypePair<ast::Matrix, sem::Matrix>;
|
||||||
using Pointer = TypePair<ast::Pointer, sem::Pointer>;
|
using Pointer = TypePair<ast::Pointer, sem::Pointer>;
|
||||||
using Sampler = TypePair<ast::Sampler, sem::Sampler>;
|
|
||||||
using Struct = TypePair<ast::Struct, sem::Struct>;
|
using Struct = TypePair<ast::Struct, sem::Struct>;
|
||||||
using Vector = TypePair<ast::Vector, sem::Vector>;
|
using Vector = TypePair<ast::Vector, sem::Vector>;
|
||||||
|
|
||||||
|
@ -254,6 +253,7 @@ using MultisampledTexture = Ptr<ast::MultisampledTexture>;
|
||||||
using SampledTexture = Ptr<ast::SampledTexture>;
|
using SampledTexture = Ptr<ast::SampledTexture>;
|
||||||
using StorageTexture = Ptr<ast::StorageTexture>;
|
using StorageTexture = Ptr<ast::StorageTexture>;
|
||||||
using Texture = Ptr<ast::Texture>;
|
using Texture = Ptr<ast::Texture>;
|
||||||
|
using Sampler = Ptr<ast::Sampler>;
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
|
|
||||||
|
|
|
@ -656,7 +656,7 @@ TEST_F(MslGeneratorImplTest, EmitType_Void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(MslGeneratorImplTest, EmitType_Sampler) {
|
TEST_F(MslGeneratorImplTest, EmitType_Sampler) {
|
||||||
auto sampler = ty.sampler(ast::SamplerKind::kSampler);
|
auto* sampler = create<sem::Sampler>(ast::SamplerKind::kSampler);
|
||||||
|
|
||||||
GeneratorImpl& gen = Build();
|
GeneratorImpl& gen = Build();
|
||||||
|
|
||||||
|
@ -665,7 +665,7 @@ TEST_F(MslGeneratorImplTest, EmitType_Sampler) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(MslGeneratorImplTest, EmitType_SamplerComparison) {
|
TEST_F(MslGeneratorImplTest, EmitType_SamplerComparison) {
|
||||||
auto sampler = ty.sampler(ast::SamplerKind::kComparisonSampler);
|
auto* sampler = create<sem::Sampler>(ast::SamplerKind::kComparisonSampler);
|
||||||
|
|
||||||
GeneratorImpl& gen = Build();
|
GeneratorImpl& gen = Build();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue