mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-14 09:06:11 +00:00
Add external_texture_transform to backend writers
Adds the external texture transform to always run in the spirv, msl, and hlsl writers. Bug: dawn:728 Change-Id: I15a96e877e1e88f9a4a4b015cf47251b41b18e35 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/50024 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Reviewed-by: David Neto <dneto@google.com> Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
This commit is contained in:
parent
8f96595540
commit
c705b6caac
@ -25,6 +25,7 @@
|
|||||||
#include "src/transform/calculate_array_length.h"
|
#include "src/transform/calculate_array_length.h"
|
||||||
#include "src/transform/canonicalize_entry_point_io.h"
|
#include "src/transform/canonicalize_entry_point_io.h"
|
||||||
#include "src/transform/decompose_storage_access.h"
|
#include "src/transform/decompose_storage_access.h"
|
||||||
|
#include "src/transform/external_texture_transform.h"
|
||||||
#include "src/transform/manager.h"
|
#include "src/transform/manager.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
@ -38,6 +39,7 @@ Output Hlsl::Run(const Program* in, const DataMap& data) {
|
|||||||
manager.Add<CanonicalizeEntryPointIO>();
|
manager.Add<CanonicalizeEntryPointIO>();
|
||||||
manager.Add<DecomposeStorageAccess>();
|
manager.Add<DecomposeStorageAccess>();
|
||||||
manager.Add<CalculateArrayLength>();
|
manager.Add<CalculateArrayLength>();
|
||||||
|
manager.Add<ExternalTextureTransform>();
|
||||||
auto out = manager.Run(in, data);
|
auto out = manager.Run(in, data);
|
||||||
if (!out.program.IsValid()) {
|
if (!out.program.IsValid()) {
|
||||||
return out;
|
return out;
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "src/transform/canonicalize_entry_point_io.h"
|
#include "src/transform/canonicalize_entry_point_io.h"
|
||||||
|
#include "src/transform/external_texture_transform.h"
|
||||||
#include "src/transform/manager.h"
|
#include "src/transform/manager.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
@ -28,6 +29,7 @@ Msl::~Msl() = default;
|
|||||||
Output Msl::Run(const Program* in, const DataMap& data) {
|
Output Msl::Run(const Program* in, const DataMap& data) {
|
||||||
Manager manager;
|
Manager manager;
|
||||||
manager.Add<CanonicalizeEntryPointIO>();
|
manager.Add<CanonicalizeEntryPointIO>();
|
||||||
|
manager.Add<ExternalTextureTransform>();
|
||||||
auto out = manager.Run(in, data);
|
auto out = manager.Run(in, data);
|
||||||
if (!out.program.IsValid()) {
|
if (!out.program.IsValid()) {
|
||||||
return out;
|
return out;
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#include "src/sem/statement.h"
|
#include "src/sem/statement.h"
|
||||||
#include "src/sem/struct.h"
|
#include "src/sem/struct.h"
|
||||||
#include "src/sem/variable.h"
|
#include "src/sem/variable.h"
|
||||||
|
#include "src/transform/external_texture_transform.h"
|
||||||
|
#include "src/transform/manager.h"
|
||||||
|
|
||||||
TINT_INSTANTIATE_TYPEINFO(tint::transform::Spirv::Config);
|
TINT_INSTANTIATE_TYPEINFO(tint::transform::Spirv::Config);
|
||||||
|
|
||||||
@ -35,10 +37,14 @@ Spirv::Spirv() = default;
|
|||||||
Spirv::~Spirv() = default;
|
Spirv::~Spirv() = default;
|
||||||
|
|
||||||
Output Spirv::Run(const Program* in, const DataMap& data) {
|
Output Spirv::Run(const Program* in, const DataMap& data) {
|
||||||
|
Manager manager;
|
||||||
|
manager.Add<ExternalTextureTransform>();
|
||||||
|
auto transformedInput = manager.Run(in, data);
|
||||||
|
|
||||||
auto* cfg = data.Get<Config>();
|
auto* cfg = data.Get<Config>();
|
||||||
|
|
||||||
ProgramBuilder out;
|
ProgramBuilder out;
|
||||||
CloneContext ctx(&out, in);
|
CloneContext ctx(&out, &transformedInput.program);
|
||||||
HandleEntryPointIOTypes(ctx);
|
HandleEntryPointIOTypes(ctx);
|
||||||
ctx.Clone();
|
ctx.Clone();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user