Split `BindingPoint` out of MultiplanarExternalTexture.
This CL moves the `using` statement for `BindingPoint` out to its own file in `src/tint/writer/binding_point.h`. Usages of `tint::transform::BindingPoint` have been updated to `tint::writer::BindingPoint`. Bug: tint:1855 Change-Id: Ife7d92807e0a65b93f21158d73a60d5068fc5da9 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/123000 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
parent
068eb3ebda
commit
eebbdef81a
|
@ -37,6 +37,7 @@
|
||||||
#include "src/tint/transform/vertex_pulling.h"
|
#include "src/tint/transform/vertex_pulling.h"
|
||||||
#include "src/tint/type/manager.h"
|
#include "src/tint/type/manager.h"
|
||||||
#include "src/tint/writer/array_length_from_uniform_options.h"
|
#include "src/tint/writer/array_length_from_uniform_options.h"
|
||||||
|
#include "src/tint/writer/binding_point.h"
|
||||||
#include "src/tint/writer/flatten_bindings.h"
|
#include "src/tint/writer/flatten_bindings.h"
|
||||||
#include "src/tint/writer/writer.h"
|
#include "src/tint/writer/writer.h"
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,8 @@ void stream::Stream<tint::Program>::Write(stream::Sink* sink, const tint::Progra
|
||||||
|
|
||||||
// static
|
// static
|
||||||
template <>
|
template <>
|
||||||
void stream::Stream<tint::sem::BindingPoint>::Write(stream::Sink* sink,
|
void stream::Stream<tint::writer::BindingPoint>::Write(stream::Sink* sink,
|
||||||
const tint::sem::BindingPoint& point) {
|
const tint::writer::BindingPoint& point) {
|
||||||
StreamInTintObject(point, sink);
|
StreamInTintObject(point, sink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -383,7 +383,7 @@ ResultOrError<std::string> TranslateToHLSL(
|
||||||
options.disable_workgroup_init = r.disableWorkgroupInit;
|
options.disable_workgroup_init = r.disableWorkgroupInit;
|
||||||
if (r.usesNumWorkgroups) {
|
if (r.usesNumWorkgroups) {
|
||||||
options.root_constant_binding_point =
|
options.root_constant_binding_point =
|
||||||
tint::sem::BindingPoint{r.numWorkgroupsRegisterSpace, r.numWorkgroupsShaderRegister};
|
tint::writer::BindingPoint{r.numWorkgroupsRegisterSpace, r.numWorkgroupsShaderRegister};
|
||||||
}
|
}
|
||||||
// TODO(dawn:549): HLSL generation outputs the indices into the
|
// TODO(dawn:549): HLSL generation outputs the indices into the
|
||||||
// array_length_from_uniform buffer that were actually used. When the blob cache can
|
// array_length_from_uniform buffer that were actually used. When the blob cache can
|
||||||
|
@ -523,8 +523,8 @@ ResultOrError<CompiledShader> ShaderModule::Compile(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
using tint::transform::BindingPoint;
|
|
||||||
using tint::transform::BindingRemapper;
|
using tint::transform::BindingRemapper;
|
||||||
|
using tint::writer::BindingPoint;
|
||||||
|
|
||||||
BindingRemapper::BindingPoints remappedBindingPoints;
|
BindingRemapper::BindingPoints remappedBindingPoints;
|
||||||
BindingRemapper::AccessControls remappedAccessControls;
|
BindingRemapper::AccessControls remappedAccessControls;
|
||||||
|
|
|
@ -111,7 +111,7 @@ ResultOrError<CacheResult<MslCompilation>> TranslateToMSL(
|
||||||
|
|
||||||
// Remap BindingNumber to BindingIndex in WGSL shader
|
// Remap BindingNumber to BindingIndex in WGSL shader
|
||||||
using BindingRemapper = tint::transform::BindingRemapper;
|
using BindingRemapper = tint::transform::BindingRemapper;
|
||||||
using BindingPoint = tint::transform::BindingPoint;
|
using BindingPoint = tint::writer::BindingPoint;
|
||||||
BindingRemapper::BindingPoints bindingPoints;
|
BindingRemapper::BindingPoints bindingPoints;
|
||||||
|
|
||||||
for (BindGroupIndex group : IterateBitSet(layout->GetBindGroupLayoutsMask())) {
|
for (BindGroupIndex group : IterateBitSet(layout->GetBindGroupLayoutsMask())) {
|
||||||
|
|
|
@ -55,7 +55,7 @@ tint::writer::glsl::Version::Standard ToTintGLStandard(opengl::OpenGLVersion::St
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
using BindingMap = std::unordered_map<tint::sem::BindingPoint, tint::sem::BindingPoint>;
|
using BindingMap = std::unordered_map<tint::writer::BindingPoint, tint::writer::BindingPoint>;
|
||||||
|
|
||||||
#define GLSL_COMPILATION_REQUEST_MEMBERS(X) \
|
#define GLSL_COMPILATION_REQUEST_MEMBERS(X) \
|
||||||
X(const tint::Program*, inputProgram) \
|
X(const tint::Program*, inputProgram) \
|
||||||
|
@ -148,14 +148,14 @@ ResultOrError<GLuint> ShaderModule::CompileShader(const OpenGLFunctions& gl,
|
||||||
|
|
||||||
const OpenGLVersion& version = ToBackend(GetDevice())->GetGL().GetVersion();
|
const OpenGLVersion& version = ToBackend(GetDevice())->GetGL().GetVersion();
|
||||||
|
|
||||||
using tint::transform::BindingPoint;
|
using tint::writer::BindingPoint;
|
||||||
// Since (non-Vulkan) GLSL does not support descriptor sets, generate a
|
// Since (non-Vulkan) GLSL does not support descriptor sets, generate a
|
||||||
// mapping from the original group/binding pair to a binding-only
|
// mapping from the original group/binding pair to a binding-only
|
||||||
// value. This mapping will be used by Tint to remap all global
|
// value. This mapping will be used by Tint to remap all global
|
||||||
// variables to the 1D space.
|
// variables to the 1D space.
|
||||||
const BindingInfoArray& moduleBindingInfo =
|
const BindingInfoArray& moduleBindingInfo =
|
||||||
GetEntryPoint(programmableStage.entryPoint).bindings;
|
GetEntryPoint(programmableStage.entryPoint).bindings;
|
||||||
std::unordered_map<tint::sem::BindingPoint, tint::sem::BindingPoint> glBindings;
|
std::unordered_map<tint::writer::BindingPoint, tint::writer::BindingPoint> glBindings;
|
||||||
for (BindGroupIndex group : IterateBitSet(layout->GetBindGroupLayoutsMask())) {
|
for (BindGroupIndex group : IterateBitSet(layout->GetBindGroupLayoutsMask())) {
|
||||||
const BindGroupLayoutBase* bgl = layout->GetBindGroupLayout(group);
|
const BindGroupLayoutBase* bgl = layout->GetBindGroupLayout(group);
|
||||||
const auto& groupBindingInfo = moduleBindingInfo[group];
|
const auto& groupBindingInfo = moduleBindingInfo[group];
|
||||||
|
|
|
@ -205,7 +205,7 @@ ResultOrError<ShaderModule::ModuleAndSpirv> ShaderModule::GetHandleAndSpirv(
|
||||||
|
|
||||||
// Remap BindingNumber to BindingIndex in WGSL shader
|
// Remap BindingNumber to BindingIndex in WGSL shader
|
||||||
using BindingRemapper = tint::transform::BindingRemapper;
|
using BindingRemapper = tint::transform::BindingRemapper;
|
||||||
using BindingPoint = tint::transform::BindingPoint;
|
using BindingPoint = tint::writer::BindingPoint;
|
||||||
BindingRemapper::BindingPoints bindingPoints;
|
BindingRemapper::BindingPoints bindingPoints;
|
||||||
|
|
||||||
const BindingInfoArray& moduleBindingInfo =
|
const BindingInfoArray& moduleBindingInfo =
|
||||||
|
|
|
@ -253,9 +253,9 @@ TEST(SerializeTests, StdUnorderedMap) {
|
||||||
EXPECT_CACHE_KEY_EQ(m, expected);
|
EXPECT_CACHE_KEY_EQ(m, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test that ByteVectorSink serializes tint::sem::BindingPoint as expected.
|
// Test that ByteVectorSink serializes tint::writer::BindingPoint as expected.
|
||||||
TEST(SerializeTests, TintSemBindingPoint) {
|
TEST(SerializeTests, TintSemBindingPoint) {
|
||||||
tint::sem::BindingPoint bp{3, 6};
|
tint::writer::BindingPoint bp{3, 6};
|
||||||
|
|
||||||
ByteVectorSink expected;
|
ByteVectorSink expected;
|
||||||
StreamIn(&expected, uint32_t(3), uint32_t(6));
|
StreamIn(&expected, uint32_t(3), uint32_t(6));
|
||||||
|
@ -263,11 +263,12 @@ TEST(SerializeTests, TintSemBindingPoint) {
|
||||||
EXPECT_CACHE_KEY_EQ(bp, expected);
|
EXPECT_CACHE_KEY_EQ(bp, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test that ByteVectorSink serializes tint::transform::BindingPoints as expected.
|
// Test that ByteVectorSink serializes tint::transform::MultiplanarExternalTexture::BindingPoints
|
||||||
|
// as expected.
|
||||||
TEST(SerializeTests, TintTransformBindingPoints) {
|
TEST(SerializeTests, TintTransformBindingPoints) {
|
||||||
tint::transform::MultiplanarExternalTexture::BindingPoints points{
|
tint::transform::MultiplanarExternalTexture::BindingPoints points{
|
||||||
tint::sem::BindingPoint{1, 4},
|
tint::writer::BindingPoint{1, 4},
|
||||||
tint::sem::BindingPoint{3, 7},
|
tint::writer::BindingPoint{3, 7},
|
||||||
};
|
};
|
||||||
|
|
||||||
ByteVectorSink expected;
|
ByteVectorSink expected;
|
||||||
|
|
|
@ -895,6 +895,7 @@ libtint_source_set("libtint_writer_src") {
|
||||||
"writer/append_vector.h",
|
"writer/append_vector.h",
|
||||||
"writer/array_length_from_uniform_options.cc",
|
"writer/array_length_from_uniform_options.cc",
|
||||||
"writer/array_length_from_uniform_options.h",
|
"writer/array_length_from_uniform_options.h",
|
||||||
|
"writer/binding_point.h",
|
||||||
"writer/check_supported_extensions.cc",
|
"writer/check_supported_extensions.cc",
|
||||||
"writer/check_supported_extensions.h",
|
"writer/check_supported_extensions.h",
|
||||||
"writer/flatten_bindings.cc",
|
"writer/flatten_bindings.cc",
|
||||||
|
|
|
@ -539,6 +539,7 @@ list(APPEND TINT_LIB_SRCS
|
||||||
writer/append_vector.h
|
writer/append_vector.h
|
||||||
writer/array_length_from_uniform_options.cc
|
writer/array_length_from_uniform_options.cc
|
||||||
writer/array_length_from_uniform_options.h
|
writer/array_length_from_uniform_options.h
|
||||||
|
writer/binding_point.h
|
||||||
writer/check_supported_extensions.cc
|
writer/check_supported_extensions.cc
|
||||||
writer/check_supported_extensions.h
|
writer/check_supported_extensions.h
|
||||||
writer/flatten_bindings.cc
|
writer/flatten_bindings.cc
|
||||||
|
|
|
@ -1016,7 +1016,7 @@ int main(int argc, const char** argv) {
|
||||||
std::unordered_set<uint32_t> group0_bindings_in_use;
|
std::unordered_set<uint32_t> group0_bindings_in_use;
|
||||||
auto allocate_binding = [&] {
|
auto allocate_binding = [&] {
|
||||||
for (uint32_t idx = 0;; idx++) {
|
for (uint32_t idx = 0;; idx++) {
|
||||||
auto binding = tint::transform::BindingPoint{0u, idx};
|
auto binding = tint::writer::BindingPoint{0u, idx};
|
||||||
if (group0_bindings_in_use.emplace(idx).second) {
|
if (group0_bindings_in_use.emplace(idx).second) {
|
||||||
return binding;
|
return binding;
|
||||||
}
|
}
|
||||||
|
@ -1034,7 +1034,7 @@ int main(int argc, const char** argv) {
|
||||||
MET::BindingsMap met_bindings;
|
MET::BindingsMap met_bindings;
|
||||||
for (auto ep : inspector.GetEntryPoints()) {
|
for (auto ep : inspector.GetEntryPoints()) {
|
||||||
for (auto ext_tex : inspector.GetExternalTextureResourceBindings(ep.name)) {
|
for (auto ext_tex : inspector.GetExternalTextureResourceBindings(ep.name)) {
|
||||||
auto binding = tint::transform::BindingPoint{
|
auto binding = tint::writer::BindingPoint{
|
||||||
ext_tex.bind_group,
|
ext_tex.bind_group,
|
||||||
ext_tex.binding,
|
ext_tex.binding,
|
||||||
};
|
};
|
||||||
|
|
|
@ -121,7 +121,7 @@ struct MultiplanarExternalTexture::State {
|
||||||
// The binding points for the newly introduced bindings must have been provided to this
|
// The binding points for the newly introduced bindings must have been provided to this
|
||||||
// transform. We fetch the new binding points by providing the original texture_external
|
// transform. We fetch the new binding points by providing the original texture_external
|
||||||
// binding points into the passed map.
|
// binding points into the passed map.
|
||||||
BindingPoint bp = sem_var->BindingPoint();
|
sem::BindingPoint bp = sem_var->BindingPoint();
|
||||||
|
|
||||||
BindingsMap::const_iterator it = new_binding_points->bindings_map.find(bp);
|
BindingsMap::const_iterator it = new_binding_points->bindings_map.find(bp);
|
||||||
if (it == new_binding_points->bindings_map.end()) {
|
if (it == new_binding_points->bindings_map.end()) {
|
||||||
|
@ -494,6 +494,7 @@ struct MultiplanarExternalTexture::State {
|
||||||
|
|
||||||
MultiplanarExternalTexture::NewBindingPoints::NewBindingPoints(BindingsMap inputBindingsMap)
|
MultiplanarExternalTexture::NewBindingPoints::NewBindingPoints(BindingsMap inputBindingsMap)
|
||||||
: bindings_map(std::move(inputBindingsMap)) {}
|
: bindings_map(std::move(inputBindingsMap)) {}
|
||||||
|
|
||||||
MultiplanarExternalTexture::NewBindingPoints::~NewBindingPoints() = default;
|
MultiplanarExternalTexture::NewBindingPoints::~NewBindingPoints() = default;
|
||||||
|
|
||||||
MultiplanarExternalTexture::MultiplanarExternalTexture() = default;
|
MultiplanarExternalTexture::MultiplanarExternalTexture() = default;
|
||||||
|
|
|
@ -25,9 +25,6 @@
|
||||||
|
|
||||||
namespace tint::transform {
|
namespace tint::transform {
|
||||||
|
|
||||||
/// BindingPoint is an alias to sem::BindingPoint
|
|
||||||
using BindingPoint = sem::BindingPoint;
|
|
||||||
|
|
||||||
/// Within the MultiplanarExternalTexture transform, each instance of a
|
/// Within the MultiplanarExternalTexture transform, each instance of a
|
||||||
/// texture_external binding is unpacked into two texture_2d<f32> bindings
|
/// texture_external binding is unpacked into two texture_2d<f32> bindings
|
||||||
/// representing two possible planes of a texture and a uniform buffer binding
|
/// representing two possible planes of a texture and a uniform buffer binding
|
||||||
|
@ -46,10 +43,10 @@ class MultiplanarExternalTexture final : public Castable<MultiplanarExternalText
|
||||||
struct BindingPoints {
|
struct BindingPoints {
|
||||||
/// The desired binding location of the texture_2d representing plane #1 when
|
/// The desired binding location of the texture_2d representing plane #1 when
|
||||||
/// a texture_external binding is expanded.
|
/// a texture_external binding is expanded.
|
||||||
BindingPoint plane_1;
|
sem::BindingPoint plane_1;
|
||||||
/// The desired binding location of the ExternalTextureParams uniform when a
|
/// The desired binding location of the ExternalTextureParams uniform when a
|
||||||
/// texture_external binding is expanded.
|
/// texture_external binding is expanded.
|
||||||
BindingPoint params;
|
sem::BindingPoint params;
|
||||||
|
|
||||||
/// Reflect the fields of this class so that it can be used by tint::ForeachField()
|
/// Reflect the fields of this class so that it can be used by tint::ForeachField()
|
||||||
TINT_REFLECT(plane_1, params);
|
TINT_REFLECT(plane_1, params);
|
||||||
|
@ -58,7 +55,7 @@ class MultiplanarExternalTexture final : public Castable<MultiplanarExternalText
|
||||||
/// BindingsMap is a map where the key is the binding location of a
|
/// BindingsMap is a map where the key is the binding location of a
|
||||||
/// texture_external and the value is a struct containing the desired
|
/// texture_external and the value is a struct containing the desired
|
||||||
/// locations for new bindings expanded from the texture_external instance.
|
/// locations for new bindings expanded from the texture_external instance.
|
||||||
using BindingsMap = std::unordered_map<BindingPoint, BindingPoints>;
|
using BindingsMap = std::unordered_map<sem::BindingPoint, BindingPoints>;
|
||||||
|
|
||||||
/// NewBindingPoints is consumed by the MultiplanarExternalTexture transform.
|
/// NewBindingPoints is consumed by the MultiplanarExternalTexture transform.
|
||||||
/// Data holds information about location of each texture_external binding and
|
/// Data holds information about location of each texture_external binding and
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "src/tint/sem/binding_point.h"
|
#include "src/tint/writer/binding_point.h"
|
||||||
|
|
||||||
namespace tint::writer {
|
namespace tint::writer {
|
||||||
|
|
||||||
|
@ -38,10 +38,10 @@ struct ArrayLengthFromUniformOptions {
|
||||||
|
|
||||||
/// The binding point to use to generate a uniform buffer from which to read
|
/// The binding point to use to generate a uniform buffer from which to read
|
||||||
/// buffer sizes.
|
/// buffer sizes.
|
||||||
sem::BindingPoint ubo_binding;
|
BindingPoint ubo_binding;
|
||||||
/// The mapping from storage buffer binding points to the index into the
|
/// The mapping from storage buffer binding points to the index into the
|
||||||
/// uniform buffer where the length of the buffer is stored.
|
/// uniform buffer where the length of the buffer is stored.
|
||||||
std::unordered_map<sem::BindingPoint, uint32_t> bindpoint_to_size_index;
|
std::unordered_map<BindingPoint, uint32_t> bindpoint_to_size_index;
|
||||||
|
|
||||||
/// Reflect the fields of this class so that it can be used by tint::ForeachField()
|
/// Reflect the fields of this class so that it can be used by tint::ForeachField()
|
||||||
TINT_REFLECT(ubo_binding, bindpoint_to_size_index);
|
TINT_REFLECT(ubo_binding, bindpoint_to_size_index);
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
// Copyright 2023 The Tint Authors.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#ifndef SRC_TINT_WRITER_BINDING_POINT_H_
|
||||||
|
#define SRC_TINT_WRITER_BINDING_POINT_H_
|
||||||
|
|
||||||
|
#include "src/tint/sem/binding_point.h"
|
||||||
|
|
||||||
|
namespace tint::writer {
|
||||||
|
|
||||||
|
/// BindingPoint is an alias to sem::BindingPoint
|
||||||
|
using BindingPoint = sem::BindingPoint;
|
||||||
|
|
||||||
|
} // namespace tint::writer
|
||||||
|
|
||||||
|
#endif // SRC_TINT_WRITER_BINDING_POINT_H_
|
|
@ -19,11 +19,12 @@
|
||||||
#include "src/tint/inspector/inspector.h"
|
#include "src/tint/inspector/inspector.h"
|
||||||
#include "src/tint/transform/binding_remapper.h"
|
#include "src/tint/transform/binding_remapper.h"
|
||||||
#include "src/tint/transform/manager.h"
|
#include "src/tint/transform/manager.h"
|
||||||
|
#include "src/tint/writer/binding_point.h"
|
||||||
|
|
||||||
namespace tint::writer {
|
namespace tint::writer {
|
||||||
|
|
||||||
std::optional<Program> FlattenBindings(const Program* program) {
|
std::optional<Program> FlattenBindings(const Program* program) {
|
||||||
// TODO(crbug.com/tint/1101): Make this more robust for multiple entry points.
|
// TODO(crbug.com/tint/1101): Make this more robust for multiple entry points.
|
||||||
using BindingPoint = tint::transform::BindingPoint;
|
|
||||||
tint::transform::BindingRemapper::BindingPoints binding_points;
|
tint::transform::BindingRemapper::BindingPoints binding_points;
|
||||||
uint32_t next_buffer_idx = 0;
|
uint32_t next_buffer_idx = 0;
|
||||||
uint32_t next_sampler_idx = 0;
|
uint32_t next_sampler_idx = 0;
|
||||||
|
@ -76,4 +77,5 @@ std::optional<Program> FlattenBindings(const Program* program) {
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace tint::writer
|
} // namespace tint::writer
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "src/tint/program_builder.h"
|
#include "src/tint/program_builder.h"
|
||||||
|
#include "src/tint/writer/binding_point.h"
|
||||||
#include "src/tint/writer/generate_external_texture_bindings.h"
|
#include "src/tint/writer/generate_external_texture_bindings.h"
|
||||||
|
|
||||||
namespace tint::writer {
|
namespace tint::writer {
|
||||||
|
@ -45,7 +46,7 @@ TEST_F(GenerateExternalTextureBindingsTest, One) {
|
||||||
auto bindings = GenerateExternalTextureBindings(&program);
|
auto bindings = GenerateExternalTextureBindings(&program);
|
||||||
ASSERT_EQ(bindings.size(), 1u);
|
ASSERT_EQ(bindings.size(), 1u);
|
||||||
|
|
||||||
auto to = bindings[transform::BindingPoint{0, 0}];
|
auto to = bindings[writer::BindingPoint{0, 0}];
|
||||||
ASSERT_EQ(to.plane_1.group, 0u);
|
ASSERT_EQ(to.plane_1.group, 0u);
|
||||||
ASSERT_EQ(to.params.group, 0u);
|
ASSERT_EQ(to.params.group, 0u);
|
||||||
ASSERT_EQ(to.plane_1.binding, 1u);
|
ASSERT_EQ(to.plane_1.binding, 1u);
|
||||||
|
@ -62,13 +63,13 @@ TEST_F(GenerateExternalTextureBindingsTest, Two_SameGroup) {
|
||||||
auto bindings = GenerateExternalTextureBindings(&program);
|
auto bindings = GenerateExternalTextureBindings(&program);
|
||||||
ASSERT_EQ(bindings.size(), 2u);
|
ASSERT_EQ(bindings.size(), 2u);
|
||||||
|
|
||||||
auto to0 = bindings[transform::BindingPoint{0, 0}];
|
auto to0 = bindings[writer::BindingPoint{0, 0}];
|
||||||
ASSERT_EQ(to0.plane_1.group, 0u);
|
ASSERT_EQ(to0.plane_1.group, 0u);
|
||||||
ASSERT_EQ(to0.params.group, 0u);
|
ASSERT_EQ(to0.params.group, 0u);
|
||||||
ASSERT_EQ(to0.plane_1.binding, 2u);
|
ASSERT_EQ(to0.plane_1.binding, 2u);
|
||||||
ASSERT_EQ(to0.params.binding, 3u);
|
ASSERT_EQ(to0.params.binding, 3u);
|
||||||
|
|
||||||
auto to1 = bindings[transform::BindingPoint{0, 1}];
|
auto to1 = bindings[writer::BindingPoint{0, 1}];
|
||||||
ASSERT_EQ(to1.plane_1.group, 0u);
|
ASSERT_EQ(to1.plane_1.group, 0u);
|
||||||
ASSERT_EQ(to1.params.group, 0u);
|
ASSERT_EQ(to1.params.group, 0u);
|
||||||
ASSERT_EQ(to1.plane_1.binding, 4u);
|
ASSERT_EQ(to1.plane_1.binding, 4u);
|
||||||
|
@ -85,13 +86,13 @@ TEST_F(GenerateExternalTextureBindingsTest, Two_DifferentGroup) {
|
||||||
auto bindings = GenerateExternalTextureBindings(&program);
|
auto bindings = GenerateExternalTextureBindings(&program);
|
||||||
ASSERT_EQ(bindings.size(), 2u);
|
ASSERT_EQ(bindings.size(), 2u);
|
||||||
|
|
||||||
auto to0 = bindings[transform::BindingPoint{0, 0}];
|
auto to0 = bindings[writer::BindingPoint{0, 0}];
|
||||||
ASSERT_EQ(to0.plane_1.group, 0u);
|
ASSERT_EQ(to0.plane_1.group, 0u);
|
||||||
ASSERT_EQ(to0.params.group, 0u);
|
ASSERT_EQ(to0.params.group, 0u);
|
||||||
ASSERT_EQ(to0.plane_1.binding, 1u);
|
ASSERT_EQ(to0.plane_1.binding, 1u);
|
||||||
ASSERT_EQ(to0.params.binding, 2u);
|
ASSERT_EQ(to0.params.binding, 2u);
|
||||||
|
|
||||||
auto to1 = bindings[transform::BindingPoint{1, 0}];
|
auto to1 = bindings[writer::BindingPoint{1, 0}];
|
||||||
ASSERT_EQ(to1.plane_1.group, 1u);
|
ASSERT_EQ(to1.plane_1.group, 1u);
|
||||||
ASSERT_EQ(to1.params.group, 1u);
|
ASSERT_EQ(to1.params.group, 1u);
|
||||||
ASSERT_EQ(to1.plane_1.binding, 1u);
|
ASSERT_EQ(to1.plane_1.binding, 1u);
|
||||||
|
@ -111,13 +112,13 @@ TEST_F(GenerateExternalTextureBindingsTest, Two_WithOtherBindingsInSameGroup) {
|
||||||
auto bindings = GenerateExternalTextureBindings(&program);
|
auto bindings = GenerateExternalTextureBindings(&program);
|
||||||
ASSERT_EQ(bindings.size(), 2u);
|
ASSERT_EQ(bindings.size(), 2u);
|
||||||
|
|
||||||
auto to0 = bindings[transform::BindingPoint{0, 1}];
|
auto to0 = bindings[writer::BindingPoint{0, 1}];
|
||||||
ASSERT_EQ(to0.plane_1.group, 0u);
|
ASSERT_EQ(to0.plane_1.group, 0u);
|
||||||
ASSERT_EQ(to0.params.group, 0u);
|
ASSERT_EQ(to0.params.group, 0u);
|
||||||
ASSERT_EQ(to0.plane_1.binding, 5u);
|
ASSERT_EQ(to0.plane_1.binding, 5u);
|
||||||
ASSERT_EQ(to0.params.binding, 6u);
|
ASSERT_EQ(to0.params.binding, 6u);
|
||||||
|
|
||||||
auto to1 = bindings[transform::BindingPoint{0, 3}];
|
auto to1 = bindings[writer::BindingPoint{0, 3}];
|
||||||
ASSERT_EQ(to1.plane_1.group, 0u);
|
ASSERT_EQ(to1.plane_1.group, 0u);
|
||||||
ASSERT_EQ(to1.params.group, 0u);
|
ASSERT_EQ(to1.params.group, 0u);
|
||||||
ASSERT_EQ(to1.plane_1.binding, 7u);
|
ASSERT_EQ(to1.plane_1.binding, 7u);
|
||||||
|
|
Loading…
Reference in New Issue