Tint/HLSL: Support translating pixel local variables on HLSL
This patch implements the translation of pixel local variables on
Tint HLSL backend. All the read-write storage textures with the
internal attribute "PixelLocal" will be translated into
RasterizerOrderedTexture2D with the format specified in
PixelLocalOptions.
Bug: tint:2083
Change-Id: Icd1d675c8da14ee42790781b4e61ff0fcfafee32
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/160682
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
diff --git a/src/tint/api/options/pixel_local.h b/src/tint/api/options/pixel_local.h
index 720fcb6..d8f22ce 100644
--- a/src/tint/api/options/pixel_local.h
+++ b/src/tint/api/options/pixel_local.h
@@ -39,8 +39,21 @@
/// Index of pixel_local structure member index to attachment index
std::unordered_map<uint32_t, uint32_t> attachments;
+ /// The supported pixel local storage attachment format
+ enum class TexelFormat : uint8_t {
+ kR32Sint,
+ kR32Uint,
+ kR32Float,
+ kUndefined,
+ };
+ /// Index of pixel_local structure member index to pixel local storage attachment format
+ std::unordered_map<uint32_t, TexelFormat> attachment_formats;
+
+ /// The bind group index of all pixel local storage attachments
+ uint32_t pixel_local_group_index;
+
/// Reflect the fields of this class so that it can be used by tint::ForeachField()
- TINT_REFLECT(attachments);
+ TINT_REFLECT(attachments, attachment_formats, pixel_local_group_index);
};
} // namespace tint
diff --git a/src/tint/cmd/tint/main.cc b/src/tint/cmd/tint/main.cc
index 7ae374d..b873d1f 100644
--- a/src/tint/cmd/tint/main.cc
+++ b/src/tint/cmd/tint/main.cc
@@ -375,6 +375,22 @@
attachment.
)");
+ auto& pixel_local_attachment_formats =
+ options.Add<StringOption>("pixel_local_attachment_formats",
+ R"(Pixel local storage attachment formats, comma-separated
+Each binding is of the form MEMBER_INDEX=ATTACHMENT_FORMAT,
+where MEMBER_INDEX is the pixel-local structure member
+index and ATTACHMENT_FORMAT is the format of the emitted
+attachment, which can only be one of the below value:
+R32Sint, R32Uint, R32Float.
+)");
+
+ auto& pixel_local_group_index = options.Add<ValueOption<uint32_t>>(
+ "pixel_local_group_index",
+ R"(The bind group index of the pixel local attachments (default 0).
+)",
+ Default{0});
+
auto& skip_hash = options.Add<StringOption>(
"skip-hash", R"(Skips validation if the hash of the output is equal to any
of the hash codes in the comma separated list of hashes)");
@@ -481,6 +497,43 @@
}
}
+ if (pixel_local_group_index.value.has_value()) {
+ opts->pixel_local_options.pixel_local_group_index = *pixel_local_group_index.value;
+ }
+
+ if (pixel_local_attachment_formats.value.has_value()) {
+ auto binding_formats = tint::Split(*pixel_local_attachment_formats.value, ",");
+ for (auto& binding_format : binding_formats) {
+ auto values = tint::Split(binding_format, "=");
+ if (values.Length() != 2) {
+ std::cerr << "Invalid binding format " << pixel_local_attachment_formats.name
+ << ": " << binding_format << std::endl;
+ return false;
+ }
+ auto member_index = tint::ParseUint32(values[0]);
+ if (!member_index) {
+ std::cerr << "Invalid member index for " << pixel_local_attachment_formats.name
+ << ": " << values[0] << std::endl;
+ return false;
+ }
+ auto format = values[1];
+ tint::PixelLocalOptions::TexelFormat texel_format =
+ tint::PixelLocalOptions::TexelFormat::kUndefined;
+ if (format == "R32Sint") {
+ texel_format = tint::PixelLocalOptions::TexelFormat::kR32Sint;
+ } else if (format == "R32Uint") {
+ texel_format = tint::PixelLocalOptions::TexelFormat::kR32Uint;
+ } else if (format == "R32Float") {
+ texel_format = tint::PixelLocalOptions::TexelFormat::kR32Float;
+ } else {
+ std::cerr << "Invalid texel format for " << pixel_local_attachments.name << ": "
+ << format << std::endl;
+ return false;
+ }
+ opts->pixel_local_options.attachment_formats.emplace(member_index.Get(), texel_format);
+ }
+ }
+
auto files = result.Get();
if (files.Length() > 1) {
std::cerr << "More than one input file specified: "
@@ -782,6 +835,7 @@
gen_options.external_texture_options.bindings_map =
tint::cmd::GenerateExternalTextureBindings(program);
gen_options.root_constant_binding_point = options.hlsl_root_constant_binding_point;
+ gen_options.pixel_local_options = options.pixel_local_options;
auto result = tint::hlsl::writer::Generate(program, gen_options);
if (!result) {
tint::cmd::PrintWGSL(std::cerr, program);
diff --git a/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc b/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
index 6f883e5..4c478a5 100644
--- a/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
@@ -50,6 +50,7 @@
#include "src/tint/lang/hlsl/writer/ast_raise/decompose_memory_access.h"
#include "src/tint/lang/hlsl/writer/ast_raise/localize_struct_array_assignment.h"
#include "src/tint/lang/hlsl/writer/ast_raise/num_workgroups_from_uniform.h"
+#include "src/tint/lang/hlsl/writer/ast_raise/pixel_local.h"
#include "src/tint/lang/hlsl/writer/ast_raise/remove_continue_in_switch.h"
#include "src/tint/lang/hlsl/writer/ast_raise/truncate_interstage_variables.h"
#include "src/tint/lang/wgsl/ast/call_statement.h"
@@ -270,6 +271,34 @@
manager.Add<ast::transform::ZeroInitWorkgroupMemory>();
}
+ {
+ PixelLocal::Config cfg;
+ for (auto it : options.pixel_local_options.attachments) {
+ cfg.pls_member_to_rov_reg.Add(it.first, it.second);
+ }
+ for (auto it : options.pixel_local_options.attachment_formats) {
+ core::TexelFormat format = core::TexelFormat::kUndefined;
+ switch (it.second) {
+ case PixelLocalOptions::TexelFormat::kR32Sint:
+ format = core::TexelFormat::kR32Sint;
+ break;
+ case PixelLocalOptions::TexelFormat::kR32Uint:
+ format = core::TexelFormat::kR32Uint;
+ break;
+ case PixelLocalOptions::TexelFormat::kR32Float:
+ format = core::TexelFormat::kR32Float;
+ break;
+ default:
+ TINT_ICE() << "missing texel format for pixel local storage attachment";
+ return SanitizedResult();
+ }
+ cfg.pls_member_to_rov_format.Add(it.first, format);
+ }
+ cfg.rov_group_index = options.pixel_local_options.pixel_local_group_index;
+ data.Add<PixelLocal::Config>(cfg);
+ manager.Add<PixelLocal>();
+ }
+
// CanonicalizeEntryPointIO must come after Robustness
manager.Add<ast::transform::CanonicalizeEntryPointIO>();
@@ -361,6 +390,7 @@
wgsl::Extension::kChromiumExperimentalSubgroups,
wgsl::Extension::kF16,
wgsl::Extension::kChromiumInternalDualSourceBlending,
+ wgsl::Extension::kChromiumExperimentalPixelLocal,
})) {
return false;
}
@@ -3378,7 +3408,22 @@
auto name = var->name->symbol.Name();
auto* type = sem->Type()->UnwrapRef();
- if (!EmitTypeAndName(out, type, sem->AddressSpace(), sem->Access(), name)) {
+ if (ast::HasAttribute<PixelLocal::RasterizerOrderedView>(var->attributes)) {
+ TINT_ASSERT(!type->Is<core::type::MultisampledTexture>());
+ auto* storage = type->As<core::type::StorageTexture>();
+ if (!storage) {
+ TINT_ICE() << "Rasterizer Ordered View type isn't storage texture";
+ return false;
+ }
+ out << "RasterizerOrderedTexture2D";
+ auto* component = image_format_to_rwtexture_type(storage->texel_format());
+ if (TINT_UNLIKELY(!component)) {
+ TINT_ICE() << "Unsupported StorageTexture TexelFormat: "
+ << static_cast<int>(storage->texel_format());
+ return false;
+ }
+ out << "<" << component << "> " << name;
+ } else if (!EmitTypeAndName(out, type, sem->AddressSpace(), sem->Access(), name)) {
return false;
}
diff --git a/src/tint/lang/hlsl/writer/common/options.h b/src/tint/lang/hlsl/writer/common/options.h
index e8d5cc0..1ff17bb 100644
--- a/src/tint/lang/hlsl/writer/common/options.h
+++ b/src/tint/lang/hlsl/writer/common/options.h
@@ -37,6 +37,7 @@
#include "src/tint/api/options/array_length_from_uniform.h"
#include "src/tint/api/options/binding_remapper.h"
#include "src/tint/api/options/external_texture.h"
+#include "src/tint/api/options/pixel_local.h"
#include "src/tint/lang/core/access.h"
#include "src/tint/utils/reflection/reflection.h"
@@ -93,6 +94,9 @@
/// AccessControls is a map of old binding point to new access control
std::unordered_map<BindingPoint, core::Access> access_controls;
+ /// Options used to deal with pixel local storage variables
+ PixelLocalOptions pixel_local_options = {};
+
/// Reflect the fields of this class so that it can be used by tint::ForeachField()
TINT_REFLECT(disable_robustness,
disable_workgroup_init,
@@ -104,7 +108,8 @@
external_texture_options,
binding_remapper_options,
binding_points_ignored_in_robustness_transform,
- access_controls);
+ access_controls,
+ pixel_local_options);
};
} // namespace tint::hlsl::writer
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl
index f9fbbad..588d092 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.dxc.hlsl
index 63afc81..56c7995 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.dxc.hlsl
@@ -1,22 +1,49 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f(@builtin(position) pos : vec4f) {
- P.a += u32(pos.x);
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ float4 pos : SV_Position;
+};
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
+}
+
+void f_inner(float4 pos) {
+ P.a = (P.a + tint_ftou(pos.x));
+}
+
+void f_inner_1(float4 pos) {
+ const float4 hlsl_sv_position = pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(pos);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.fxc.hlsl
index 63afc81..56c7995 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.fxc.hlsl
@@ -1,22 +1,49 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f(@builtin(position) pos : vec4f) {
- P.a += u32(pos.x);
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ float4 pos : SV_Position;
+};
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
+}
+
+void f_inner(float4 pos) {
+ P.a = (P.a + tint_ftou(pos.x));
+}
+
+void f_inner_1(float4 pos) {
+ const float4 hlsl_sv_position = pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(pos);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl
index d675132..00bcc5d 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.dxc.hlsl
index 5bafbcc..d986eee 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.dxc.hlsl
@@ -1,22 +1,50 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f(@builtin(position) pos : vec4f, @location(0) uv : vec4f) {
- P.a += (u32(pos.x) + u32(uv.x));
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ float4 uv : TEXCOORD0;
+ float4 pos : SV_Position;
+};
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
+}
+
+void f_inner(float4 pos, float4 uv) {
+ P.a = (P.a + (tint_ftou(pos.x) + tint_ftou(uv.x)));
+}
+
+void f_inner_1(float4 pos, float4 uv) {
+ const float4 hlsl_sv_position = pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(pos, uv);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.pos, tint_symbol.uv);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.fxc.hlsl
index 5bafbcc..d986eee 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.fxc.hlsl
@@ -1,22 +1,50 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f(@builtin(position) pos : vec4f, @location(0) uv : vec4f) {
- P.a += (u32(pos.x) + u32(uv.x));
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ float4 uv : TEXCOORD0;
+ float4 pos : SV_Position;
+};
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
+}
+
+void f_inner(float4 pos, float4 uv) {
+ P.a = (P.a + (tint_ftou(pos.x) + tint_ftou(uv.x)));
+}
+
+void f_inner_1(float4 pos, float4 uv) {
+ const float4 hlsl_sv_position = pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(pos, uv);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.pos, tint_symbol.uv);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl
index a3ecc54..570799b 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.dxc.hlsl
index f4c0ede..701785f 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.dxc.hlsl
@@ -1,27 +1,54 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct tint_symbol_2 {
+ float4 uv : TEXCOORD0;
+ float4 pos : SV_Position;
+};
struct In {
- @location(0)
- uv : vec4f,
+ float4 uv;
+};
+
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
}
-@fragment
-fn f(@builtin(position) pos : vec4f, tint_symbol : In) {
- P.a += (u32(pos.x) + u32(tint_symbol.uv.x));
+void f_inner(float4 pos, In tint_symbol) {
+ P.a = (P.a + (tint_ftou(pos.x) + tint_ftou(tint_symbol.uv.x)));
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(float4 pos, In tint_symbol) {
+ const float4 hlsl_sv_position = pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(pos, tint_symbol);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_2 tint_symbol_1) {
+ const In tint_symbol_3 = {tint_symbol_1.uv};
+ f_inner_1(tint_symbol_1.pos, tint_symbol_3);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.fxc.hlsl
index f4c0ede..701785f 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.fxc.hlsl
@@ -1,27 +1,54 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct tint_symbol_2 {
+ float4 uv : TEXCOORD0;
+ float4 pos : SV_Position;
+};
struct In {
- @location(0)
- uv : vec4f,
+ float4 uv;
+};
+
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
}
-@fragment
-fn f(@builtin(position) pos : vec4f, tint_symbol : In) {
- P.a += (u32(pos.x) + u32(tint_symbol.uv.x));
+void f_inner(float4 pos, In tint_symbol) {
+ P.a = (P.a + (tint_ftou(pos.x) + tint_ftou(tint_symbol.uv.x)));
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(float4 pos, In tint_symbol) {
+ const float4 hlsl_sv_position = pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(pos, tint_symbol);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_2 tint_symbol_1) {
+ const In tint_symbol_3 = {tint_symbol_1.uv};
+ f_inner_1(tint_symbol_1.pos, tint_symbol_3);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl
index 89c5296..d91e3b7 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.dxc.hlsl
index 3193793..62cb156 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.dxc.hlsl
@@ -1,27 +1,53 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct tint_symbol_2 {
+ float4 pos : SV_Position;
+};
struct In {
- @builtin(position)
- pos : vec4f,
+ float4 pos;
+};
+
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
}
-@fragment
-fn f(tint_symbol : In) {
- P.a += u32(tint_symbol.pos.x);
+void f_inner(In tint_symbol) {
+ P.a = (P.a + tint_ftou(tint_symbol.pos.x));
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(In tint_symbol) {
+ const float4 hlsl_sv_position = tint_symbol.pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(tint_symbol);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_2 tint_symbol_1) {
+ const In tint_symbol_3 = {tint_symbol_1.pos};
+ f_inner_1(tint_symbol_3);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.fxc.hlsl
index 3193793..62cb156 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.fxc.hlsl
@@ -1,27 +1,53 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct tint_symbol_2 {
+ float4 pos : SV_Position;
+};
struct In {
- @builtin(position)
- pos : vec4f,
+ float4 pos;
+};
+
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
}
-@fragment
-fn f(tint_symbol : In) {
- P.a += u32(tint_symbol.pos.x);
+void f_inner(In tint_symbol) {
+ P.a = (P.a + tint_ftou(tint_symbol.pos.x));
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(In tint_symbol) {
+ const float4 hlsl_sv_position = tint_symbol.pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(tint_symbol);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_2 tint_symbol_1) {
+ const In tint_symbol_3 = {tint_symbol_1.pos};
+ f_inner_1(tint_symbol_3);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl
index bbd0a13..c10dc9e 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.dxc.hlsl
index 527af3f..88be5b9 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.dxc.hlsl
@@ -1,27 +1,54 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct tint_symbol_2 {
+ float4 uv : TEXCOORD0;
+ float4 pos : SV_Position;
+};
struct In {
- @builtin(position)
- pos : vec4f,
+ float4 pos;
+};
+
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
}
-@fragment
-fn f(tint_symbol : In, @location(0) uv : vec4f) {
- P.a += (u32(tint_symbol.pos.x) + u32(uv.x));
+void f_inner(In tint_symbol, float4 uv) {
+ P.a = (P.a + (tint_ftou(tint_symbol.pos.x) + tint_ftou(uv.x)));
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(In tint_symbol, float4 uv) {
+ const float4 hlsl_sv_position = tint_symbol.pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(tint_symbol, uv);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_2 tint_symbol_1) {
+ const In tint_symbol_3 = {tint_symbol_1.pos};
+ f_inner_1(tint_symbol_3, tint_symbol_1.uv);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.fxc.hlsl
index 527af3f..88be5b9 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.fxc.hlsl
@@ -1,27 +1,54 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct tint_symbol_2 {
+ float4 uv : TEXCOORD0;
+ float4 pos : SV_Position;
+};
struct In {
- @builtin(position)
- pos : vec4f,
+ float4 pos;
+};
+
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
}
-@fragment
-fn f(tint_symbol : In, @location(0) uv : vec4f) {
- P.a += (u32(tint_symbol.pos.x) + u32(uv.x));
+void f_inner(In tint_symbol, float4 uv) {
+ P.a = (P.a + (tint_ftou(tint_symbol.pos.x) + tint_ftou(uv.x)));
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(In tint_symbol, float4 uv) {
+ const float4 hlsl_sv_position = tint_symbol.pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(tint_symbol, uv);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_2 tint_symbol_1) {
+ const In tint_symbol_3 = {tint_symbol_1.pos};
+ f_inner_1(tint_symbol_3, tint_symbol_1.uv);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl
index b9b9eb9..d8123fe 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.dxc.hlsl
index 2f42cc9..41f762c 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.dxc.hlsl
@@ -1,29 +1,55 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct tint_symbol_2 {
+ float4 uv : TEXCOORD0;
+ float4 pos : SV_Position;
+};
struct In {
- @builtin(position)
- pos : vec4f,
- @location(0)
- uv : vec4f,
+ float4 pos;
+ float4 uv;
+};
+
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
}
-@fragment
-fn f(tint_symbol : In) {
- P.a += (u32(tint_symbol.pos.x) + u32(tint_symbol.uv.x));
+void f_inner(In tint_symbol) {
+ P.a = (P.a + (tint_ftou(tint_symbol.pos.x) + tint_ftou(tint_symbol.uv.x)));
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(In tint_symbol) {
+ const float4 hlsl_sv_position = tint_symbol.pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(tint_symbol);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_2 tint_symbol_1) {
+ const In tint_symbol_3 = {tint_symbol_1.pos, tint_symbol_1.uv};
+ f_inner_1(tint_symbol_3);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.fxc.hlsl
index 2f42cc9..41f762c 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.fxc.hlsl
@@ -1,29 +1,55 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct tint_symbol_2 {
+ float4 uv : TEXCOORD0;
+ float4 pos : SV_Position;
+};
struct In {
- @builtin(position)
- pos : vec4f,
- @location(0)
- uv : vec4f,
+ float4 pos;
+ float4 uv;
+};
+
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
}
-@fragment
-fn f(tint_symbol : In) {
- P.a += (u32(tint_symbol.pos.x) + u32(tint_symbol.uv.x));
+void f_inner(In tint_symbol) {
+ P.a = (P.a + (tint_ftou(tint_symbol.pos.x) + tint_ftou(tint_symbol.uv.x)));
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(In tint_symbol) {
+ const float4 hlsl_sv_position = tint_symbol.pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(tint_symbol);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_2 tint_symbol_1) {
+ const In tint_symbol_3 = {tint_symbol_1.pos, tint_symbol_1.uv};
+ f_inner_1(tint_symbol_3);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl
index 02916e3..68550b4 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.dxc.hlsl
index 98e76da..4f8b552 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.dxc.hlsl
@@ -1,22 +1,49 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f(@invariant @builtin(position) pos : vec4f) {
- P.a += u32(pos.x);
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ precise float4 pos : SV_Position;
+};
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
+}
+
+void f_inner(float4 pos) {
+ P.a = (P.a + tint_ftou(pos.x));
+}
+
+void f_inner_1(float4 pos) {
+ const float4 hlsl_sv_position = pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(pos);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.fxc.hlsl
index 98e76da..4f8b552 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.fxc.hlsl
@@ -1,22 +1,49 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f(@invariant @builtin(position) pos : vec4f) {
- P.a += u32(pos.x);
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ precise float4 pos : SV_Position;
+};
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
+}
+
+void f_inner(float4 pos) {
+ P.a = (P.a + tint_ftou(pos.x));
+}
+
+void f_inner_1(float4 pos) {
+ const float4 hlsl_sv_position = pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(pos);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl
index 6c31d00..9634327 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.dxc.hlsl
index db03744..babb753 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.dxc.hlsl
@@ -1,27 +1,53 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct tint_symbol_2 {
+ precise float4 pos : SV_Position;
+};
struct In {
- @invariant @builtin(position)
- pos : vec4f,
+ float4 pos;
+};
+
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
}
-@fragment
-fn f(tint_symbol : In) {
- P.a += u32(tint_symbol.pos.x);
+void f_inner(In tint_symbol) {
+ P.a = (P.a + tint_ftou(tint_symbol.pos.x));
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(In tint_symbol) {
+ const float4 hlsl_sv_position = tint_symbol.pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(tint_symbol);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_2 tint_symbol_1) {
+ const In tint_symbol_3 = {tint_symbol_1.pos};
+ f_inner_1(tint_symbol_3);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.fxc.hlsl
index db03744..babb753 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.fxc.hlsl
@@ -1,27 +1,53 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct tint_symbol_2 {
+ precise float4 pos : SV_Position;
+};
struct In {
- @invariant @builtin(position)
- pos : vec4f,
+ float4 pos;
+};
+
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
}
-@fragment
-fn f(tint_symbol : In) {
- P.a += u32(tint_symbol.pos.x);
+void f_inner(In tint_symbol) {
+ P.a = (P.a + tint_ftou(tint_symbol.pos.x));
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(In tint_symbol) {
+ const float4 hlsl_sv_position = tint_symbol.pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(tint_symbol);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_2 tint_symbol_1) {
+ const In tint_symbol_3 = {tint_symbol_1.pos};
+ f_inner_1(tint_symbol_3);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl
index 0273ad9..e27fae6 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.dxc.hlsl
index 228feef..8e5ee97 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.dxc.hlsl
@@ -1,22 +1,51 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f(@location(0) a : vec4f, @interpolate(flat) @location(1) b : vec4f) {
- P.a += (u32(a.x) + u32(b.y));
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/location.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ float4 a : TEXCOORD0;
+ nointerpolation float4 b : TEXCOORD1;
+ float4 my_pos : SV_Position;
+};
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
+}
+
+void f_inner(float4 a, float4 b) {
+ P.a = (P.a + (tint_ftou(a.x) + tint_ftou(b.y)));
+}
+
+void f_inner_1(float4 a, float4 b, float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(a, b);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.a, tint_symbol.b, tint_symbol.my_pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.fxc.hlsl
index 228feef..8e5ee97 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.fxc.hlsl
@@ -1,22 +1,51 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f(@location(0) a : vec4f, @interpolate(flat) @location(1) b : vec4f) {
- P.a += (u32(a.x) + u32(b.y));
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/location.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ float4 a : TEXCOORD0;
+ nointerpolation float4 b : TEXCOORD1;
+ float4 my_pos : SV_Position;
+};
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
+}
+
+void f_inner(float4 a, float4 b) {
+ P.a = (P.a + (tint_ftou(a.x) + tint_ftou(b.y)));
+}
+
+void f_inner_1(float4 a, float4 b, float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(a, b);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.a, tint_symbol.b, tint_symbol.my_pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl
index b9666cc..27deefa 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.dxc.hlsl
index 6b2953b..ab6814e 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.dxc.hlsl
@@ -1,29 +1,56 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct tint_symbol_2 {
+ float4 a : TEXCOORD0;
+ nointerpolation float4 b : TEXCOORD1;
+ float4 my_pos : SV_Position;
+};
struct In {
- @location(0)
- a : vec4f,
- @interpolate(flat) @location(1)
- b : vec4f,
+ float4 a;
+ float4 b;
+};
+
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
}
-@fragment
-fn f(tint_symbol : In) {
- P.a += (u32(tint_symbol.a.x) + u32(tint_symbol.b.y));
+void f_inner(In tint_symbol) {
+ P.a = (P.a + (tint_ftou(tint_symbol.a.x) + tint_ftou(tint_symbol.b.y)));
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(In tint_symbol, float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(tint_symbol);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_2 tint_symbol_1) {
+ const In tint_symbol_3 = {tint_symbol_1.a, tint_symbol_1.b};
+ f_inner_1(tint_symbol_3, tint_symbol_1.my_pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.fxc.hlsl
index 6b2953b..ab6814e 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.fxc.hlsl
@@ -1,29 +1,56 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct tint_symbol_2 {
+ float4 a : TEXCOORD0;
+ nointerpolation float4 b : TEXCOORD1;
+ float4 my_pos : SV_Position;
+};
struct In {
- @location(0)
- a : vec4f,
- @interpolate(flat) @location(1)
- b : vec4f,
+ float4 a;
+ float4 b;
+};
+
+uint tint_ftou(float v) {
+ return ((v < 4294967040.0f) ? ((v < 0.0f) ? 0u : uint(v)) : 4294967295u);
}
-@fragment
-fn f(tint_symbol : In) {
- P.a += (u32(tint_symbol.a.x) + u32(tint_symbol.b.y));
+void f_inner(In tint_symbol) {
+ P.a = (P.a + (tint_ftou(tint_symbol.a.x) + tint_ftou(tint_symbol.b.y)));
}
-Failed to generate: extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(In tint_symbol, float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner(tint_symbol);
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_2 tint_symbol_1) {
+ const In tint_symbol_3 = {tint_symbol_1.a, tint_symbol_1.b};
+ f_inner_1(tint_symbol_3, tint_symbol_1.my_pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl
index e106db5..0b6a5da 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
index 5fb3ea9..741f9c1 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
@@ -1,32 +1,68 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct f_res {
+ float4 output_0;
+ float4 output_1;
+ float4 output_2;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+ float4 output_1 : SV_Target2;
+ float4 output_2 : SV_Target4;
+};
struct Out {
- @location(0)
- x : vec4f,
- @location(2)
- y : vec4f,
- @location(4)
- z : vec4f,
+ float4 x;
+ float4 y;
+ float4 z;
+};
+
+Out f_inner() {
+ P.a = (P.a + 42u);
+ const Out tint_symbol_4 = {(10.0f).xxxx, (20.0f).xxxx, (30.0f).xxxx};
+ return tint_symbol_4;
}
-@fragment
-fn f() -> Out {
- P.a += 42;
- return Out(vec4f(10), vec4f(20), vec4f(30));
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const Out result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result.x, result.y, result.z};
+ return tint_symbol_3;
}
-Failed to generate: extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ wrapper_result.output_1 = inner_result.output_1;
+ wrapper_result.output_2 = inner_result.output_2;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
index 5fb3ea9..741f9c1 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
@@ -1,32 +1,68 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct f_res {
+ float4 output_0;
+ float4 output_1;
+ float4 output_2;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+ float4 output_1 : SV_Target2;
+ float4 output_2 : SV_Target4;
+};
struct Out {
- @location(0)
- x : vec4f,
- @location(2)
- y : vec4f,
- @location(4)
- z : vec4f,
+ float4 x;
+ float4 y;
+ float4 z;
+};
+
+Out f_inner() {
+ P.a = (P.a + 42u);
+ const Out tint_symbol_4 = {(10.0f).xxxx, (20.0f).xxxx, (30.0f).xxxx};
+ return tint_symbol_4;
}
-@fragment
-fn f() -> Out {
- P.a += 42;
- return Out(vec4f(10), vec4f(20), vec4f(30));
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const Out result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result.x, result.y, result.z};
+ return tint_symbol_3;
}
-Failed to generate: extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ wrapper_result.output_1 = inner_result.output_1;
+ wrapper_result.output_2 = inner_result.output_2;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl
index 393b271..bfaa85c 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1
+// flags: --pixel_local_attachments 0=1 --pixel_local_attachment_formats 0=R32Uint
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl
index 21598b3..9d0fe08 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl
@@ -1,30 +1,60 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+}
+struct f_res {
+ float4 output_0;
+ float4 output_1;
+ float4 output_2;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+ float4 output_1 : SV_Target2;
+ float4 output_2 : SV_Target3;
+};
struct Out {
- @location(0)
- x : vec4f,
- @location(2)
- y : vec4f,
- @location(3)
- z : vec4f,
+ float4 x;
+ float4 y;
+ float4 z;
+};
+
+Out f_inner() {
+ P.a = (P.a + 42u);
+ const Out tint_symbol_4 = {(10.0f).xxxx, (20.0f).xxxx, (30.0f).xxxx};
+ return tint_symbol_4;
}
-@fragment
-fn f() -> Out {
- P.a += 42;
- return Out(vec4f(10), vec4f(20), vec4f(30));
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const Out result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result.x, result.y, result.z};
+ return tint_symbol_3;
}
-Failed to generate: extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ wrapper_result.output_1 = inner_result.output_1;
+ wrapper_result.output_2 = inner_result.output_2;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl
index 21598b3..9d0fe08 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl
@@ -1,30 +1,60 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+}
+struct f_res {
+ float4 output_0;
+ float4 output_1;
+ float4 output_2;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+ float4 output_1 : SV_Target2;
+ float4 output_2 : SV_Target3;
+};
struct Out {
- @location(0)
- x : vec4f,
- @location(2)
- y : vec4f,
- @location(3)
- z : vec4f,
+ float4 x;
+ float4 y;
+ float4 z;
+};
+
+Out f_inner() {
+ P.a = (P.a + 42u);
+ const Out tint_symbol_4 = {(10.0f).xxxx, (20.0f).xxxx, (30.0f).xxxx};
+ return tint_symbol_4;
}
-@fragment
-fn f() -> Out {
- P.a += 42;
- return Out(vec4f(10), vec4f(20), vec4f(30));
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const Out result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result.x, result.y, result.z};
+ return tint_symbol_3;
}
-Failed to generate: extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ wrapper_result.output_1 = inner_result.output_1;
+ wrapper_result.output_2 = inner_result.output_2;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl b/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl
index 62c1c27..8ec100c 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl
index 45e9e60..522659b 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl
@@ -1,23 +1,56 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f() -> @location(0) vec4f {
- P.a += 42;
- return vec4f(2);
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct f_res {
+ float4 output_0;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+};
+float4 f_inner() {
+ P.a = (P.a + 42u);
+ return (2.0f).xxxx;
+}
+
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const float4 result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result};
+ return tint_symbol_3;
+}
+
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl
index 45e9e60..522659b 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl
@@ -1,23 +1,56 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f() -> @location(0) vec4f {
- P.a += 42;
- return vec4f(2);
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct f_res {
+ float4 output_0;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+};
+float4 f_inner() {
+ P.a = (P.a + 42u);
+ return (2.0f).xxxx;
+}
+
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const float4 result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result};
+ return tint_symbol_3;
+}
+
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl b/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl
index 4bbbaaa..9b3466c 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1
+// flags: --pixel_local_attachments 0=1 --pixel_local_attachment_formats 0=R32Uint
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.dxc.hlsl
index 8d4e6f1..13ab144 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.dxc.hlsl
@@ -1,21 +1,48 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f() -> @location(0) vec4f {
- P.a += 42;
- return vec4f(2);
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct f_res {
+ float4 output_0;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+};
+float4 f_inner() {
+ P.a = (P.a + 42u);
+ return (2.0f).xxxx;
+}
+
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const float4 result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result};
+ return tint_symbol_3;
+}
+
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.fxc.hlsl
index 8d4e6f1..13ab144 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.fxc.hlsl
@@ -1,21 +1,48 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f() -> @location(0) vec4f {
- P.a += 42;
- return vec4f(2);
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct f_res {
+ float4 output_0;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+};
+float4 f_inner() {
+ P.a = (P.a + 42u);
+ return (2.0f).xxxx;
+}
+
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const float4 result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result};
+ return tint_symbol_3;
+}
+
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl
index 988b86f..34ed240 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
index 46fa77f..36dcaa2 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
@@ -1,22 +1,45 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f() {
- P.a += 42;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+void f_inner() {
+ P.a = (P.a + 42u);
+}
+
+void f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.my_pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
index 46fa77f..36dcaa2 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
@@ -1,22 +1,45 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f() {
- P.a += 42;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+void f_inner() {
+ P.a = (P.a + 42u);
+}
+
+void f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.my_pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl
index b704ddb..937ecaf 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1
+// flags: --pixel_local_attachments 0=1 --pixel_local_attachment_formats 0=R32Uint
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl
index 26fc6e7..78fee6c 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl
@@ -1,20 +1,37 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f() {
- P.a += 42;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+void f_inner() {
+ P.a = (P.a + 42u);
+}
+
+void f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.my_pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl
index 26fc6e7..78fee6c 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl
@@ -1,20 +1,37 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-@fragment
-fn f() {
- P.a += 42;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
}
-Failed to generate: extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+void f_inner() {
+ P.a = (P.a + 42u);
+}
+
+void f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.my_pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl
index 6087c37..801d213 100644
--- a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl
+++ b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
index 8d3d555..c708cd5 100644
--- a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
@@ -1,46 +1,82 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct f_res {
+ float4 output_0;
+ float4 output_1;
+ float4 output_2;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+ float4 output_1 : SV_Target2;
+ float4 output_2 : SV_Target4;
+};
struct Out {
- @location(0)
- x : vec4f,
- @location(2)
- y : vec4f,
- @location(4)
- z : vec4f,
+ float4 x;
+ float4 y;
+ float4 z;
+};
+
+void f0() {
+ P.a = (P.a + 9u);
}
-fn f0() {
- P.a += 9;
-}
-
-fn f1() {
+void f1() {
f0();
- P.a += 8;
+ P.a = (P.a + 8u);
}
-fn f2() {
- P.a += 7;
+void f2() {
+ P.a = (P.a + 7u);
f1();
}
-@fragment
-fn f() -> Out {
+Out f_inner() {
f2();
- return Out(vec4f(10), vec4f(20), vec4f(30));
+ const Out tint_symbol_4 = {(10.0f).xxxx, (20.0f).xxxx, (30.0f).xxxx};
+ return tint_symbol_4;
}
-Failed to generate: extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const Out result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result.x, result.y, result.z};
+ return tint_symbol_3;
+}
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ wrapper_result.output_1 = inner_result.output_1;
+ wrapper_result.output_2 = inner_result.output_2;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
index 8d3d555..c708cd5 100644
--- a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
@@ -1,46 +1,82 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
+}
+struct f_res {
+ float4 output_0;
+ float4 output_1;
+ float4 output_2;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+ float4 output_1 : SV_Target2;
+ float4 output_2 : SV_Target4;
+};
struct Out {
- @location(0)
- x : vec4f,
- @location(2)
- y : vec4f,
- @location(4)
- z : vec4f,
+ float4 x;
+ float4 y;
+ float4 z;
+};
+
+void f0() {
+ P.a = (P.a + 9u);
}
-fn f0() {
- P.a += 9;
-}
-
-fn f1() {
+void f1() {
f0();
- P.a += 8;
+ P.a = (P.a + 8u);
}
-fn f2() {
- P.a += 7;
+void f2() {
+ P.a = (P.a + 7u);
f1();
}
-@fragment
-fn f() -> Out {
+Out f_inner() {
f2();
- return Out(vec4f(10), vec4f(20), vec4f(30));
+ const Out tint_symbol_4 = {(10.0f).xxxx, (20.0f).xxxx, (30.0f).xxxx};
+ return tint_symbol_4;
}
-Failed to generate: extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const Out result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result.x, result.y, result.z};
+ return tint_symbol_3;
+}
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ wrapper_result.output_1 = inner_result.output_1;
+ wrapper_result.output_2 = inner_result.output_2;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl
index bccdc57..f0bc1b1 100644
--- a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl
+++ b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1
+// flags: --pixel_local_attachments 0=1 --pixel_local_attachment_formats 0=R32Uint
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl
index 217519c..d7212f49 100644
--- a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl
@@ -1,44 +1,74 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+}
+struct f_res {
+ float4 output_0;
+ float4 output_1;
+ float4 output_2;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+ float4 output_1 : SV_Target2;
+ float4 output_2 : SV_Target3;
+};
struct Out {
- @location(0)
- x : vec4f,
- @location(2)
- y : vec4f,
- @location(3)
- z : vec4f,
+ float4 x;
+ float4 y;
+ float4 z;
+};
+
+void f0() {
+ P.a = (P.a + 9u);
}
-fn f0() {
- P.a += 9;
-}
-
-fn f1() {
+void f1() {
f0();
- P.a += 8;
+ P.a = (P.a + 8u);
}
-fn f2() {
- P.a += 7;
+void f2() {
+ P.a = (P.a + 7u);
f1();
}
-@fragment
-fn f() -> Out {
+Out f_inner() {
f2();
- return Out(vec4f(10), vec4f(20), vec4f(30));
+ const Out tint_symbol_4 = {(10.0f).xxxx, (20.0f).xxxx, (30.0f).xxxx};
+ return tint_symbol_4;
}
-Failed to generate: extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const Out result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result.x, result.y, result.z};
+ return tint_symbol_3;
+}
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ wrapper_result.output_1 = inner_result.output_1;
+ wrapper_result.output_2 = inner_result.output_2;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl
index 217519c..d7212f49 100644
--- a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl
@@ -1,44 +1,74 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+}
+struct f_res {
+ float4 output_0;
+ float4 output_1;
+ float4 output_2;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+ float4 output_1 : SV_Target2;
+ float4 output_2 : SV_Target3;
+};
struct Out {
- @location(0)
- x : vec4f,
- @location(2)
- y : vec4f,
- @location(3)
- z : vec4f,
+ float4 x;
+ float4 y;
+ float4 z;
+};
+
+void f0() {
+ P.a = (P.a + 9u);
}
-fn f0() {
- P.a += 9;
-}
-
-fn f1() {
+void f1() {
f0();
- P.a += 8;
+ P.a = (P.a + 8u);
}
-fn f2() {
- P.a += 7;
+void f2() {
+ P.a = (P.a + 7u);
f1();
}
-@fragment
-fn f() -> Out {
+Out f_inner() {
f2();
- return Out(vec4f(10), vec4f(20), vec4f(30));
+ const Out tint_symbol_4 = {(10.0f).xxxx, (20.0f).xxxx, (30.0f).xxxx};
+ return tint_symbol_4;
}
-Failed to generate: extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const Out result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result.x, result.y, result.z};
+ return tint_symbol_3;
+}
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ wrapper_result.output_1 = inner_result.output_1;
+ wrapper_result.output_2 = inner_result.output_2;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl b/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl
index cfc3b25..647db54 100644
--- a/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl
+++ b/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl
index a32d13d..2eb9951 100644
--- a/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl
@@ -1,37 +1,70 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-fn f0() {
- P.a += 9;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-fn f1() {
+struct f_res {
+ float4 output_0;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+};
+
+void f0() {
+ P.a = (P.a + 9u);
+}
+
+void f1() {
f0();
- P.a += 8;
+ P.a = (P.a + 8u);
}
-fn f2() {
- P.a += 7;
+void f2() {
+ P.a = (P.a + 7u);
f1();
}
-@fragment
-fn f() -> @location(0) vec4f {
+float4 f_inner() {
f2();
- return vec4f(2);
+ return (2.0f).xxxx;
}
-Failed to generate: extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const float4 result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result};
+ return tint_symbol_3;
+}
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl
index a32d13d..2eb9951 100644
--- a/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl
@@ -1,37 +1,70 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-fn f0() {
- P.a += 9;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-fn f1() {
+struct f_res {
+ float4 output_0;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+};
+
+void f0() {
+ P.a = (P.a + 9u);
+}
+
+void f1() {
f0();
- P.a += 8;
+ P.a = (P.a + 8u);
}
-fn f2() {
- P.a += 7;
+void f2() {
+ P.a = (P.a + 7u);
f1();
}
-@fragment
-fn f() -> @location(0) vec4f {
+float4 f_inner() {
f2();
- return vec4f(2);
+ return (2.0f).xxxx;
}
-Failed to generate: extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const float4 result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result};
+ return tint_symbol_3;
+}
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl b/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl
index fcab73b..e785cd6 100644
--- a/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl
+++ b/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1
+// flags: --pixel_local_attachments 0=1 --pixel_local_attachment_formats 0=R32Uint
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.dxc.hlsl
index 4b6423a..c32702b 100644
--- a/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.dxc.hlsl
@@ -1,35 +1,62 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-fn f0() {
- P.a += 9;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
}
-fn f1() {
+struct f_res {
+ float4 output_0;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+};
+
+void f0() {
+ P.a = (P.a + 9u);
+}
+
+void f1() {
f0();
- P.a += 8;
+ P.a = (P.a + 8u);
}
-fn f2() {
- P.a += 7;
+void f2() {
+ P.a = (P.a + 7u);
f1();
}
-@fragment
-fn f() -> @location(0) vec4f {
+float4 f_inner() {
f2();
- return vec4f(2);
+ return (2.0f).xxxx;
}
-Failed to generate: extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const float4 result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result};
+ return tint_symbol_3;
+}
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.fxc.hlsl
index 4b6423a..c32702b 100644
--- a/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.fxc.hlsl
@@ -1,35 +1,62 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-fn f0() {
- P.a += 9;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
}
-fn f1() {
+struct f_res {
+ float4 output_0;
+};
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+struct tint_symbol_2 {
+ float4 output_0 : SV_Target0;
+};
+
+void f0() {
+ P.a = (P.a + 9u);
+}
+
+void f1() {
f0();
- P.a += 8;
+ P.a = (P.a + 8u);
}
-fn f2() {
- P.a += 7;
+void f2() {
+ P.a = (P.a + 7u);
f1();
}
-@fragment
-fn f() -> @location(0) vec4f {
+float4 f_inner() {
f2();
- return vec4f(2);
+ return (2.0f).xxxx;
}
-Failed to generate: extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+f_res f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ const float4 result = f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+ const f_res tint_symbol_3 = {result};
+ return tint_symbol_3;
+}
+tint_symbol_2 f(tint_symbol_1 tint_symbol) {
+ const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ tint_symbol_2 wrapper_result = (tint_symbol_2)0;
+ wrapper_result.output_0 = inner_result.output_0;
+ return wrapper_result;
+}
diff --git a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl
index 7bc316fe..93d5008 100644
--- a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl
+++ b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1,1=6,2=3 --pixel_local_attachment_formats 0=R32Uint,1=R32Sint,2=R32Float
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
index 961d901..2d76369 100644
--- a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
@@ -1,36 +1,59 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-fn f0() {
- P.a += 9;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-fn f1() {
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+
+void f0() {
+ P.a = (P.a + 9u);
+}
+
+void f1() {
f0();
- P.a += 8;
+ P.a = (P.a + 8u);
}
-fn f2() {
- P.a += 7;
+void f2() {
+ P.a = (P.a + 7u);
f1();
}
-@fragment
-fn f() {
+void f_inner() {
f2();
}
-Failed to generate: extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.my_pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
index 961d901..2d76369 100644
--- a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
@@ -1,36 +1,59 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
+RasterizerOrderedTexture2D<int4> pixel_local_b : register(u6);
+RasterizerOrderedTexture2D<float4> pixel_local_c : register(u3);
struct PixelLocal {
- a : u32,
- b : i32,
- c : f32,
+ uint a;
+ int b;
+ float c;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
+ P.b = pixel_local_b.Load(rov_texcoord).x;
+ P.c = pixel_local_c.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-fn f0() {
- P.a += 9;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
+ pixel_local_b[rov_texcoord] = int4((P.b).xxxx);
+ pixel_local_c[rov_texcoord] = float4((P.c).xxxx);
}
-fn f1() {
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+
+void f0() {
+ P.a = (P.a + 9u);
+}
+
+void f1() {
f0();
- P.a += 8;
+ P.a = (P.a + 8u);
}
-fn f2() {
- P.a += 7;
+void f2() {
+ P.a = (P.a + 7u);
f1();
}
-@fragment
-fn f() {
+void f_inner() {
f2();
}
-Failed to generate: extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.my_pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl
index 44fae7d..c154cc7 100644
--- a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl
+++ b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1
+// flags: --pixel_local_attachments 0=1 --pixel_local_attachment_formats 0=R32Uint
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl
index be9ab4f..fb53644 100644
--- a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl
@@ -1,34 +1,51 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-fn f0() {
- P.a += 9;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
}
-fn f1() {
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+
+void f0() {
+ P.a = (P.a + 9u);
+}
+
+void f1() {
f0();
- P.a += 8;
+ P.a = (P.a + 8u);
}
-fn f2() {
- P.a += 7;
+void f2() {
+ P.a = (P.a + 7u);
f1();
}
-@fragment
-fn f() {
+void f_inner() {
f2();
}
-Failed to generate: extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.my_pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl
index be9ab4f..fb53644 100644
--- a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl
@@ -1,34 +1,51 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal P = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ P.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> P : PixelLocal;
-
-fn f0() {
- P.a += 9;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((P.a).xxxx);
}
-fn f1() {
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+
+void f0() {
+ P.a = (P.a + 9u);
+}
+
+void f1() {
f0();
- P.a += 8;
+ P.a = (P.a + 8u);
}
-fn f2() {
- P.a += 7;
+void f2() {
+ P.a = (P.a + 7u);
f1();
}
-@fragment
-fn f() {
+void f_inner() {
f2();
}
-Failed to generate: extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+void f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.my_pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/ptr/local.wgsl b/test/tint/extensions/pixel_local/ptr/local.wgsl
index 6f66cc7..312b4f8 100644
--- a/test/tint/extensions/pixel_local/ptr/local.wgsl
+++ b/test/tint/extensions/pixel_local/ptr/local.wgsl
@@ -1,4 +1,4 @@
-// flags: --pixel_local_attachments 0=1,1=6,2=3
+// flags: --pixel_local_attachments 0=1 --pixel_local_attachment_formats 0=R32Uint
enable chromium_experimental_pixel_local;
struct PixelLocal {
diff --git a/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.dxc.hlsl
index f795a17..3bf6703 100644
--- a/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.dxc.hlsl
@@ -1,21 +1,37 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal V = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ V.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> V : PixelLocal;
-
-@fragment
-fn f() {
- let p = &(V);
- (*(p)).a = 42;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((V.a).xxxx);
}
-Failed to generate: extensions/pixel_local/ptr/local.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+void f_inner() {
+ V.a = 42u;
+}
+
+void f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.my_pos);
+ return;
+}
diff --git a/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.fxc.hlsl
index f795a17..3bf6703 100644
--- a/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.fxc.hlsl
@@ -1,21 +1,37 @@
-SKIP: FAILED
-
-
-enable chromium_experimental_pixel_local;
+RasterizerOrderedTexture2D<uint4> pixel_local_a : register(u1);
struct PixelLocal {
- a : u32,
+ uint a;
+};
+
+static PixelLocal V = (PixelLocal)0;
+
+void load_from_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ V.a = pixel_local_a.Load(rov_texcoord).x;
}
-var<pixel_local> V : PixelLocal;
-
-@fragment
-fn f() {
- let p = &(V);
- (*(p)).a = 42;
+void store_into_pixel_local_storage(float4 my_input) {
+ const uint2 rov_texcoord = uint2(my_input.xy);
+ pixel_local_a[rov_texcoord] = uint4((V.a).xxxx);
}
-Failed to generate: extensions/pixel_local/ptr/local.wgsl:2:8 error: HLSL backend does not support extension 'chromium_experimental_pixel_local'
-enable chromium_experimental_pixel_local;
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+struct tint_symbol_1 {
+ float4 my_pos : SV_Position;
+};
+void f_inner() {
+ V.a = 42u;
+}
+
+void f_inner_1(float4 my_pos) {
+ const float4 hlsl_sv_position = my_pos;
+ load_from_pixel_local_storage(hlsl_sv_position);
+ f_inner();
+ store_into_pixel_local_storage(hlsl_sv_position);
+}
+
+void f(tint_symbol_1 tint_symbol) {
+ f_inner_1(tint_symbol.my_pos);
+ return;
+}