mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
[inspector] Extract ComparisonSampler resource binding information
Adds in method to get resource binding information for comparison samplers along with tests. BUG=tint:257 Change-Id: I60f675347d2b9596308b1599d0a9b846615d547e Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31980 Commit-Queue: David Neto <dneto@google.com> Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
34f90a0097
commit
110af53089
@@ -211,6 +211,30 @@ std::vector<ResourceBinding> Inspector::GetSamplerResourceBindings(
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<ResourceBinding> Inspector::GetComparisonSamplerResourceBindings(
|
||||
const std::string& entry_point) {
|
||||
auto* func = FindEntryPointByName(entry_point);
|
||||
if (!func) {
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<ResourceBinding> result;
|
||||
|
||||
for (auto& rcs : func->referenced_comparison_sampler_variables()) {
|
||||
ResourceBinding entry;
|
||||
ast::Variable* var = nullptr;
|
||||
ast::Function::BindingInfo binding_info;
|
||||
std::tie(var, binding_info) = rcs;
|
||||
|
||||
entry.bind_group = binding_info.set->value();
|
||||
entry.binding = binding_info.binding->value();
|
||||
|
||||
result.push_back(std::move(entry));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
ast::Function* Inspector::FindEntryPointByName(const std::string& name) {
|
||||
auto* func = module_.FindFunctionByName(name);
|
||||
if (!func) {
|
||||
|
||||
Reference in New Issue
Block a user