mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 05:27:49 +00:00
resolver: Allocate IDs for named pipeline constants
Keep track of any constant IDs specified in the shader, and then allocate IDs for the remaining constants when creating the semantic info. Bug: tint:755 Change-Id: I6a76b1193cac459b62582cde7469b092dde51d5d Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/50841 Commit-Queue: James Price <jrprice@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Auto-Submit: James Price <jrprice@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Commit Bot service account
parent
8650247ddb
commit
f2f3bfc677
@@ -38,6 +38,7 @@
|
||||
#include "src/ast/member_accessor_expression.h"
|
||||
#include "src/ast/module.h"
|
||||
#include "src/ast/multisampled_texture.h"
|
||||
#include "src/ast/override_decoration.h"
|
||||
#include "src/ast/pointer.h"
|
||||
#include "src/ast/return_statement.h"
|
||||
#include "src/ast/sampled_texture.h"
|
||||
@@ -1786,6 +1787,32 @@ class ProgramBuilder {
|
||||
return create<ast::LocationDecoration>(source_, location);
|
||||
}
|
||||
|
||||
/// Creates an ast::OverrideDecoration with a specific constant ID
|
||||
/// @param source the source information
|
||||
/// @param id the id value
|
||||
/// @returns the override decoration pointer
|
||||
ast::OverrideDecoration* Override(const Source& source, uint32_t id) {
|
||||
return create<ast::OverrideDecoration>(source, id);
|
||||
}
|
||||
|
||||
/// Creates an ast::OverrideDecoration with a specific constant ID
|
||||
/// @param id the optional id value
|
||||
/// @returns the override decoration pointer
|
||||
ast::OverrideDecoration* Override(uint32_t id) {
|
||||
return Override(source_, id);
|
||||
}
|
||||
|
||||
/// Creates an ast::OverrideDecoration without a constant ID
|
||||
/// @param source the source information
|
||||
/// @returns the override decoration pointer
|
||||
ast::OverrideDecoration* Override(const Source& source) {
|
||||
return create<ast::OverrideDecoration>(source);
|
||||
}
|
||||
|
||||
/// Creates an ast::OverrideDecoration without a constant ID
|
||||
/// @returns the override decoration pointer
|
||||
ast::OverrideDecoration* Override() { return Override(source_); }
|
||||
|
||||
/// Creates an ast::StageDecoration
|
||||
/// @param source the source information
|
||||
/// @param stage the pipeline stage
|
||||
|
||||
Reference in New Issue
Block a user