2020-10-05 14:52:36 +00:00
|
|
|
// Copyright 2020 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.
|
|
|
|
|
2020-10-16 02:26:54 +00:00
|
|
|
#ifndef SRC_INSPECTOR_ENTRY_POINT_H_
|
|
|
|
#define SRC_INSPECTOR_ENTRY_POINT_H_
|
2020-10-05 14:52:36 +00:00
|
|
|
|
2020-11-03 16:26:09 +00:00
|
|
|
#include <string>
|
2020-10-07 13:13:58 +00:00
|
|
|
#include <tuple>
|
2020-10-05 14:52:36 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "src/ast/pipeline_stage.h"
|
|
|
|
|
|
|
|
namespace tint {
|
|
|
|
namespace inspector {
|
|
|
|
|
2020-10-06 16:28:57 +00:00
|
|
|
/// Container of reflection data for an entry point in the shader.
|
2020-10-16 02:26:54 +00:00
|
|
|
typedef struct EntryPoint {
|
2020-10-08 18:38:45 +00:00
|
|
|
/// Constructors
|
|
|
|
EntryPoint();
|
2020-10-14 17:37:01 +00:00
|
|
|
/// Copy Constructor
|
2020-10-08 18:38:45 +00:00
|
|
|
EntryPoint(EntryPoint&);
|
2020-10-14 17:37:01 +00:00
|
|
|
/// Move Constructor
|
2020-10-08 18:38:45 +00:00
|
|
|
EntryPoint(EntryPoint&&);
|
|
|
|
~EntryPoint();
|
|
|
|
|
2020-10-05 14:52:36 +00:00
|
|
|
/// The entry point name
|
|
|
|
std::string name;
|
|
|
|
/// The entry point stage
|
|
|
|
ast::PipelineStage stage = ast::PipelineStage::kNone;
|
2020-10-06 17:47:57 +00:00
|
|
|
/// The workgroup x size
|
2020-10-06 16:28:57 +00:00
|
|
|
uint32_t workgroup_size_x;
|
2020-10-06 17:47:57 +00:00
|
|
|
/// The workgroup y size
|
2020-10-06 16:28:57 +00:00
|
|
|
uint32_t workgroup_size_y;
|
2020-10-06 17:47:57 +00:00
|
|
|
/// The workgroup z size
|
2020-10-06 16:28:57 +00:00
|
|
|
uint32_t workgroup_size_z;
|
2020-10-08 18:38:45 +00:00
|
|
|
/// List of the input variable accessed via this entry point.
|
|
|
|
std::vector<std::string> input_variables;
|
|
|
|
/// List of the output variable accessed via this entry point.
|
|
|
|
std::vector<std::string> output_variables;
|
2020-10-06 16:28:57 +00:00
|
|
|
|
|
|
|
/// @returns the size of the workgroup in {x,y,z} format
|
|
|
|
std::tuple<uint32_t, uint32_t, uint32_t> workgroup_size() {
|
|
|
|
return std::tuple<uint32_t, uint32_t, uint32_t>(
|
|
|
|
workgroup_size_x, workgroup_size_y, workgroup_size_z);
|
|
|
|
}
|
2020-10-16 02:26:54 +00:00
|
|
|
} EntryPoint;
|
2020-10-05 14:52:36 +00:00
|
|
|
|
|
|
|
} // namespace inspector
|
|
|
|
} // namespace tint
|
|
|
|
|
2020-10-16 02:26:54 +00:00
|
|
|
#endif // SRC_INSPECTOR_ENTRY_POINT_H_
|