[tint] Implement support for r8unorm
Bug: dawn:2101
Change-Id: I0ebb48c577f114efd9e2564ac818c4869852a927
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/176042
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/tint/cmd/common/helper.cc b/src/tint/cmd/common/helper.cc
index c043588..2e9ce37 100644
--- a/src/tint/cmd/common/helper.cc
+++ b/src/tint/cmd/common/helper.cc
@@ -453,6 +453,8 @@
return "Rgba32Sint";
case tint::inspector::ResourceBinding::TexelFormat::kRgba32Float:
return "Rgba32Float";
+ case tint::inspector::ResourceBinding::TexelFormat::kR8Unorm:
+ return "R8Unorm";
case tint::inspector::ResourceBinding::TexelFormat::kNone:
return "None";
}
diff --git a/src/tint/lang/core/core.def b/src/tint/lang/core/core.def
index f8deb52..7352a85 100644
--- a/src/tint/lang/core/core.def
+++ b/src/tint/lang/core/core.def
@@ -302,7 +302,8 @@
// https://gpuweb.github.io/gpuweb/wgsl/#texel-formats
match f32_texel_format
- : texel_format.bgra8unorm
+ : texel_format.r8unorm
+ | texel_format.bgra8unorm
| texel_format.rgba8unorm
| texel_format.rgba8snorm
| texel_format.rgba16float
diff --git a/src/tint/lang/core/intrinsic/data.cc b/src/tint/lang/core/intrinsic/data.cc
index 0fc6fe4..db57c64 100644
--- a/src/tint/lang/core/intrinsic/data.cc
+++ b/src/tint/lang/core/intrinsic/data.cc
@@ -1239,6 +1239,7 @@
constexpr NumberMatcher kF32TexelFormatMatcher {
/* match */ [](MatchState&, Number number) -> Number {
switch (static_cast<core::TexelFormat>(number.Value())) {
+ case core::TexelFormat::kR8Unorm:
case core::TexelFormat::kBgra8Unorm:
case core::TexelFormat::kRgba8Unorm:
case core::TexelFormat::kRgba8Snorm:
@@ -1252,7 +1253,7 @@
}
},
/* print */ [](MatchState*, StyledText& out) {
- out<< style::Enum("bgra8unorm")<< style::Plain(", ") << style::Enum("rgba8unorm")<< style::Plain(", ") << style::Enum("rgba8snorm")<< style::Plain(", ") << style::Enum("rgba16float")<< style::Plain(", ") << style::Enum("r32float")<< style::Plain(", ") << style::Enum("rg32float")<< style::Plain(" or ") << style::Enum("rgba32float");
+ out<< style::Enum("r8unorm")<< style::Plain(", ") << style::Enum("bgra8unorm")<< style::Plain(", ") << style::Enum("rgba8unorm")<< style::Plain(", ") << style::Enum("rgba8snorm")<< style::Plain(", ") << style::Enum("rgba16float")<< style::Plain(", ") << style::Enum("r32float")<< style::Plain(", ") << style::Enum("rg32float")<< style::Plain(" or ") << style::Enum("rgba32float");
}
};
diff --git a/src/tint/lang/core/texel_format.cc b/src/tint/lang/core/texel_format.cc
index c0f552a..1371c35 100644
--- a/src/tint/lang/core/texel_format.cc
+++ b/src/tint/lang/core/texel_format.cc
@@ -54,6 +54,9 @@
if (str == "r32uint") {
return TexelFormat::kR32Uint;
}
+ if (str == "r8unorm") {
+ return TexelFormat::kR8Unorm;
+ }
if (str == "rg32float") {
return TexelFormat::kRg32Float;
}
@@ -108,6 +111,8 @@
return "r32sint";
case TexelFormat::kR32Uint:
return "r32uint";
+ case TexelFormat::kR8Unorm:
+ return "r8unorm";
case TexelFormat::kRg32Float:
return "rg32float";
case TexelFormat::kRg32Sint:
diff --git a/src/tint/lang/core/texel_format.def b/src/tint/lang/core/texel_format.def
index 89e5f65..3d194a4 100644
--- a/src/tint/lang/core/texel_format.def
+++ b/src/tint/lang/core/texel_format.def
@@ -17,4 +17,7 @@
rgba32uint
rgba32sint
rgba32float
+
+ // requires chromium_internal_graphite
+ r8unorm
}
diff --git a/src/tint/lang/core/texel_format.h b/src/tint/lang/core/texel_format.h
index da6791d..6a9a4e2 100644
--- a/src/tint/lang/core/texel_format.h
+++ b/src/tint/lang/core/texel_format.h
@@ -50,6 +50,7 @@
kR32Float,
kR32Sint,
kR32Uint,
+ kR8Unorm,
kRg32Float,
kRg32Sint,
kRg32Uint,
@@ -83,9 +84,9 @@
TexelFormat ParseTexelFormat(std::string_view str);
constexpr std::string_view kTexelFormatStrings[] = {
- "bgra8unorm", "r32float", "r32sint", "r32uint", "rg32float", "rg32sint",
- "rg32uint", "rgba16float", "rgba16sint", "rgba16uint", "rgba32float", "rgba32sint",
- "rgba32uint", "rgba8sint", "rgba8snorm", "rgba8uint", "rgba8unorm",
+ "bgra8unorm", "r32float", "r32sint", "r32uint", "r8unorm", "rg32float",
+ "rg32sint", "rg32uint", "rgba16float", "rgba16sint", "rgba16uint", "rgba32float",
+ "rgba32sint", "rgba32uint", "rgba8sint", "rgba8snorm", "rgba8uint", "rgba8unorm",
};
} // namespace tint::core
diff --git a/src/tint/lang/core/texel_format_bench.cc b/src/tint/lang/core/texel_format_bench.cc
index 90e7795..33f4455 100644
--- a/src/tint/lang/core/texel_format_bench.cc
+++ b/src/tint/lang/core/texel_format_bench.cc
@@ -45,30 +45,32 @@
void TexelFormatParser(::benchmark::State& state) {
const char* kStrings[] = {
- "bgraunccrm", "blranr3", "bVra8unorm", "bgra8unorm", "bgra1unorm",
- "bgrJqqnorm", "bgr7ll8unorm", "qq32lppHat", "c2fov", "r32Goat",
- "r32float", "r3viiloat", "r3WWflo8t", "rxxfMoat", "rXsingg",
- "3siXt", "r32s3nt", "r32sint", "E32sint", "rPTTsint",
- "r32sidxx", "r442uint", "r3SSuiVVt", "R32R22t", "r32uint",
- "rFui9t", "r32int", "VOORRHnt", "rgy2foat", "l77nnrr2floGt",
- "rg42fl00at", "rg32float", "rgoofat", "rgzzflot", "g11p2fliia",
- "XXg32sint", "rII39955nnnt", "aagHH2sinYSS", "rg32sint", "rkk3it",
- "gj3sRRn", "r3bsnt", "rg32jint", "rg32unt", "rgqint",
- "rg32uint", "rg32inNN", "g3vvint", "rg2uQQnt", "rga16floft",
- "rgja16float", "rgNNww16f2oa", "rgba16float", "rgba16flot", "rgba16rrloat",
- "rgGa16float", "rgba16sFFnt", "g16sEnt", "rgb16rrint", "rgba16sint",
- "gba16sit", "rXa1DsiJJt", "rgasint", "rg111kin", "rgb16uint",
- "rgJa16uit", "rgba16uint", "rgca16uint", "rgba16Oint", "KKgba__v6uintt",
- "rgb832fxx5t", "rgbaqq__lat", "rgba32qloat", "rgba32float", "33gbO2floa66",
- "rgboott6QQloat", "66ba32float", "xba32zzinO6", "ryyba32sint", "rbZ32HinZ",
- "rgba32sint", "rgba3s4WWnq", "rgba32sOOt", "oogba2Yin", "ga32unt",
- "Fga32uint", "rgb32uinw", "rgba32uint", "rgGf32uit", "rgbaqKKuint",
- "rFba32ummnt", "rgba8snt", "rgq8sint", "rbbba8bin", "rgba8sint",
- "rgbisint", "rgq8sinOO", "rgbaTTvvint", "rgFFa8snorm", "rg00QsnPrm",
- "rgbaPsnorm", "rgba8snorm", "rgb77ssnorm", "rgba8snbbRRC", "rgbXX8snorm",
- "qgCCOO8iOOt", "rsauuinL", "rgXa8uint", "rgba8uint", "rgba8int",
- "rgbunqq", "rg22a8uint", "rybXX0nzzrm", "rgVVa8iorP", "rbaCunnnrm",
- "rgba8unorm", "ba8unoqqHHA", "rga8unorm", "rgfa8uKKo",
+ "bgraunccrm", "blranr3", "bVra8unorm", "bgra8unorm", "bgra1unorm",
+ "bgrJqqnorm", "bgr7ll8unorm", "qq32lppHat", "c2fov", "r32Goat",
+ "r32float", "r3viiloat", "r3WWflo8t", "rxxfMoat", "rXsingg",
+ "3siXt", "r32s3nt", "r32sint", "E32sint", "rPTTsint",
+ "r32sidxx", "r442uint", "r3SSuiVVt", "R32R22t", "r32uint",
+ "rFui9t", "r32int", "VOORRHnt", "r8noym", "lln8rrn77rm",
+ "r8un4r00", "r8unorm", "8noom", "zznorm", "riiuppo1",
+ "rg32floaXX", "rg355flo99nII", "rrr32floSSaHH", "rg32float", "kk3Hoat",
+ "jg2loaRR", "rg2loab", "rg32jint", "rg32snt", "rgqint",
+ "rg32sint", "rg32inNN", "g3vvint", "rg2sQQnt", "rg3furt",
+ "rgj2uint", "rg3wNN82t", "rg32uint", "rg32unt", "rgrr2uint",
+ "rG32uint", "FFgba16float", "rEb16loa", "rga16frroat", "rgba16float",
+ "rgba6loat", "Xba1JJfDoat", "rga6fl8a", "rg111kin", "rgb16sint",
+ "rgJa16sit", "rgba16sint", "rgca16sint", "rgba16Oint", "KKgba__v6sintt",
+ "rg5a16xxnt", "__ba1uqqFt", "rgbqq6uint", "rgba16uint", "33ba16u66nt",
+ "rtt6a1QQooint", "r66ba1uint", "rgbx266loaOz", "yygba32float", "gba3ZZHoat",
+ "rgba32float", "WWga32floq4t", "rgba3OOfoat", "rYoha2flat", "ga32snt",
+ "Fga32sint", "rgb32sinw", "rgba32sint", "rgGf32sit", "rgbaqKKsint",
+ "rFba32smmnt", "rgba32uit", "rqba3uint", "rgbabb2uin", "rgba32uint",
+ "rba32iint", "qgba32uiOt", "rgba32uiTTvv", "rgbaFFsint", "rgQa00siP",
+ "rgPa8sint", "rgba8sint", "rgssa77snt", "Cgbbb8siRRt", "rgba8sinXX",
+ "CqgbaOOsnorm", "rgbu8ssrL", "rgba8Xnorm", "rgba8snorm", "rgba8snrm",
+ "ba8sqqor", "rgba8snor22", "rzzyaXui0t", "rPbi8uint", "rgaCnnint",
+ "rgba8uint", "bqqAAuinHH", "rgba8unt", "rgb8uiKf", "raggunorm",
+ "rgb8unorm", "rgba8uTNo4m", "rgba8unorm", "rgla8unppr7", "rg8zznNNrm",
+ "bXXbauuuorm",
};
for (auto _ : state) {
for (auto* str : kStrings) {
diff --git a/src/tint/lang/core/texel_format_test.cc b/src/tint/lang/core/texel_format_test.cc
index 1500656..ae49396 100644
--- a/src/tint/lang/core/texel_format_test.cc
+++ b/src/tint/lang/core/texel_format_test.cc
@@ -59,42 +59,43 @@
static constexpr Case kValidCases[] = {
{"bgra8unorm", TexelFormat::kBgra8Unorm}, {"r32float", TexelFormat::kR32Float},
{"r32sint", TexelFormat::kR32Sint}, {"r32uint", TexelFormat::kR32Uint},
- {"rg32float", TexelFormat::kRg32Float}, {"rg32sint", TexelFormat::kRg32Sint},
- {"rg32uint", TexelFormat::kRg32Uint}, {"rgba16float", TexelFormat::kRgba16Float},
- {"rgba16sint", TexelFormat::kRgba16Sint}, {"rgba16uint", TexelFormat::kRgba16Uint},
- {"rgba32float", TexelFormat::kRgba32Float}, {"rgba32sint", TexelFormat::kRgba32Sint},
- {"rgba32uint", TexelFormat::kRgba32Uint}, {"rgba8sint", TexelFormat::kRgba8Sint},
- {"rgba8snorm", TexelFormat::kRgba8Snorm}, {"rgba8uint", TexelFormat::kRgba8Uint},
- {"rgba8unorm", TexelFormat::kRgba8Unorm},
+ {"r8unorm", TexelFormat::kR8Unorm}, {"rg32float", TexelFormat::kRg32Float},
+ {"rg32sint", TexelFormat::kRg32Sint}, {"rg32uint", TexelFormat::kRg32Uint},
+ {"rgba16float", TexelFormat::kRgba16Float}, {"rgba16sint", TexelFormat::kRgba16Sint},
+ {"rgba16uint", TexelFormat::kRgba16Uint}, {"rgba32float", TexelFormat::kRgba32Float},
+ {"rgba32sint", TexelFormat::kRgba32Sint}, {"rgba32uint", TexelFormat::kRgba32Uint},
+ {"rgba8sint", TexelFormat::kRgba8Sint}, {"rgba8snorm", TexelFormat::kRgba8Snorm},
+ {"rgba8uint", TexelFormat::kRgba8Uint}, {"rgba8unorm", TexelFormat::kRgba8Unorm},
};
static constexpr Case kInvalidCases[] = {
- {"bgraunccrm", TexelFormat::kUndefined}, {"blranr3", TexelFormat::kUndefined},
- {"bVra8unorm", TexelFormat::kUndefined}, {"132float", TexelFormat::kUndefined},
- {"32Jlqqat", TexelFormat::kUndefined}, {"ll3277loat", TexelFormat::kUndefined},
- {"ppqq2snHH", TexelFormat::kUndefined}, {"r3cv", TexelFormat::kUndefined},
- {"b2siGt", TexelFormat::kUndefined}, {"r32uiivt", TexelFormat::kUndefined},
- {"8WW2uint", TexelFormat::kUndefined}, {"rxxuint", TexelFormat::kUndefined},
- {"rX2flggat", TexelFormat::kUndefined}, {"rg3XVut", TexelFormat::kUndefined},
- {"3g32float", TexelFormat::kUndefined}, {"rg3Esint", TexelFormat::kUndefined},
- {"PP32TTint", TexelFormat::kUndefined}, {"xxg32ddnt", TexelFormat::kUndefined},
- {"44g32uint", TexelFormat::kUndefined}, {"rSS32uinVV", TexelFormat::kUndefined},
- {"R322Rint", TexelFormat::kUndefined}, {"rgba16fF9a", TexelFormat::kUndefined},
- {"rgba16floa", TexelFormat::kUndefined}, {"rOObVR16floH", TexelFormat::kUndefined},
- {"ryba1sint", TexelFormat::kUndefined}, {"r77ba1nnsllrrt", TexelFormat::kUndefined},
- {"rgb4006sint", TexelFormat::kUndefined}, {"rb1uioot", TexelFormat::kUndefined},
- {"rga1uzznt", TexelFormat::kUndefined}, {"r11b1uppiit", TexelFormat::kUndefined},
- {"rgba32fXXoat", TexelFormat::kUndefined}, {"rgbII99355float", TexelFormat::kUndefined},
- {"rgbaa32fSSrHHYt", TexelFormat::kUndefined}, {"rbkk2Hit", TexelFormat::kUndefined},
- {"jgba3sgRR", TexelFormat::kUndefined}, {"rgbab2si", TexelFormat::kUndefined},
- {"rgba32jint", TexelFormat::kUndefined}, {"rba32uint", TexelFormat::kUndefined},
- {"rgba2uqn", TexelFormat::kUndefined}, {"rbaNNsint", TexelFormat::kUndefined},
- {"rga8invv", TexelFormat::kUndefined}, {"gba8sQQnt", TexelFormat::kUndefined},
- {"rgbsnrrff", TexelFormat::kUndefined}, {"rgba8snojm", TexelFormat::kUndefined},
- {"NNgba8sww2m", TexelFormat::kUndefined}, {"rgba8uit", TexelFormat::kUndefined},
- {"rrgba8uint", TexelFormat::kUndefined}, {"rgba8uiGt", TexelFormat::kUndefined},
- {"rgba8unFFrm", TexelFormat::kUndefined}, {"g8unErm", TexelFormat::kUndefined},
- {"rgb8urrorm", TexelFormat::kUndefined},
+ {"bgraunccrm", TexelFormat::kUndefined}, {"blranr3", TexelFormat::kUndefined},
+ {"bVra8unorm", TexelFormat::kUndefined}, {"132float", TexelFormat::kUndefined},
+ {"32Jlqqat", TexelFormat::kUndefined}, {"ll3277loat", TexelFormat::kUndefined},
+ {"ppqq2snHH", TexelFormat::kUndefined}, {"r3cv", TexelFormat::kUndefined},
+ {"b2siGt", TexelFormat::kUndefined}, {"r32uiivt", TexelFormat::kUndefined},
+ {"8WW2uint", TexelFormat::kUndefined}, {"rxxuint", TexelFormat::kUndefined},
+ {"rXnorgg", TexelFormat::kUndefined}, {"8noXm", TexelFormat::kUndefined},
+ {"r8un3rm", TexelFormat::kUndefined}, {"rg32floEt", TexelFormat::kUndefined},
+ {"rgTTP2loat", TexelFormat::kUndefined}, {"ddg32loxxt", TexelFormat::kUndefined},
+ {"44g32sint", TexelFormat::kUndefined}, {"rSS32sinVV", TexelFormat::kUndefined},
+ {"R322Rint", TexelFormat::kUndefined}, {"gF29int", TexelFormat::kUndefined},
+ {"rg3uint", TexelFormat::kUndefined}, {"ROOgH2iVt", TexelFormat::kUndefined},
+ {"rgya16flot", TexelFormat::kUndefined}, {"rrgba16flll77Gt", TexelFormat::kUndefined},
+ {"rgba46fl00at", TexelFormat::kUndefined}, {"rb1sioot", TexelFormat::kUndefined},
+ {"rga1szznt", TexelFormat::kUndefined}, {"r11b1sppiit", TexelFormat::kUndefined},
+ {"XXgba16uint", TexelFormat::kUndefined}, {"IIgb9916nni55t", TexelFormat::kUndefined},
+ {"rYbaSSrruiHHat", TexelFormat::kUndefined}, {"gHkkfloat", TexelFormat::kUndefined},
+ {"jRRba3fgat", TexelFormat::kUndefined}, {"rba32flbt", TexelFormat::kUndefined},
+ {"rgba32jint", TexelFormat::kUndefined}, {"rba32sint", TexelFormat::kUndefined},
+ {"rgba2sqn", TexelFormat::kUndefined}, {"rgba3NNuit", TexelFormat::kUndefined},
+ {"rga3vvint", TexelFormat::kUndefined}, {"rgba32uinQ", TexelFormat::kUndefined},
+ {"rgbasirf", TexelFormat::kUndefined}, {"rgbajsint", TexelFormat::kUndefined},
+ {"wNNgbasin2", TexelFormat::kUndefined}, {"rgba8snrm", TexelFormat::kUndefined},
+ {"rgba8srrorm", TexelFormat::kUndefined}, {"rgba8Gnorm", TexelFormat::kUndefined},
+ {"rgba8uFFnt", TexelFormat::kUndefined}, {"Ega8un", TexelFormat::kUndefined},
+ {"rgrr8uint", TexelFormat::kUndefined}, {"gba8unom", TexelFormat::kUndefined},
+ {"rXa8DnoJJm", TexelFormat::kUndefined}, {"rganorm", TexelFormat::kUndefined},
};
using TexelFormatParseTest = testing::TestWithParam<Case>;
diff --git a/src/tint/lang/core/type/storage_texture.cc b/src/tint/lang/core/type/storage_texture.cc
index 879ff99..ea7c9ca 100644
--- a/src/tint/lang/core/type/storage_texture.cc
+++ b/src/tint/lang/core/type/storage_texture.cc
@@ -80,6 +80,7 @@
return type_mgr.Get<I32>();
}
+ case core::TexelFormat::kR8Unorm:
case core::TexelFormat::kBgra8Unorm:
case core::TexelFormat::kRgba8Unorm:
case core::TexelFormat::kRgba8Snorm:
diff --git a/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc b/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
index 6ecc839..21ff1b8 100644
--- a/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/glsl/writer/ast_printer/ast_printer.cc
@@ -274,8 +274,9 @@
"GLSL", builder_.AST(), diagnostics_,
Vector{
wgsl::Extension::kChromiumDisableUniformityAnalysis,
- wgsl::Extension::kChromiumInternalDualSourceBlending,
wgsl::Extension::kChromiumExperimentalPushConstant,
+ wgsl::Extension::kChromiumInternalDualSourceBlending,
+ wgsl::Extension::kChromiumInternalGraphite,
wgsl::Extension::kF16,
})) {
return false;
@@ -2028,6 +2029,9 @@
case core::TexelFormat::kRgba32Float:
out << "rgba32f";
break;
+ case core::TexelFormat::kR8Unorm:
+ out << "r8";
+ break;
case core::TexelFormat::kUndefined:
TINT_ICE() << "invalid texel format";
return;
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 658beeb..387ddb9 100644
--- a/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/hlsl/writer/ast_printer/ast_printer.cc
@@ -105,8 +105,9 @@
const char kTempNamePrefix[] = "tint_tmp";
-const char* image_format_to_rwtexture_type(core::TexelFormat image_format) {
+const char* ImageFormatToRWtextureType(core::TexelFormat image_format) {
switch (image_format) {
+ case core::TexelFormat::kR8Unorm:
case core::TexelFormat::kBgra8Unorm:
case core::TexelFormat::kRgba8Unorm:
case core::TexelFormat::kRgba8Snorm:
@@ -388,11 +389,12 @@
"HLSL", builder_.AST(), diagnostics_,
Vector{
wgsl::Extension::kChromiumDisableUniformityAnalysis,
+ wgsl::Extension::kChromiumExperimentalPixelLocal,
wgsl::Extension::kChromiumExperimentalPushConstant,
wgsl::Extension::kChromiumExperimentalSubgroups,
- wgsl::Extension::kF16,
wgsl::Extension::kChromiumInternalDualSourceBlending,
- wgsl::Extension::kChromiumExperimentalPixelLocal,
+ wgsl::Extension::kChromiumInternalGraphite,
+ wgsl::Extension::kF16,
})) {
return false;
}
@@ -3459,7 +3461,7 @@
return false;
}
out << "RasterizerOrderedTexture2D";
- auto* component = image_format_to_rwtexture_type(storage->texel_format());
+ auto* component = ImageFormatToRWtextureType(storage->texel_format());
if (TINT_UNLIKELY(!component)) {
TINT_ICE() << "Unsupported StorageTexture TexelFormat: "
<< static_cast<int>(storage->texel_format());
@@ -4460,7 +4462,7 @@
}
if (storage) {
- auto* component = image_format_to_rwtexture_type(storage->texel_format());
+ auto* component = ImageFormatToRWtextureType(storage->texel_format());
if (TINT_UNLIKELY(!component)) {
TINT_ICE() << "Unsupported StorageTexture TexelFormat: "
<< static_cast<int>(storage->texel_format());
diff --git a/src/tint/lang/msl/writer/ast_printer/ast_printer.cc b/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
index c2442f5..9a574b7 100644
--- a/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
+++ b/src/tint/lang/msl/writer/ast_printer/ast_printer.cc
@@ -273,10 +273,11 @@
"MSL", builder_.AST(), diagnostics_,
Vector{
wgsl::Extension::kChromiumDisableUniformityAnalysis,
+ wgsl::Extension::kChromiumExperimentalFramebufferFetch,
wgsl::Extension::kChromiumExperimentalPixelLocal,
wgsl::Extension::kChromiumExperimentalSubgroups,
- wgsl::Extension::kChromiumExperimentalFramebufferFetch,
wgsl::Extension::kChromiumInternalDualSourceBlending,
+ wgsl::Extension::kChromiumInternalGraphite,
wgsl::Extension::kChromiumInternalRelaxedUniformLayout,
wgsl::Extension::kF16,
})) {
diff --git a/src/tint/lang/spirv/intrinsic/data.cc b/src/tint/lang/spirv/intrinsic/data.cc
index 27b7ab3..b00c77c 100644
--- a/src/tint/lang/spirv/intrinsic/data.cc
+++ b/src/tint/lang/spirv/intrinsic/data.cc
@@ -1014,6 +1014,7 @@
constexpr NumberMatcher kF32TexelFormatMatcher {
/* match */ [](MatchState&, Number number) -> Number {
switch (static_cast<core::TexelFormat>(number.Value())) {
+ case core::TexelFormat::kR8Unorm:
case core::TexelFormat::kBgra8Unorm:
case core::TexelFormat::kRgba8Unorm:
case core::TexelFormat::kRgba8Snorm:
@@ -1027,7 +1028,7 @@
}
},
/* print */ [](MatchState*, StyledText& out) {
- out<< style::Enum("bgra8unorm")<< style::Plain(", ") << style::Enum("rgba8unorm")<< style::Plain(", ") << style::Enum("rgba8snorm")<< style::Plain(", ") << style::Enum("rgba16float")<< style::Plain(", ") << style::Enum("r32float")<< style::Plain(", ") << style::Enum("rg32float")<< style::Plain(" or ") << style::Enum("rgba32float");
+ out<< style::Enum("r8unorm")<< style::Plain(", ") << style::Enum("bgra8unorm")<< style::Plain(", ") << style::Enum("rgba8unorm")<< style::Plain(", ") << style::Enum("rgba8snorm")<< style::Plain(", ") << style::Enum("rgba16float")<< style::Plain(", ") << style::Enum("r32float")<< style::Plain(", ") << style::Enum("rg32float")<< style::Plain(" or ") << style::Enum("rgba32float");
}
};
diff --git a/src/tint/lang/spirv/spirv.def b/src/tint/lang/spirv/spirv.def
index 96fb6c4..9dabb13 100644
--- a/src/tint/lang/spirv/spirv.def
+++ b/src/tint/lang/spirv/spirv.def
@@ -99,7 +99,8 @@
| sampler_comparison
match f32_texel_format
- : texel_format.bgra8unorm
+ : texel_format.r8unorm
+ | texel_format.bgra8unorm
| texel_format.rgba8unorm
| texel_format.rgba8snorm
| texel_format.rgba16float
diff --git a/src/tint/lang/spirv/writer/ast_printer/builder.cc b/src/tint/lang/spirv/writer/ast_printer/builder.cc
index a412f49..9673668 100644
--- a/src/tint/lang/spirv/writer/ast_printer/builder.cc
+++ b/src/tint/lang/spirv/writer/ast_printer/builder.cc
@@ -279,8 +279,9 @@
wgsl::Extension::kChromiumDisableUniformityAnalysis,
wgsl::Extension::kChromiumExperimentalPushConstant,
wgsl::Extension::kChromiumExperimentalSubgroups,
- wgsl::Extension::kF16,
wgsl::Extension::kChromiumInternalDualSourceBlending,
+ wgsl::Extension::kChromiumInternalGraphite,
+ wgsl::Extension::kF16,
})) {
return false;
}
@@ -4109,6 +4110,9 @@
case core::TexelFormat::kBgra8Unorm:
TINT_ICE() << "bgra8unorm should have been polyfilled to rgba8unorm";
return SpvImageFormatUnknown;
+ case core::TexelFormat::kR8Unorm:
+ module_.PushCapability(SpvCapabilityStorageImageExtendedFormats);
+ return SpvImageFormatR8;
case core::TexelFormat::kR32Uint:
return SpvImageFormatR32ui;
case core::TexelFormat::kR32Sint:
diff --git a/src/tint/lang/spirv/writer/printer/printer.cc b/src/tint/lang/spirv/writer/printer/printer.cc
index 9fc98fd..c38f018 100644
--- a/src/tint/lang/spirv/writer/printer/printer.cc
+++ b/src/tint/lang/spirv/writer/printer/printer.cc
@@ -2228,6 +2228,9 @@
case core::TexelFormat::kBgra8Unorm:
TINT_ICE() << "bgra8unorm should have been polyfilled to rgba8unorm";
return SpvImageFormatUnknown;
+ case core::TexelFormat::kR8Unorm:
+ module_.PushCapability(SpvCapabilityStorageImageExtendedFormats);
+ return SpvImageFormatR8;
case core::TexelFormat::kR32Uint:
return SpvImageFormatR32ui;
case core::TexelFormat::kR32Sint:
diff --git a/src/tint/lang/wgsl/inspector/resource_binding.cc b/src/tint/lang/wgsl/inspector/resource_binding.cc
index 810e544..0cf21bb 100644
--- a/src/tint/lang/wgsl/inspector/resource_binding.cc
+++ b/src/tint/lang/wgsl/inspector/resource_binding.cc
@@ -120,6 +120,8 @@
return ResourceBinding::TexelFormat::kRgba32Sint;
case core::TexelFormat::kRgba32Float:
return ResourceBinding::TexelFormat::kRgba32Float;
+ case core::TexelFormat::kR8Unorm:
+ return ResourceBinding::TexelFormat::kR8Unorm;
case core::TexelFormat::kUndefined:
return ResourceBinding::TexelFormat::kNone;
}
diff --git a/src/tint/lang/wgsl/inspector/resource_binding.h b/src/tint/lang/wgsl/inspector/resource_binding.h
index 86fb720..1c1f801 100644
--- a/src/tint/lang/wgsl/inspector/resource_binding.h
+++ b/src/tint/lang/wgsl/inspector/resource_binding.h
@@ -80,6 +80,7 @@
kRgba32Uint,
kRgba32Sint,
kRgba32Float,
+ kR8Unorm,
kNone,
};
diff --git a/src/tint/lang/wgsl/intrinsic/data.cc b/src/tint/lang/wgsl/intrinsic/data.cc
index f5ec9db..3a84f91 100644
--- a/src/tint/lang/wgsl/intrinsic/data.cc
+++ b/src/tint/lang/wgsl/intrinsic/data.cc
@@ -1529,6 +1529,7 @@
constexpr NumberMatcher kF32TexelFormatMatcher {
/* match */ [](MatchState&, Number number) -> Number {
switch (static_cast<core::TexelFormat>(number.Value())) {
+ case core::TexelFormat::kR8Unorm:
case core::TexelFormat::kBgra8Unorm:
case core::TexelFormat::kRgba8Unorm:
case core::TexelFormat::kRgba8Snorm:
@@ -1542,7 +1543,7 @@
}
},
/* print */ [](MatchState*, StyledText& out) {
- out<< style::Enum("bgra8unorm")<< style::Plain(", ") << style::Enum("rgba8unorm")<< style::Plain(", ") << style::Enum("rgba8snorm")<< style::Plain(", ") << style::Enum("rgba16float")<< style::Plain(", ") << style::Enum("r32float")<< style::Plain(", ") << style::Enum("rg32float")<< style::Plain(" or ") << style::Enum("rgba32float");
+ out<< style::Enum("r8unorm")<< style::Plain(", ") << style::Enum("bgra8unorm")<< style::Plain(", ") << style::Enum("rgba8unorm")<< style::Plain(", ") << style::Enum("rgba8snorm")<< style::Plain(", ") << style::Enum("rgba16float")<< style::Plain(", ") << style::Enum("r32float")<< style::Plain(", ") << style::Enum("rg32float")<< style::Plain(" or ") << style::Enum("rgba32float");
}
};
diff --git a/src/tint/lang/wgsl/resolver/BUILD.bazel b/src/tint/lang/wgsl/resolver/BUILD.bazel
index 51904b9..9893abb 100644
--- a/src/tint/lang/wgsl/resolver/BUILD.bazel
+++ b/src/tint/lang/wgsl/resolver/BUILD.bazel
@@ -121,6 +121,7 @@
"f16_extension_test.cc",
"framebuffer_fetch_extension_test.cc",
"function_validation_test.cc",
+ "graphite_extension_test.cc",
"host_shareable_validation_test.cc",
"increment_decrement_validation_test.cc",
"inferred_type_test.cc",
diff --git a/src/tint/lang/wgsl/resolver/BUILD.cmake b/src/tint/lang/wgsl/resolver/BUILD.cmake
index 6cb53ed..429b9c0 100644
--- a/src/tint/lang/wgsl/resolver/BUILD.cmake
+++ b/src/tint/lang/wgsl/resolver/BUILD.cmake
@@ -119,6 +119,7 @@
lang/wgsl/resolver/f16_extension_test.cc
lang/wgsl/resolver/framebuffer_fetch_extension_test.cc
lang/wgsl/resolver/function_validation_test.cc
+ lang/wgsl/resolver/graphite_extension_test.cc
lang/wgsl/resolver/host_shareable_validation_test.cc
lang/wgsl/resolver/increment_decrement_validation_test.cc
lang/wgsl/resolver/inferred_type_test.cc
diff --git a/src/tint/lang/wgsl/resolver/BUILD.gn b/src/tint/lang/wgsl/resolver/BUILD.gn
index 18cab8b..9456dbb 100644
--- a/src/tint/lang/wgsl/resolver/BUILD.gn
+++ b/src/tint/lang/wgsl/resolver/BUILD.gn
@@ -121,6 +121,7 @@
"f16_extension_test.cc",
"framebuffer_fetch_extension_test.cc",
"function_validation_test.cc",
+ "graphite_extension_test.cc",
"host_shareable_validation_test.cc",
"increment_decrement_validation_test.cc",
"inferred_type_test.cc",
diff --git a/src/tint/lang/wgsl/resolver/graphite_extension_test.cc b/src/tint/lang/wgsl/resolver/graphite_extension_test.cc
new file mode 100644
index 0000000..71f727e
--- /dev/null
+++ b/src/tint/lang/wgsl/resolver/graphite_extension_test.cc
@@ -0,0 +1,72 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "src/tint/lang/core/access.h"
+#include "src/tint/lang/core/texel_format.h"
+#include "src/tint/lang/core/type/texture_dimension.h"
+#include "src/tint/lang/wgsl/resolver/resolver.h"
+#include "src/tint/lang/wgsl/resolver/resolver_helper_test.h"
+
+#include "gmock/gmock.h"
+
+namespace tint::resolver {
+namespace {
+
+using namespace tint::core::fluent_types; // NOLINT
+using namespace tint::core::number_suffixes; // NOLINT
+
+using ResolverGraphiteExtensionTest = ResolverTest;
+
+TEST_F(ResolverGraphiteExtensionTest, r8unorm_UseWithoutExtension) {
+ // @group(0) @binding(0) var T: texture_storage_2d<r8unorm, write>;
+
+ GlobalVar("T",
+ ty.storage_texture(core::type::TextureDimension::k2d, core::TexelFormat::kR8Unorm,
+ core::Access::kWrite),
+ Vector{Group(0_a), Binding(0_a)});
+
+ EXPECT_FALSE(r()->Resolve());
+ EXPECT_EQ(r()->error(),
+ R"(error: 'r8unorm' requires the 'chromium_internal_graphite' extension)");
+}
+
+TEST_F(ResolverGraphiteExtensionTest, r8unorm_UseWithExtension) {
+ // enable chromium_internal_graphite;
+ // @group(0) @binding(0) var T: texture_storage_3d<r8unorm, read_write>;
+
+ Enable(Source{{12, 34}}, wgsl::Extension::kChromiumInternalGraphite);
+
+ GlobalVar("T",
+ ty.storage_texture(core::type::TextureDimension::k2d, core::TexelFormat::kR8Unorm,
+ core::Access::kWrite),
+ Vector{Group(0_a), Binding(0_a)});
+
+ EXPECT_TRUE(r()->Resolve()) << r()->error();
+}
+
+} // namespace
+} // namespace tint::resolver
diff --git a/src/tint/lang/wgsl/resolver/resolver.cc b/src/tint/lang/wgsl/resolver/resolver.cc
index 945fd29..b1a1775 100644
--- a/src/tint/lang/wgsl/resolver/resolver.cc
+++ b/src/tint/lang/wgsl/resolver/resolver.cc
@@ -37,6 +37,7 @@
#include "src/tint/lang/core/builtin_type.h"
#include "src/tint/lang/core/constant/scalar.h"
#include "src/tint/lang/core/fluent_types.h"
+#include "src/tint/lang/core/texel_format.h"
#include "src/tint/lang/core/type/abstract_float.h"
#include "src/tint/lang/core/type/abstract_int.h"
#include "src/tint/lang/core/type/array.h"
diff --git a/src/tint/lang/wgsl/resolver/unresolved_identifier_test.cc b/src/tint/lang/wgsl/resolver/unresolved_identifier_test.cc
index fe16964..98aa12d 100644
--- a/src/tint/lang/wgsl/resolver/unresolved_identifier_test.cc
+++ b/src/tint/lang/wgsl/resolver/unresolved_identifier_test.cc
@@ -70,7 +70,7 @@
EXPECT_FALSE(r()->Resolve());
EXPECT_EQ(r()->error(), R"(12:34 error: unresolved texel format 'rba8unorm'
12:34 note: Did you mean 'rgba8unorm'?
-Possible values: 'bgra8unorm', 'r32float', 'r32sint', 'r32uint', 'rg32float', 'rg32sint', 'rg32uint', 'rgba16float', 'rgba16sint', 'rgba16uint', 'rgba32float', 'rgba32sint', 'rgba32uint', 'rgba8sint', 'rgba8snorm', 'rgba8uint', 'rgba8unorm')");
+Possible values: 'bgra8unorm', 'r32float', 'r32sint', 'r32uint', 'r8unorm', 'rg32float', 'rg32sint', 'rg32uint', 'rgba16float', 'rgba16sint', 'rgba16uint', 'rgba32float', 'rgba32sint', 'rgba32uint', 'rgba8sint', 'rgba8snorm', 'rgba8uint', 'rgba8unorm')");
}
TEST_F(ResolverUnresolvedIdentifierSuggestions, AccessMode) {
diff --git a/src/tint/lang/wgsl/resolver/validator.cc b/src/tint/lang/wgsl/resolver/validator.cc
index c852f7f..c6412ff 100644
--- a/src/tint/lang/wgsl/resolver/validator.cc
+++ b/src/tint/lang/wgsl/resolver/validator.cc
@@ -115,22 +115,23 @@
bool IsValidStorageTextureTexelFormat(core::TexelFormat format) {
switch (format) {
case core::TexelFormat::kBgra8Unorm:
- case core::TexelFormat::kR32Uint:
- case core::TexelFormat::kR32Sint:
case core::TexelFormat::kR32Float:
- case core::TexelFormat::kRg32Uint:
- case core::TexelFormat::kRg32Sint:
+ case core::TexelFormat::kR32Sint:
+ case core::TexelFormat::kR32Uint:
+ case core::TexelFormat::kR8Unorm:
case core::TexelFormat::kRg32Float:
- case core::TexelFormat::kRgba8Unorm:
+ case core::TexelFormat::kRg32Sint:
+ case core::TexelFormat::kRg32Uint:
+ case core::TexelFormat::kRgba16Float:
+ case core::TexelFormat::kRgba16Sint:
+ case core::TexelFormat::kRgba16Uint:
+ case core::TexelFormat::kRgba32Float:
+ case core::TexelFormat::kRgba32Sint:
+ case core::TexelFormat::kRgba32Uint:
+ case core::TexelFormat::kRgba8Sint:
case core::TexelFormat::kRgba8Snorm:
case core::TexelFormat::kRgba8Uint:
- case core::TexelFormat::kRgba8Sint:
- case core::TexelFormat::kRgba16Uint:
- case core::TexelFormat::kRgba16Sint:
- case core::TexelFormat::kRgba16Float:
- case core::TexelFormat::kRgba32Uint:
- case core::TexelFormat::kRgba32Sint:
- case core::TexelFormat::kRgba32Float:
+ case core::TexelFormat::kRgba8Unorm:
return true;
default:
return false;
@@ -363,21 +364,18 @@
case core::Access::kRead:
if (!allowed_features_.features.count(
wgsl::LanguageFeature::kReadonlyAndReadwriteStorageTextures)) {
- AddError(source) <<
-
- "read-only storage textures require the "
- "readonly_and_readwrite_storage_textures language feature, which is not "
- "allowed in the current environment";
+ AddError(source) << "read-only storage textures require the "
+ "readonly_and_readwrite_storage_textures language feature, "
+ "which is not allowed in the current environment";
return false;
}
break;
case core::Access::kReadWrite:
if (!allowed_features_.features.count(
wgsl::LanguageFeature::kReadonlyAndReadwriteStorageTextures)) {
- AddError(source)
- << "read-write storage textures require the "
- "readonly_and_readwrite_storage_textures language feature, which is not "
- "allowed in the current environment";
+ AddError(source) << "read-write storage textures require the "
+ "readonly_and_readwrite_storage_textures language feature, "
+ "which is not allowed in the current environment";
return false;
}
break;
@@ -388,6 +386,13 @@
return false;
}
+ if (TINT_UNLIKELY(t->texel_format() == core::TexelFormat::kR8Unorm &&
+ !enabled_extensions_.Contains(wgsl::Extension::kChromiumInternalGraphite))) {
+ AddError(source) << style::Enum(core::TexelFormat::kR8Unorm) << " requires the "
+ << style::Code(wgsl::Extension::kChromiumInternalGraphite) << " extension";
+ return false;
+ }
+
if (!IsValidStorageTextureDimension(t->dim())) {
AddError(source) << "cube dimensions for storage textures are not supported";
return false;
diff --git a/src/tint/lang/wgsl/wgsl.def b/src/tint/lang/wgsl/wgsl.def
index b851cdb..e61ab87 100644
--- a/src/tint/lang/wgsl/wgsl.def
+++ b/src/tint/lang/wgsl/wgsl.def
@@ -197,7 +197,8 @@
// https://gpuweb.github.io/gpuweb/wgsl/#texel-formats
match f32_texel_format
- : texel_format.bgra8unorm
+ : texel_format.r8unorm
+ | texel_format.bgra8unorm
| texel_format.rgba8unorm
| texel_format.rgba8snorm
| texel_format.rgba16float
diff --git a/test/tint/builtins/gen/gen.wgsl.tmpl b/test/tint/builtins/gen/gen.wgsl.tmpl
index 5e3684b..7d3bd95 100644
--- a/test/tint/builtins/gen/gen.wgsl.tmpl
+++ b/test/tint/builtins/gen/gen.wgsl.tmpl
@@ -209,7 +209,7 @@
// [hlsl-dxc] flags: --hlsl_shader_model 64
{{- /* Check and emit f16 */ -}}
-{{- else if OverloadUsesF16 $overload}}
+{{- else if OverloadUsesType $overload "f16"}}
// flags: --hlsl_shader_model 62
{{ end -}}
@@ -225,16 +225,21 @@
{{- $overload := $permutation.Overload -}}
{{- $builtin_name := $permutation.Intrinsic.Name -}}
-{{- /* Check and emit chromium_experimental_subgroups */ -}}
+{{- /* Emit 'enable chromium_experimental_subgroups' if required */ -}}
{{- if or (eq "subgroupBallot" $builtin_name) (eq "subgroupBroadcast" $builtin_name)}}
enable chromium_experimental_subgroups;
{{ end -}}
-{{- /* Check and emit f16 */ -}}
-{{- if OverloadUsesF16 $overload}}
+{{- /* Emit 'enable f16' if required */ -}}
+{{- if OverloadUsesType $overload "f16"}}
enable f16;
{{ end -}}
+{{- /* Emit 'enable chromium_internal_graphite' if required */ -}}
+{{- if OverloadUsesType $overload "r8unorm"}}
+enable chromium_internal_graphite;
+{{ end -}}
+
{{- end -}}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl
new file mode 100644
index 0000000..f13d44a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read>;
+
+// fn textureDimensions(texture: texture_storage_3d<r8unorm, read>) -> vec3<u32>
+fn textureDimensions_00229f() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_00229f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_00229f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_00229f();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9819f9a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_00229f() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+ prevent_dce.Store3(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_00229f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_00229f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_00229f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9819f9a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_00229f() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+ prevent_dce.Store3(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_00229f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_00229f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_00229f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.glsl
new file mode 100644
index 0000000..8fa9903
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_00229f() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_00229f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_00229f() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_00229f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_00229f() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_00229f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.msl
new file mode 100644
index 0000000..0266662
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_00229f(texture3d<float, access::read> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+ *(tint_symbol_2) = packed_uint3(res);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+ textureDimensions_00229f(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_00229f(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_00229f(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.spvasm
new file mode 100644
index 0000000..eae0111
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_00229f "textureDimensions_00229f"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %25 = OpConstantNull %v3uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_00229f = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v3uint %22
+ OpStore %res %21
+ %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+ %29 = OpLoad %v3uint %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_00229f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_00229f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_00229f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.wgsl
new file mode 100644
index 0000000..d49f90c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00229f.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read>;
+
+fn textureDimensions_00229f() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_00229f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_00229f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_00229f();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/01e21e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/01e21e.wgsl.expected.glsl
index 5b0dc9a..bb83cc6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/01e21e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/01e21e.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/029589.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/029589.wgsl.expected.glsl
index 9f076b3..997a1c6 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/029589.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/029589.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/08e371.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/08e371.wgsl.expected.glsl
index 172375f..f721462 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/08e371.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/08e371.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.glsl
index 6dcaad6..4b8396e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl
new file mode 100644
index 0000000..5ca7020
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read_write>;
+
+// fn textureDimensions(texture: texture_storage_2d<r8unorm, read_write>) -> vec2<u32>
+fn textureDimensions_18160d() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_18160d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_18160d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_18160d();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8d7086b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_18160d() {
+ uint2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_18160d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_18160d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_18160d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8d7086b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_18160d() {
+ uint2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_18160d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_18160d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_18160d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.glsl
new file mode 100644
index 0000000..6899921
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_18160d() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_18160d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_18160d() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_18160d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_18160d() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_18160d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.msl
new file mode 100644
index 0000000..642939b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_18160d(texture2d<float, access::read_write> tint_symbol_1, device uint2* const tint_symbol_2) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read_write> tint_symbol_3, device uint2* const tint_symbol_4) {
+ textureDimensions_18160d(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read_write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read_write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_18160d(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read_write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_18160d(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.spvasm
new file mode 100644
index 0000000..4039245
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.spvasm
@@ -0,0 +1,91 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_18160d "textureDimensions_18160d"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_18160d = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v2uint %22
+ OpStore %res %21
+ %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+ %29 = OpLoad %v2uint %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_18160d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_18160d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_18160d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.wgsl
new file mode 100644
index 0000000..fe96e98
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18160d.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read_write>;
+
+fn textureDimensions_18160d() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_18160d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_18160d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_18160d();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl
new file mode 100644
index 0000000..7f97102
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<r8unorm, write>) -> vec2<u32>
+fn textureDimensions_18f19f() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_18f19f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_18f19f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_18f19f();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..52a6582
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_18f19f() {
+ uint2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_18f19f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_18f19f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_18f19f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..52a6582
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_18f19f() {
+ uint2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_18f19f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_18f19f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_18f19f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.glsl
new file mode 100644
index 0000000..8ad231d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_18f19f() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_18f19f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_18f19f() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_18f19f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_18f19f() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_18f19f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.msl
new file mode 100644
index 0000000..f3d2074
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_18f19f(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+ textureDimensions_18f19f(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_18f19f(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_18f19f(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.spvasm
new file mode 100644
index 0000000..a58c448
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_18f19f "textureDimensions_18f19f"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_18f19f = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v2uint %22
+ OpStore %res %21
+ %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+ %29 = OpLoad %v2uint %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_18f19f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_18f19f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_18f19f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.wgsl
new file mode 100644
index 0000000..7762b88
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/18f19f.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, write>;
+
+fn textureDimensions_18f19f() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_18f19f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_18f19f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_18f19f();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.glsl
index b987f13..f62c83e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl
new file mode 100644
index 0000000..41f985a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<r8unorm, write>) -> vec2<u32>
+fn textureDimensions_25d284() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_25d284();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_25d284();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_25d284();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2df33a6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_25d284() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_25d284();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_25d284();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_25d284();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2df33a6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_25d284() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_25d284();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_25d284();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_25d284();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.glsl
new file mode 100644
index 0000000..530a42f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_25d284() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_25d284();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_25d284() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_25d284();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_25d284() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_25d284();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.msl
new file mode 100644
index 0000000..0cc7abc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_25d284(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+ textureDimensions_25d284(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_25d284(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_25d284(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.spvasm
new file mode 100644
index 0000000..d7124af
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.spvasm
@@ -0,0 +1,94 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 46
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_25d284 "textureDimensions_25d284"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %27 = OpConstantNull %v2uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+ %32 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_25d284 = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %27
+ %24 = OpLoad %11 %arg_0
+ %22 = OpImageQuerySize %v3uint %24
+ %21 = OpVectorShuffle %v2uint %22 %22 0 1
+ OpStore %res %21
+ %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+ %31 = OpLoad %v2uint %res
+ OpStore %30 %31
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %32
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_25d284
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %37 = OpLabel
+ %38 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %38
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_25d284
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureDimensions_25d284
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.wgsl
new file mode 100644
index 0000000..1c8be5f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/25d284.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, write>;
+
+fn textureDimensions_25d284() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_25d284();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_25d284();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_25d284();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.glsl
index d6a9c6e..bd21c27 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl
new file mode 100644
index 0000000..9ef2e86
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read_write>;
+
+// fn textureDimensions(texture: texture_storage_3d<r8unorm, read_write>) -> vec3<u32>
+fn textureDimensions_282978() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_282978();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_282978();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_282978();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f664a39
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_282978() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+ prevent_dce.Store3(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_282978();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_282978();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_282978();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f664a39
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_282978() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+ prevent_dce.Store3(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_282978();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_282978();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_282978();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.glsl
new file mode 100644
index 0000000..5448d1d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_282978() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_282978();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_282978() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_282978();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_282978() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_282978();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.msl
new file mode 100644
index 0000000..3a2f5b8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_282978(texture3d<float, access::read_write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+ *(tint_symbol_2) = packed_uint3(res);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read_write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+ textureDimensions_282978(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read_write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read_write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_282978(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read_write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_282978(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.spvasm
new file mode 100644
index 0000000..58c52c3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.spvasm
@@ -0,0 +1,91 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_282978 "textureDimensions_282978"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %25 = OpConstantNull %v3uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_282978 = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v3uint %22
+ OpStore %res %21
+ %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+ %29 = OpLoad %v3uint %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_282978
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_282978
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_282978
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.wgsl
new file mode 100644
index 0000000..54b0c61
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/282978.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read_write>;
+
+fn textureDimensions_282978() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_282978();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_282978();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_282978();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/284c27.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/284c27.wgsl.expected.glsl
index ec40f11..9ffb020 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/284c27.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/284c27.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.glsl
index 0901c20..3a8eb2b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.glsl
index 14d4bb7..c0d15ec 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_35ee69() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_35ee69() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_35ee69() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.glsl
index 2616f7b..fd67867 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.glsl
index cb9d999..103debc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl
new file mode 100644
index 0000000..dc1df71
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read>;
+
+// fn textureDimensions(texture: texture_storage_2d<r8unorm, read>) -> vec2<u32>
+fn textureDimensions_40da20() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_40da20();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_40da20();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_40da20();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4ec3a73
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_40da20() {
+ uint2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_40da20();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_40da20();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_40da20();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4ec3a73
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_40da20() {
+ uint2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_40da20();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_40da20();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_40da20();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.glsl
new file mode 100644
index 0000000..ae8a8360
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_40da20() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_40da20();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_40da20() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_40da20();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_40da20() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_40da20();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.msl
new file mode 100644
index 0000000..8af0da9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_40da20(texture2d<float, access::read> tint_symbol_1, device uint2* const tint_symbol_2) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read> tint_symbol_3, device uint2* const tint_symbol_4) {
+ textureDimensions_40da20(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_40da20(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_40da20(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.spvasm
new file mode 100644
index 0000000..faf1d61
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_40da20 "textureDimensions_40da20"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_40da20 = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v2uint %22
+ OpStore %res %21
+ %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+ %29 = OpLoad %v2uint %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_40da20
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_40da20
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_40da20
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.wgsl
new file mode 100644
index 0000000..81140cb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40da20.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read>;
+
+fn textureDimensions_40da20() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_40da20();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_40da20();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_40da20();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.glsl
index 36ea079..a762619 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.glsl
index 992ca3c..0c893b0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4d1f71.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/4d1f71.wgsl.expected.glsl
index 09fb035..85348c2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4d1f71.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4d1f71.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4df14c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/4df14c.wgsl.expected.glsl
index d1381c5..9956046 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/4df14c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/4df14c.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_4df14c() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_4df14c() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_4df14c() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/52cf60.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/52cf60.wgsl.expected.glsl
index 94150d5..69c3fc5 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/52cf60.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/52cf60.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl
new file mode 100644
index 0000000..83438e3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<r8unorm, write>) -> u32
+fn textureDimensions_542c62() {
+ var res: u32 = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_542c62();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_542c62();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_542c62();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..162de9b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_542c62() {
+ uint tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_542c62();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_542c62();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_542c62();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..162de9b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_542c62() {
+ uint tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_542c62();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_542c62();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_542c62();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.glsl
new file mode 100644
index 0000000..e436c5e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_542c62() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_542c62();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_542c62() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_542c62();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_542c62() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_542c62();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.msl
new file mode 100644
index 0000000..c21ad73
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_542c62(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
+ uint res = tint_symbol_1.get_width(0);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+ textureDimensions_542c62(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_542c62(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_542c62(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.spvasm
new file mode 100644
index 0000000..3b62495
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_542c62 "textureDimensions_542c62"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_542c62 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %uint %21
+ OpStore %res %20
+ %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+ %28 = OpLoad %uint %res
+ OpStore %27 %28
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_542c62
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_542c62
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_542c62
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.wgsl
new file mode 100644
index 0000000..bd3741d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/542c62.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, write>;
+
+fn textureDimensions_542c62() {
+ var res : u32 = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_542c62();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_542c62();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_542c62();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl
new file mode 100644
index 0000000..50ab98d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<r8unorm, read_write>) -> vec2<u32>
+fn textureDimensions_578e75() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_578e75();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_578e75();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_578e75();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..81df8a2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_578e75() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_578e75();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_578e75();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_578e75();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..81df8a2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_578e75() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_578e75();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_578e75();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_578e75();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.glsl
new file mode 100644
index 0000000..45c3096
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_578e75() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_578e75();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_578e75() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_578e75();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_578e75() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_578e75();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.msl
new file mode 100644
index 0000000..12ac6de
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_578e75(texture2d_array<float, access::read_write> tint_symbol_1, device uint2* const tint_symbol_2) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_3, device uint2* const tint_symbol_4) {
+ textureDimensions_578e75(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_578e75(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_578e75(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.spvasm
new file mode 100644
index 0000000..426a01e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.spvasm
@@ -0,0 +1,93 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 46
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_578e75 "textureDimensions_578e75"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %27 = OpConstantNull %v2uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+ %32 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_578e75 = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %27
+ %24 = OpLoad %11 %arg_0
+ %22 = OpImageQuerySize %v3uint %24
+ %21 = OpVectorShuffle %v2uint %22 %22 0 1
+ OpStore %res %21
+ %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+ %31 = OpLoad %v2uint %res
+ OpStore %30 %31
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %32
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_578e75
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %37 = OpLabel
+ %38 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %38
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_578e75
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureDimensions_578e75
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.wgsl
new file mode 100644
index 0000000..f0a4f7b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/578e75.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureDimensions_578e75() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_578e75();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_578e75();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_578e75();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6dae40.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/6dae40.wgsl.expected.glsl
index 05b4395..8815615 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6dae40.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6dae40.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32f) uniform highp readonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_6dae40() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_6dae40() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32f) uniform highp readonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_6dae40() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6dbef4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/6dbef4.wgsl.expected.glsl
index e47086f..1ee6bbb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/6dbef4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/6dbef4.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32i) uniform highp readonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_6dbef4() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_6dbef4() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32i) uniform highp readonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_6dbef4() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/740e7c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/740e7c.wgsl.expected.glsl
index 935af5f..83e274d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/740e7c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/740e7c.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7c7c64.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/7c7c64.wgsl.expected.glsl
index c460d46..917fe4e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7c7c64.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7c7c64.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7d8439.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/7d8439.wgsl.expected.glsl
index dc720ac..9af6882 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/7d8439.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/7d8439.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/835f90.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/835f90.wgsl.expected.glsl
index f036e74..00ddd2c 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/835f90.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/835f90.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.glsl
index a5aa090..7b5f46b 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.glsl
index 32a82ca..87202cb 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl
new file mode 100644
index 0000000..b1d858b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<r8unorm, read>) -> vec2<u32>
+fn textureDimensions_8af728() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_8af728();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_8af728();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_8af728();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a057749
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_8af728() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_8af728();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_8af728();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8af728();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a057749
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_8af728() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_8af728();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_8af728();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8af728();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.glsl
new file mode 100644
index 0000000..07cf06e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_8af728() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_8af728();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_8af728() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_8af728();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_8af728() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_8af728();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.msl
new file mode 100644
index 0000000..da4be3e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8af728(texture2d_array<float, access::read> tint_symbol_1, device uint2* const tint_symbol_2) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read> tint_symbol_3, device uint2* const tint_symbol_4) {
+ textureDimensions_8af728(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_8af728(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_8af728(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.spvasm
new file mode 100644
index 0000000..9864468
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.spvasm
@@ -0,0 +1,94 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 46
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_8af728 "textureDimensions_8af728"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %27 = OpConstantNull %v2uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+ %32 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_8af728 = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %27
+ %24 = OpLoad %11 %arg_0
+ %22 = OpImageQuerySize %v3uint %24
+ %21 = OpVectorShuffle %v2uint %22 %22 0 1
+ OpStore %res %21
+ %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+ %31 = OpLoad %v2uint %res
+ OpStore %30 %31
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %32
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_8af728
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %37 = OpLabel
+ %38 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %38
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_8af728
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureDimensions_8af728
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.wgsl
new file mode 100644
index 0000000..a4213da
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8af728.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read>;
+
+fn textureDimensions_8af728() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_8af728();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_8af728();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_8af728();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8e15f4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/8e15f4.wgsl.expected.glsl
index 974eb81..bfebfb4 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/8e15f4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/8e15f4.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/91e3b4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/91e3b4.wgsl.expected.glsl
index 49f6194..071973d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/91e3b4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/91e3b4.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_91e3b4() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_91e3b4() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_91e3b4() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.glsl
index 316b9cf..21fdf97 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.glsl
index 025b3a0..3701429 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.glsl
index 6d3fab6..d2c96d0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_9cd8ad() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_9cd8ad() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_9cd8ad() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9dc27a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9dc27a.wgsl.expected.glsl
index aba26f7..aa32982 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9dc27a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9dc27a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.glsl
index ac48298..7b65160 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.glsl
index 600acff..f572dc0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl
new file mode 100644
index 0000000..f59767e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<r8unorm, write>) -> vec3<u32>
+fn textureDimensions_a20ba2() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a20ba2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a20ba2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a20ba2();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..205a438
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_a20ba2() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+ prevent_dce.Store3(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a20ba2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a20ba2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a20ba2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..205a438
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_a20ba2() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+ prevent_dce.Store3(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a20ba2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a20ba2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a20ba2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.glsl
new file mode 100644
index 0000000..414da05
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_a20ba2() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_a20ba2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_a20ba2() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_a20ba2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_a20ba2() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_a20ba2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.msl
new file mode 100644
index 0000000..87cfc47
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a20ba2(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+ *(tint_symbol_2) = packed_uint3(res);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+ textureDimensions_a20ba2(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_a20ba2(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_a20ba2(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.spvasm
new file mode 100644
index 0000000..cddc7bd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_a20ba2 "textureDimensions_a20ba2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %25 = OpConstantNull %v3uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_a20ba2 = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v3uint %22
+ OpStore %res %21
+ %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+ %29 = OpLoad %v3uint %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_a20ba2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_a20ba2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_a20ba2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.wgsl
new file mode 100644
index 0000000..e5b4bb5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a20ba2.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, write>;
+
+fn textureDimensions_a20ba2() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a20ba2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a20ba2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a20ba2();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ae4595.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/ae4595.wgsl.expected.glsl
index 7939a5b..4a9b48a 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ae4595.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ae4595.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_ae4595() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_ae4595() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_ae4595() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.glsl
index c9de38d..65a6963 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.glsl
index 3601802..02fd61d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.glsl
index 276a14d..2d351f2 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.glsl
index 0017553..9c25506 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl
new file mode 100644
index 0000000..d1ba650
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read_write>;
+
+// fn textureDimensions(texture: texture_storage_1d<r8unorm, read_write>) -> u32
+fn textureDimensions_c6b985() {
+ var res: u32 = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c6b985();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c6b985();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c6b985();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..753cf17
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_c6b985() {
+ uint tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c6b985();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c6b985();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c6b985();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..753cf17
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_c6b985() {
+ uint tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c6b985();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c6b985();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c6b985();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.glsl
new file mode 100644
index 0000000..8c574c9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_c6b985() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_c6b985();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_c6b985() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_c6b985();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_c6b985() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_c6b985();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.msl
new file mode 100644
index 0000000..b0a6fb9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c6b985(texture1d<float, access::read_write> tint_symbol_1, device uint* const tint_symbol_2) {
+ uint res = tint_symbol_1.get_width(0);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read_write> tint_symbol_3, device uint* const tint_symbol_4) {
+ textureDimensions_c6b985(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read_write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read_write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_c6b985(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read_write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_c6b985(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.spvasm
new file mode 100644
index 0000000..3de8c99
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.spvasm
@@ -0,0 +1,91 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_c6b985 "textureDimensions_c6b985"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_c6b985 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %uint %21
+ OpStore %res %20
+ %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+ %28 = OpLoad %uint %res
+ OpStore %27 %28
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_c6b985
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_c6b985
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_c6b985
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.wgsl
new file mode 100644
index 0000000..5c45f89
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c6b985.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read_write>;
+
+fn textureDimensions_c6b985() {
+ var res : u32 = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c6b985();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c6b985();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c6b985();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c7ea63.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c7ea63.wgsl.expected.glsl
index e52b162..a0e13a8 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c7ea63.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c7ea63.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c82420.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c82420.wgsl.expected.glsl
index 67ad2a7..7330a10 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/c82420.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/c82420.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cd3033.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cd3033.wgsl.expected.glsl
index c4cbb76..d80d06f 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cd3033.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cd3033.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cedabd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cedabd.wgsl.expected.glsl
index 5c381de..660ac58 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cedabd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cedabd.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.glsl
index f43a617e..ea96983 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d0778e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d0778e.wgsl.expected.glsl
index cdab91a..231c1ff 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/d0778e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/d0778e.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32ui) uniform highp readonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_d0778e() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_d0778e() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32ui) uniform highp readonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_d0778e() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.glsl
index bccffc1..4af55e0 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_e738f4() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_e738f4() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_e738f4() {
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e824b6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e824b6.wgsl.expected.glsl
index 58ba0a9..cf97acc 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/e824b6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/e824b6.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.glsl
index 2103274..51b9660 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.glsl
index aa05eec..309208d 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f94e55.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f94e55.wgsl.expected.glsl
index cf15ef3..fc0773e 100644
--- a/test/tint/builtins/gen/literal/textureDimensions/f94e55.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureDimensions/f94e55.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl
new file mode 100644
index 0000000..c94b03f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read>;
+
+// fn textureDimensions(texture: texture_storage_1d<r8unorm, read>) -> u32
+fn textureDimensions_fdbae8() {
+ var res: u32 = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_fdbae8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_fdbae8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_fdbae8();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2bdaafe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_fdbae8() {
+ uint tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_fdbae8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_fdbae8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_fdbae8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2bdaafe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_fdbae8() {
+ uint tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_fdbae8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_fdbae8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_fdbae8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.glsl
new file mode 100644
index 0000000..190fbcc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_fdbae8() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_fdbae8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_fdbae8() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_fdbae8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_fdbae8() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_fdbae8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.msl
new file mode 100644
index 0000000..5bbf3e2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_fdbae8(texture1d<float, access::read> tint_symbol_1, device uint* const tint_symbol_2) {
+ uint res = tint_symbol_1.get_width(0);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read> tint_symbol_3, device uint* const tint_symbol_4) {
+ textureDimensions_fdbae8(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_fdbae8(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_fdbae8(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.spvasm
new file mode 100644
index 0000000..ab89525
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_fdbae8 "textureDimensions_fdbae8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_fdbae8 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %uint %21
+ OpStore %res %20
+ %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+ %28 = OpLoad %uint %res
+ OpStore %27 %28
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_fdbae8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_fdbae8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_fdbae8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.wgsl
new file mode 100644
index 0000000..81d4d5b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdbae8.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read>;
+
+fn textureDimensions_fdbae8() {
+ var res : u32 = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_fdbae8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_fdbae8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_fdbae8();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.glsl
index 79cb746..fc40721 100644
--- a/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/04fa78.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_1_arg_2;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.glsl
index 9d7e921..c39c532 100644
--- a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.glsl
index b13ad29..c0f5629 100644
--- a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_1_arg_2;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.glsl
index 18c3625..f2fbbcd 100644
--- a/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/788010.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_1_arg_2;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.glsl
index 26a24ce..45e5d8e 100644
--- a/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/7dd226.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.glsl
index 6e07991..c336447 100644
--- a/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/829357.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_1_arg_2;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.glsl
index 53cc412..7f9c41d 100644
--- a/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/8578bc.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_1_arg_2;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.glsl
index b70bbf9..e0981de 100644
--- a/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/aaf6bd.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_1_arg_2;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.glsl
index f0505fa..f2a57f4 100644
--- a/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/be276f.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_1_arg_2;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.glsl
index 5297298..7dc8998 100644
--- a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_1_arg_2;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.glsl
index b312555..ece4e6b 100644
--- a/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/d4b5c6.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_1_arg_2;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.glsl
index 604115f..5d0eac6 100644
--- a/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/d98d59.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_1_arg_2;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.glsl
index 85d7e36..1887729 100644
--- a/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/e2acac.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_1_arg_2;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.glsl
index a227a88..acbbfe8 100644
--- a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_1_arg_2;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.glsl
index ee596d1..6bc6a75 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/2e409c.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.glsl
index 5682a21..e5c66ac 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/012e11.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/012e11.wgsl.expected.glsl
index 608f7c8..9a298be 100644
--- a/test/tint/builtins/gen/literal/textureLoad/012e11.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/012e11.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/02c48d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/02c48d.wgsl.expected.glsl
index e2e6c2c..2c08d96 100644
--- a/test/tint/builtins/gen/literal/textureLoad/02c48d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/02c48d.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/03e03e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/03e03e.wgsl.expected.glsl
index a228aa1..10df710 100644
--- a/test/tint/builtins/gen/literal/textureLoad/03e03e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/03e03e.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/050c33.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/050c33.wgsl.expected.glsl
index 3ec4a2d..792d1bb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/050c33.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/050c33.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/054350.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/054350.wgsl.expected.glsl
index a6ed195..39a4e82 100644
--- a/test/tint/builtins/gen/literal/textureLoad/054350.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/054350.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/0b515a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/0b515a.wgsl.expected.glsl
index 4699273..4f61a1d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/0b515a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/0b515a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/126466.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/126466.wgsl.expected.glsl
index dc8ba12..d1d3b33 100644
--- a/test/tint/builtins/gen/literal/textureLoad/126466.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/126466.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/143d84.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/143d84.wgsl.expected.glsl
index e430c62..fd7bea6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/143d84.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/143d84.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/14cc4c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/14cc4c.wgsl.expected.glsl
index 5c79242..ebece90 100644
--- a/test/tint/builtins/gen/literal/textureLoad/14cc4c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/14cc4c.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/170593.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/170593.wgsl.expected.glsl
index 9a98642..110c902 100644
--- a/test/tint/builtins/gen/literal/textureLoad/170593.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/170593.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/17095b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/17095b.wgsl.expected.glsl
index 3eb55eb..dc39ff1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/17095b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/17095b.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/18ac11.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/18ac11.wgsl.expected.glsl
index 8c00787..f07faa3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/18ac11.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/18ac11.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl
new file mode 100644
index 0000000..70f4df4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read>, coords: vec2<i32>, array_index: u32) -> vec4<f32>
+fn textureLoad_19e5ca() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_19e5ca();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_19e5ca();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_19e5ca();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3765aa3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_19e5ca() {
+ float4 res = arg_0.Load(int4(int3((1).xx, int(1u)), 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_19e5ca();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_19e5ca();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_19e5ca();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3765aa3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_19e5ca() {
+ float4 res = arg_0.Load(int4(int3((1).xx, int(1u)), 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_19e5ca();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_19e5ca();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_19e5ca();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.glsl
new file mode 100644
index 0000000..99630c2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_19e5ca() {
+ vec4 res = imageLoad(arg_0, ivec3(ivec2(1), int(1u)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_19e5ca();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_19e5ca() {
+ vec4 res = imageLoad(arg_0, ivec3(ivec2(1), int(1u)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_19e5ca();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_19e5ca() {
+ vec4 res = imageLoad(arg_0, ivec3(ivec2(1), int(1u)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_19e5ca();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.msl
new file mode 100644
index 0000000..f899c3f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_19e5ca(texture2d_array<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint2(int2(1)), 1u);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_19e5ca(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_19e5ca(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_19e5ca(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.spvasm
new file mode 100644
index 0000000..b2e7f7c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.spvasm
@@ -0,0 +1,99 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 52
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_19e5ca "textureLoad_19e5ca"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %25 = OpConstantComposite %v2int %int_1 %int_1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %38 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_19e5ca = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %26 = OpCompositeExtract %int %25 0
+ %27 = OpCompositeExtract %int %25 1
+ %28 = OpBitcast %int %uint_1
+ %31 = OpCompositeConstruct %v3int %26 %27 %28
+ %19 = OpImageRead %v4float %20 %31
+ OpStore %res %19
+ %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %37 = OpLoad %v4float %res
+ OpStore %36 %37
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %38
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_19e5ca
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %44
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureLoad_19e5ca
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureLoad_19e5ca
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.wgsl
new file mode 100644
index 0000000..689941d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/19e5ca.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read>;
+
+fn textureLoad_19e5ca() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_19e5ca();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_19e5ca();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_19e5ca();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1bc5ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1bc5ab.wgsl.expected.glsl
index 85e2720..b1704f0 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1bc5ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1bc5ab.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/1d43ae.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1d43ae.wgsl.expected.glsl
index 47dfe9a..b8e7eee 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1d43ae.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1d43ae.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/1e6baa.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1e6baa.wgsl.expected.glsl
index 427bc88..c58a09e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1e6baa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1e6baa.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/1eb93f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1eb93f.wgsl.expected.glsl
index 23be703..ec20064 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1eb93f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1eb93f.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl
new file mode 100644
index 0000000..c6a3721
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_3d<r8unorm, read_write>, coords: vec3<u32>) -> vec4<f32>
+fn textureLoad_1fde63() {
+ var res: vec4<f32> = textureLoad(arg_0, vec3<u32>(1u));
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_1fde63();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_1fde63();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_1fde63();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..dc052d0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_1fde63() {
+ float4 res = arg_0.Load((1u).xxx);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_1fde63();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_1fde63();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_1fde63();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..dc052d0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_1fde63() {
+ float4 res = arg_0.Load((1u).xxx);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_1fde63();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_1fde63();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_1fde63();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.glsl
new file mode 100644
index 0000000..1c44f2c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_1fde63() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(1u)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_1fde63();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_1fde63() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(1u)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_1fde63();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_1fde63() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(1u)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_1fde63();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.msl
new file mode 100644
index 0000000..2e66a71
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_1fde63(texture3d<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint3(uint3(1u)));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_1fde63(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_1fde63(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_1fde63(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.spvasm
new file mode 100644
index 0000000..27a3678
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.spvasm
@@ -0,0 +1,91 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_1fde63 "textureLoad_1fde63"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+ %24 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_1fde63 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %19 = OpImageRead %v4float %20 %24
+ OpStore %res %19
+ %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %30 = OpLoad %v4float %res
+ OpStore %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_1fde63
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_1fde63
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureLoad_1fde63
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.wgsl
new file mode 100644
index 0000000..e7548f8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/1fde63.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read_write>;
+
+fn textureLoad_1fde63() {
+ var res : vec4<f32> = textureLoad(arg_0, vec3<u32>(1u));
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_1fde63();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_1fde63();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_1fde63();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/20fa2f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/20fa2f.wgsl.expected.glsl
index e55a49c..b043015 100644
--- a/test/tint/builtins/gen/literal/textureLoad/20fa2f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/20fa2f.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/23007a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/23007a.wgsl.expected.glsl
index b364c06..8689723 100644
--- a/test/tint/builtins/gen/literal/textureLoad/23007a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/23007a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/25b67f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/25b67f.wgsl.expected.glsl
index 4080d34..59c1004 100644
--- a/test/tint/builtins/gen/literal/textureLoad/25b67f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/25b67f.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/26b8f6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/26b8f6.wgsl.expected.glsl
index c3eee3a..5cba0ac 100644
--- a/test/tint/builtins/gen/literal/textureLoad/26b8f6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/26b8f6.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/26d7f1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/26d7f1.wgsl.expected.glsl
index f6a3854..5d829f5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/26d7f1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/26d7f1.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/276643.wgsl b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl
new file mode 100644
index 0000000..d886b33
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_1d<r8unorm, read>, coords: u32) -> vec4<f32>
+fn textureLoad_276643() {
+ var res: vec4<f32> = textureLoad(arg_0, 1u);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_276643();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_276643();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_276643();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8363d8c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_276643() {
+ float4 res = arg_0.Load(uint2(1u, uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_276643();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_276643();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_276643();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8363d8c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_276643() {
+ float4 res = arg_0.Load(uint2(1u, uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_276643();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_276643();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_276643();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.glsl
new file mode 100644
index 0000000..3501cde
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_276643() {
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(1u, 0u)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_276643();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_276643() {
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(1u, 0u)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_276643();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_276643() {
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(1u, 0u)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_276643();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.msl
new file mode 100644
index 0000000..c0f6c4b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_276643(texture1d<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint(1u));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_276643(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_276643(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_276643(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.spvasm
new file mode 100644
index 0000000..7a987ee
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.spvasm
@@ -0,0 +1,91 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_276643 "textureLoad_276643"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_276643 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %19 = OpImageRead %v4float %20 %uint_1
+ OpStore %res %19
+ %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %28 = OpLoad %v4float %res
+ OpStore %27 %28
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_276643
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_276643
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_276643
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.wgsl
new file mode 100644
index 0000000..2ddc002
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/276643.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read>;
+
+fn textureLoad_276643() {
+ var res : vec4<f32> = textureLoad(arg_0, 1u);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_276643();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_276643();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_276643();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/2cee30.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/2cee30.wgsl.expected.glsl
index 1206a66..041dc2a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2cee30.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2cee30.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/2d6cf7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/2d6cf7.wgsl.expected.glsl
index 6136f13..39eb9fb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2d6cf7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2d6cf7.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/2dbfc2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/2dbfc2.wgsl.expected.glsl
index 32b3a4e..4d5a679 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2dbfc2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2dbfc2.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/2eaf31.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/2eaf31.wgsl.expected.glsl
index f367467..7c40354 100644
--- a/test/tint/builtins/gen/literal/textureLoad/2eaf31.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/2eaf31.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/32a7b8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/32a7b8.wgsl.expected.glsl
index b719d50..9b677d3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/32a7b8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/32a7b8.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/34d97c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/34d97c.wgsl.expected.glsl
index 58e46bf..189f179 100644
--- a/test/tint/builtins/gen/literal/textureLoad/34d97c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/34d97c.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl
new file mode 100644
index 0000000..d002256
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_1d<r8unorm, read_write>, coords: i32) -> vec4<f32>
+fn textureLoad_35a5e2() {
+ var res: vec4<f32> = textureLoad(arg_0, 1i);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_35a5e2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_35a5e2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_35a5e2();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0bd8bc0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_35a5e2() {
+ float4 res = arg_0.Load(1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_35a5e2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_35a5e2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_35a5e2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0bd8bc0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_35a5e2() {
+ float4 res = arg_0.Load(1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_35a5e2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_35a5e2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_35a5e2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.glsl
new file mode 100644
index 0000000..485118a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_35a5e2() {
+ vec4 res = imageLoad(arg_0, ivec2(1, 0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_35a5e2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_35a5e2() {
+ vec4 res = imageLoad(arg_0, ivec2(1, 0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_35a5e2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_35a5e2() {
+ vec4 res = imageLoad(arg_0, ivec2(1, 0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_35a5e2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.msl
new file mode 100644
index 0000000..e5ea02a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_35a5e2(texture1d<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint(1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_35a5e2(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_35a5e2(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_35a5e2(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.spvasm
new file mode 100644
index 0000000..f3a02c8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.spvasm
@@ -0,0 +1,91 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_35a5e2 "textureLoad_35a5e2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_35a5e2 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %19 = OpImageRead %v4float %20 %int_1
+ OpStore %res %19
+ %28 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %29 = OpLoad %v4float %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureLoad_35a5e2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_35a5e2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureLoad_35a5e2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.wgsl
new file mode 100644
index 0000000..1549ece
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35a5e2.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read_write>;
+
+fn textureLoad_35a5e2() {
+ var res : vec4<f32> = textureLoad(arg_0, 1i);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_35a5e2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_35a5e2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_35a5e2();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl
new file mode 100644
index 0000000..c48dba5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read>, coords: vec2<i32>, array_index: i32) -> vec4<f32>
+fn textureLoad_35d464() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_35d464();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_35d464();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_35d464();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b5f3a95
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_35d464() {
+ float4 res = arg_0.Load(int4(int3((1).xx, 1), 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_35d464();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_35d464();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_35d464();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b5f3a95
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_35d464() {
+ float4 res = arg_0.Load(int4(int3((1).xx, 1), 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_35d464();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_35d464();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_35d464();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.glsl
new file mode 100644
index 0000000..7d6b400
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_35d464() {
+ vec4 res = imageLoad(arg_0, ivec3(ivec2(1), 1));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_35d464();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_35d464() {
+ vec4 res = imageLoad(arg_0, ivec3(ivec2(1), 1));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_35d464();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_35d464() {
+ vec4 res = imageLoad(arg_0, ivec3(ivec2(1), 1));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_35d464();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.msl
new file mode 100644
index 0000000..58a2cf5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_35d464(texture2d_array<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint2(int2(1)), 1);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_35d464(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_35d464(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_35d464(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.spvasm
new file mode 100644
index 0000000..7181d3d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.spvasm
@@ -0,0 +1,97 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 50
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_35d464 "textureLoad_35d464"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %25 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %36 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_35d464 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %26 = OpCompositeExtract %int %25 0
+ %27 = OpCompositeExtract %int %25 1
+ %28 = OpCompositeConstruct %v3int %26 %27 %int_1
+ %19 = OpImageRead %v4float %20 %28
+ OpStore %res %19
+ %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %35 = OpLoad %v4float %res
+ OpStore %34 %35
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_35d464
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureLoad_35d464
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureLoad_35d464
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.wgsl
new file mode 100644
index 0000000..541e117
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/35d464.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read>;
+
+fn textureLoad_35d464() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_35d464();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_35d464();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_35d464();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/39016c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/39016c.wgsl.expected.glsl
index dc6b432..f08c01e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/39016c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/39016c.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/395447.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/395447.wgsl.expected.glsl
index 9a97024..be836d6 100644
--- a/test/tint/builtins/gen/literal/textureLoad/395447.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/395447.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/3a2350.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/3a2350.wgsl.expected.glsl
index c79fee6..638058e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3a2350.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3a2350.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/3cfb9c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/3cfb9c.wgsl.expected.glsl
index 116f2ea..3e72ad7 100644
--- a/test/tint/builtins/gen/literal/textureLoad/3cfb9c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/3cfb9c.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl
new file mode 100644
index 0000000..99be9bc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_2d<r8unorm, read_write>, coords: vec2<i32>) -> vec4<f32>
+fn textureLoad_3e16a8() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i));
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_3e16a8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_3e16a8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_3e16a8();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8650ab8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_3e16a8() {
+ float4 res = arg_0.Load(int2((1).xx));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_3e16a8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_3e16a8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3e16a8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8650ab8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_3e16a8() {
+ float4 res = arg_0.Load(int2((1).xx));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_3e16a8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_3e16a8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3e16a8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.glsl
new file mode 100644
index 0000000..a43862e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_3e16a8() {
+ vec4 res = imageLoad(arg_0, ivec2(1));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_3e16a8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_3e16a8() {
+ vec4 res = imageLoad(arg_0, ivec2(1));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_3e16a8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_3e16a8() {
+ vec4 res = imageLoad(arg_0, ivec2(1));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_3e16a8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.msl
new file mode 100644
index 0000000..c2589b5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_3e16a8(texture2d<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint2(int2(1)));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_3e16a8(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_3e16a8(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_3e16a8(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.spvasm
new file mode 100644
index 0000000..0c7057b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 46
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_3e16a8 "textureLoad_3e16a8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %24 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %32 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_3e16a8 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %19 = OpImageRead %v4float %20 %24
+ OpStore %res %19
+ %30 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %31 = OpLoad %v4float %res
+ OpStore %30 %31
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %32
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_3e16a8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %37 = OpLabel
+ %38 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %38
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_3e16a8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureLoad_3e16a8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.wgsl
new file mode 100644
index 0000000..a8db3a6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/3e16a8.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read_write>;
+
+fn textureLoad_3e16a8() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i));
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_3e16a8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_3e16a8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_3e16a8();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/40ee8b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/40ee8b.wgsl.expected.glsl
index c7cd16e..5838a90 100644
--- a/test/tint/builtins/gen/literal/textureLoad/40ee8b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/40ee8b.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/4212a1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4212a1.wgsl.expected.glsl
index 26affd6..0e5dee3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4212a1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4212a1.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/424afd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/424afd.wgsl.expected.glsl
index 2e23084..b594c2a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/424afd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/424afd.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/42a631.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/42a631.wgsl.expected.glsl
index 1bba4a3..5563f37 100644
--- a/test/tint/builtins/gen/literal/textureLoad/42a631.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/42a631.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/43cd86.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/43cd86.wgsl.expected.glsl
index 8a4dbf2..8a9b350 100644
--- a/test/tint/builtins/gen/literal/textureLoad/43cd86.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/43cd86.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/44c826.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/44c826.wgsl.expected.glsl
index a079cc8..f0395c4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/44c826.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/44c826.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/4542ae.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4542ae.wgsl.expected.glsl
index e4e2e23..dd07882 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4542ae.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4542ae.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/469912.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/469912.wgsl.expected.glsl
index e8745af..c1cb7b5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/469912.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/469912.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/473d3e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/473d3e.wgsl.expected.glsl
index 4336b32..402b66d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/473d3e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/473d3e.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/482627.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/482627.wgsl.expected.glsl
index 3502b58..4656109 100644
--- a/test/tint/builtins/gen/literal/textureLoad/482627.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/482627.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl
new file mode 100644
index 0000000..955033e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read>, coords: vec2<u32>, array_index: i32) -> vec4<f32>
+fn textureLoad_4951bb() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_4951bb();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_4951bb();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_4951bb();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a1286c0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_4951bb() {
+ float4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_4951bb();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_4951bb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_4951bb();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a1286c0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_4951bb() {
+ float4 res = arg_0.Load(uint4(uint3((1u).xx, uint(1)), uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_4951bb();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_4951bb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_4951bb();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.glsl
new file mode 100644
index 0000000..b48f1f9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_4951bb() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(uvec2(1u), uint(1))));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_4951bb();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_4951bb() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(uvec2(1u), uint(1))));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_4951bb();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_4951bb() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(uvec2(1u), uint(1))));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_4951bb();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.msl
new file mode 100644
index 0000000..829b027
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_4951bb(texture2d_array<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint2(uint2(1u)), 1);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_4951bb(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_4951bb(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_4951bb(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.spvasm
new file mode 100644
index 0000000..0b3bfda
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.spvasm
@@ -0,0 +1,99 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 52
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_4951bb "textureLoad_4951bb"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %25 = OpConstantComposite %v2uint %uint_1 %uint_1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %38 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_4951bb = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %26 = OpCompositeExtract %uint %25 0
+ %27 = OpCompositeExtract %uint %25 1
+ %28 = OpBitcast %uint %int_1
+ %31 = OpCompositeConstruct %v3uint %26 %27 %28
+ %19 = OpImageRead %v4float %20 %31
+ OpStore %res %19
+ %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %37 = OpLoad %v4float %res
+ OpStore %36 %37
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %38
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_4951bb
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %44
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureLoad_4951bb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureLoad_4951bb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.wgsl
new file mode 100644
index 0000000..584bce6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/4951bb.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read>;
+
+fn textureLoad_4951bb() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_4951bb();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_4951bb();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_4951bb();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/4a5c55.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4a5c55.wgsl.expected.glsl
index 3c4124f..bf79e9a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4a5c55.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4a5c55.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c15b2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4c15b2.wgsl.expected.glsl
index 0467809..421c810 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4c15b2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4c15b2.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/4c1a1e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4c1a1e.wgsl.expected.glsl
index 4ddeb09..1997f35 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4c1a1e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4c1a1e.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/4ccf9a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4ccf9a.wgsl.expected.glsl
index 86cb5f8..5d60119 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4ccf9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4ccf9a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/4e2c5c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4e2c5c.wgsl.expected.glsl
index bd80e9a3..5735932 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4e2c5c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4e2c5c.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/4f90bb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/4f90bb.wgsl.expected.glsl
index 0230b04..a238297 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4f90bb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4f90bb.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/5154e1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/5154e1.wgsl.expected.glsl
index 1c9715b..d25b0e1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5154e1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5154e1.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/53378a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/53378a.wgsl.expected.glsl
index e2a74d1..2e81590 100644
--- a/test/tint/builtins/gen/literal/textureLoad/53378a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/53378a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/53941c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/53941c.wgsl.expected.glsl
index ce5440b..6ca98bb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/53941c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/53941c.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/54fb38.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/54fb38.wgsl.expected.glsl
index de78148..64e69aa 100644
--- a/test/tint/builtins/gen/literal/textureLoad/54fb38.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/54fb38.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/56a000.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/56a000.wgsl.expected.glsl
index 0ba3918..836d21e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/56a000.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/56a000.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/5abbf2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/5abbf2.wgsl.expected.glsl
index 1ee0368..9ec57ca 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5abbf2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5abbf2.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/5b0f5b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/5b0f5b.wgsl.expected.glsl
index 9e1c899..63f0150 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5b0f5b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5b0f5b.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/5b4947.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/5b4947.wgsl.expected.glsl
index d63442e..0fd5cc4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5b4947.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5b4947.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/5bb7fb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/5bb7fb.wgsl.expected.glsl
index ae27239..0afc610 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5bb7fb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5bb7fb.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/5c69f8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/5c69f8.wgsl.expected.glsl
index e303c46..be6aa6f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5c69f8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5c69f8.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl
new file mode 100644
index 0000000..56a3a27
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_2d<r8unorm, read>, coords: vec2<i32>) -> vec4<f32>
+fn textureLoad_5dd4c7() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i));
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_5dd4c7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_5dd4c7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_5dd4c7();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3942020
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_5dd4c7() {
+ float4 res = arg_0.Load(int3((1).xx, 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_5dd4c7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_5dd4c7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_5dd4c7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3942020
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_5dd4c7() {
+ float4 res = arg_0.Load(int3((1).xx, 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_5dd4c7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_5dd4c7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_5dd4c7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.glsl
new file mode 100644
index 0000000..4874408
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_5dd4c7() {
+ vec4 res = imageLoad(arg_0, ivec2(1));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_5dd4c7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_5dd4c7() {
+ vec4 res = imageLoad(arg_0, ivec2(1));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_5dd4c7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_5dd4c7() {
+ vec4 res = imageLoad(arg_0, ivec2(1));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_5dd4c7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.msl
new file mode 100644
index 0000000..665aefc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_5dd4c7(texture2d<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint2(int2(1)));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_5dd4c7(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_5dd4c7(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_5dd4c7(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.spvasm
new file mode 100644
index 0000000..f6d6746
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.spvasm
@@ -0,0 +1,93 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 46
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_5dd4c7 "textureLoad_5dd4c7"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %24 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %32 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_5dd4c7 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %19 = OpImageRead %v4float %20 %24
+ OpStore %res %19
+ %30 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %31 = OpLoad %v4float %res
+ OpStore %30 %31
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %32
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_5dd4c7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %37 = OpLabel
+ %38 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %38
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_5dd4c7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureLoad_5dd4c7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.wgsl
new file mode 100644
index 0000000..6035236
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5dd4c7.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read>;
+
+fn textureLoad_5dd4c7() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i));
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_5dd4c7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_5dd4c7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_5dd4c7();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/5e17a7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/5e17a7.wgsl.expected.glsl
index 0df24c4..959409d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5e17a7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5e17a7.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/5e1843.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/5e1843.wgsl.expected.glsl
index b9df634..c6af419 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5e1843.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5e1843.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl
new file mode 100644
index 0000000..34ed6fe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read>, coords: vec2<u32>, array_index: u32) -> vec4<f32>
+fn textureLoad_5ed6ad() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_5ed6ad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_5ed6ad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_5ed6ad();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..dc87014
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_5ed6ad() {
+ float4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_5ed6ad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_5ed6ad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_5ed6ad();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..dc87014
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_5ed6ad() {
+ float4 res = arg_0.Load(uint4(uint3((1u).xx, 1u), uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_5ed6ad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_5ed6ad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_5ed6ad();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.glsl
new file mode 100644
index 0000000..c5d0fc7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_5ed6ad() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(uvec2(1u), 1u)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_5ed6ad();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_5ed6ad() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(uvec2(1u), 1u)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_5ed6ad();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_5ed6ad() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(uvec2(1u), 1u)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_5ed6ad();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.msl
new file mode 100644
index 0000000..ef5c693
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_5ed6ad(texture2d_array<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_5ed6ad(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_5ed6ad(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_5ed6ad(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.spvasm
new file mode 100644
index 0000000..711a7b1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.spvasm
@@ -0,0 +1,96 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 49
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_5ed6ad "textureLoad_5ed6ad"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %25 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %35 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_5ed6ad = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %26 = OpCompositeExtract %uint %25 0
+ %27 = OpCompositeExtract %uint %25 1
+ %28 = OpCompositeConstruct %v3uint %26 %27 %uint_1
+ %19 = OpImageRead %v4float %20 %28
+ OpStore %res %19
+ %33 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %34 = OpLoad %v4float %res
+ OpStore %33 %34
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %35
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_5ed6ad
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %40 = OpLabel
+ %41 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %41
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureLoad_5ed6ad
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureLoad_5ed6ad
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.wgsl
new file mode 100644
index 0000000..8f9b4d7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/5ed6ad.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read>;
+
+fn textureLoad_5ed6ad() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_5ed6ad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_5ed6ad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_5ed6ad();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/61e2e8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/61e2e8.wgsl.expected.glsl
index dac1677..b3b76ae 100644
--- a/test/tint/builtins/gen/literal/textureLoad/61e2e8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/61e2e8.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/620caa.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/620caa.wgsl.expected.glsl
index 0dac344..8fd06dc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/620caa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/620caa.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/622278.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/622278.wgsl.expected.glsl
index 90e3fbe..bf5d34e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/622278.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/622278.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/63be18.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/63be18.wgsl.expected.glsl
index 7bc5d8e..c4484ea 100644
--- a/test/tint/builtins/gen/literal/textureLoad/63be18.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/63be18.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/64c372.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/64c372.wgsl.expected.glsl
index 4fa7544..2fec678 100644
--- a/test/tint/builtins/gen/literal/textureLoad/64c372.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/64c372.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/666010.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/666010.wgsl.expected.glsl
index ae35637..312b861 100644
--- a/test/tint/builtins/gen/literal/textureLoad/666010.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/666010.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/68d273.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/68d273.wgsl.expected.glsl
index 27dc9dc..6e8d341 100644
--- a/test/tint/builtins/gen/literal/textureLoad/68d273.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/68d273.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/6a6871.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6a6871.wgsl.expected.glsl
index 339ef43..e29ef39 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6a6871.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6a6871.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/6b8ba6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6b8ba6.wgsl.expected.glsl
index cda1da3..294823a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6b8ba6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6b8ba6.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/6ba9ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6ba9ab.wgsl.expected.glsl
index 86a4e6e..a41a63e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6ba9ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6ba9ab.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/6bf3e2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6bf3e2.wgsl.expected.glsl
index 533e6d4..b24e2cb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6bf3e2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6bf3e2.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/6d7bb5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6d7bb5.wgsl.expected.glsl
index 1d25f14..97931c0 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6d7bb5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6d7bb5.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/6e903f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6e903f.wgsl.expected.glsl
index 285b602..e7676d0 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6e903f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6e903f.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl
new file mode 100644
index 0000000..e1e2210
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_3d<r8unorm, read>, coords: vec3<u32>) -> vec4<f32>
+fn textureLoad_6f0370() {
+ var res: vec4<f32> = textureLoad(arg_0, vec3<u32>(1u));
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_6f0370();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_6f0370();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_6f0370();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d89877f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_6f0370() {
+ float4 res = arg_0.Load(uint4((1u).xxx, uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_6f0370();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_6f0370();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_6f0370();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d89877f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_6f0370() {
+ float4 res = arg_0.Load(uint4((1u).xxx, uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_6f0370();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_6f0370();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_6f0370();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.glsl
new file mode 100644
index 0000000..a003fcd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_6f0370() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(1u)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_6f0370();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_6f0370() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(1u)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_6f0370();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_6f0370() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(1u)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_6f0370();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.msl
new file mode 100644
index 0000000..780a926
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_6f0370(texture3d<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint3(uint3(1u)));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_6f0370(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_6f0370(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_6f0370(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.spvasm
new file mode 100644
index 0000000..7b43a86
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_6f0370 "textureLoad_6f0370"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+ %24 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_6f0370 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %19 = OpImageRead %v4float %20 %24
+ OpStore %res %19
+ %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %30 = OpLoad %v4float %res
+ OpStore %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_6f0370
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_6f0370
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureLoad_6f0370
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.wgsl
new file mode 100644
index 0000000..da983bb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/6f0370.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read>;
+
+fn textureLoad_6f0370() {
+ var res : vec4<f32> = textureLoad(arg_0, vec3<u32>(1u));
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_6f0370();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_6f0370();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_6f0370();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/6f0ea8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6f0ea8.wgsl.expected.glsl
index 7d45e09..e15763a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6f0ea8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6f0ea8.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/6f8927.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/6f8927.wgsl.expected.glsl
index d281ec5..2dd9c01 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6f8927.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6f8927.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl
new file mode 100644
index 0000000..3618d54
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<i32>, array_index: u32) -> vec4<f32>
+fn textureLoad_72c9c3() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_72c9c3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_72c9c3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_72c9c3();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..110f9da
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_72c9c3() {
+ float4 res = arg_0.Load(int3((1).xx, int(1u)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_72c9c3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_72c9c3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_72c9c3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..110f9da
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_72c9c3() {
+ float4 res = arg_0.Load(int3((1).xx, int(1u)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_72c9c3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_72c9c3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_72c9c3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.glsl
new file mode 100644
index 0000000..4aedc4d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_72c9c3() {
+ vec4 res = imageLoad(arg_0, ivec3(ivec2(1), int(1u)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_72c9c3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_72c9c3() {
+ vec4 res = imageLoad(arg_0, ivec3(ivec2(1), int(1u)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_72c9c3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_72c9c3() {
+ vec4 res = imageLoad(arg_0, ivec3(ivec2(1), int(1u)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_72c9c3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.msl
new file mode 100644
index 0000000..81505a7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_72c9c3(texture2d_array<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint2(int2(1)), 1u);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_72c9c3(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_72c9c3(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_72c9c3(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.spvasm
new file mode 100644
index 0000000..da15a5c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.spvasm
@@ -0,0 +1,98 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 52
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_72c9c3 "textureLoad_72c9c3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %25 = OpConstantComposite %v2int %int_1 %int_1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %38 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_72c9c3 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %26 = OpCompositeExtract %int %25 0
+ %27 = OpCompositeExtract %int %25 1
+ %28 = OpBitcast %int %uint_1
+ %31 = OpCompositeConstruct %v3int %26 %27 %28
+ %19 = OpImageRead %v4float %20 %31
+ OpStore %res %19
+ %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %37 = OpLoad %v4float %res
+ OpStore %36 %37
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %38
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_72c9c3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %44
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureLoad_72c9c3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureLoad_72c9c3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.wgsl
new file mode 100644
index 0000000..a32708f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/72c9c3.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureLoad_72c9c3() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1u);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_72c9c3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_72c9c3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_72c9c3();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/742f1b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/742f1b.wgsl.expected.glsl
index 73f6c0f..b84a4fd 100644
--- a/test/tint/builtins/gen/literal/textureLoad/742f1b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/742f1b.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/74a387.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/74a387.wgsl.expected.glsl
index 86db467..413a207 100644
--- a/test/tint/builtins/gen/literal/textureLoad/74a387.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/74a387.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/773c46.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/773c46.wgsl.expected.glsl
index 60a4092..d8c2d5f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/773c46.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/773c46.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/7dab57.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/7dab57.wgsl.expected.glsl
index 4e3355a..c1bca23 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7dab57.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7dab57.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl
new file mode 100644
index 0000000..6722dc5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<i32>, array_index: i32) -> vec4<f32>
+fn textureLoad_7dd3d5() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_7dd3d5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_7dd3d5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_7dd3d5();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4afc203
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_7dd3d5() {
+ float4 res = arg_0.Load(int3((1).xx, 1));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_7dd3d5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_7dd3d5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_7dd3d5();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4afc203
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_7dd3d5() {
+ float4 res = arg_0.Load(int3((1).xx, 1));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_7dd3d5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_7dd3d5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_7dd3d5();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.glsl
new file mode 100644
index 0000000..095e37e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_7dd3d5() {
+ vec4 res = imageLoad(arg_0, ivec3(ivec2(1), 1));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_7dd3d5();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_7dd3d5() {
+ vec4 res = imageLoad(arg_0, ivec3(ivec2(1), 1));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_7dd3d5();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_7dd3d5() {
+ vec4 res = imageLoad(arg_0, ivec3(ivec2(1), 1));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_7dd3d5();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.msl
new file mode 100644
index 0000000..ec3e4f4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_7dd3d5(texture2d_array<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint2(int2(1)), 1);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_7dd3d5(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_7dd3d5(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_7dd3d5(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.spvasm
new file mode 100644
index 0000000..557d8a2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.spvasm
@@ -0,0 +1,96 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 50
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_7dd3d5 "textureLoad_7dd3d5"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %25 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %36 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_7dd3d5 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %26 = OpCompositeExtract %int %25 0
+ %27 = OpCompositeExtract %int %25 1
+ %28 = OpCompositeConstruct %v3int %26 %27 %int_1
+ %19 = OpImageRead %v4float %20 %28
+ OpStore %res %19
+ %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %35 = OpLoad %v4float %res
+ OpStore %34 %35
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_7dd3d5
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureLoad_7dd3d5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureLoad_7dd3d5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.wgsl
new file mode 100644
index 0000000..5b3b6d7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/7dd3d5.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureLoad_7dd3d5() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<i32>(1i), 1i);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_7dd3d5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_7dd3d5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_7dd3d5();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/7e5cbc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/7e5cbc.wgsl.expected.glsl
index f32526c..473904f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7e5cbc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7e5cbc.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/80dae1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/80dae1.wgsl.expected.glsl
index 10e9fd4d..7b72779 100644
--- a/test/tint/builtins/gen/literal/textureLoad/80dae1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/80dae1.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/83162f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/83162f.wgsl.expected.glsl
index c8c72e7..fc2e89e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/83162f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/83162f.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/848d85.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/848d85.wgsl.expected.glsl
index 6a6424d..714a2ab 100644
--- a/test/tint/builtins/gen/literal/textureLoad/848d85.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/848d85.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/84a438.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/84a438.wgsl.expected.glsl
index e4a2c4e..4ccbbb9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/84a438.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/84a438.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/878e24.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/878e24.wgsl.expected.glsl
index 5cff3aa..b4f458a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/878e24.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/878e24.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/87f0a6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/87f0a6.wgsl.expected.glsl
index e439f2b..db5b8f1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/87f0a6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/87f0a6.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/881349.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/881349.wgsl.expected.glsl
index f3bfef9..758f743 100644
--- a/test/tint/builtins/gen/literal/textureLoad/881349.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/881349.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/8a9988.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/8a9988.wgsl.expected.glsl
index df20a89..d0d1095 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8a9988.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8a9988.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/8b62fb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/8b62fb.wgsl.expected.glsl
index d8d144b..c82db8a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8b62fb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8b62fb.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/8c6176.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/8c6176.wgsl.expected.glsl
index 675d9e8..b3d44c1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8c6176.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8c6176.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/8d64c3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/8d64c3.wgsl.expected.glsl
index 65b2dba..8e18b3c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8d64c3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8d64c3.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/8e5032.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/8e5032.wgsl.expected.glsl
index c646958..f2d3e77 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8e5032.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8e5032.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/8e68c9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/8e68c9.wgsl.expected.glsl
index 41feb03..547aa3c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8e68c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8e68c9.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/8fc29b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/8fc29b.wgsl.expected.glsl
index d074ba0..7c7bf76 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8fc29b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8fc29b.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/91ede5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/91ede5.wgsl.expected.glsl
index 38e50b5..8927c46 100644
--- a/test/tint/builtins/gen/literal/textureLoad/91ede5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/91ede5.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/9242e7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9242e7.wgsl.expected.glsl
index ea1a298..a5e5c76 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9242e7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9242e7.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl
new file mode 100644
index 0000000..bc2fa67
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_1d<r8unorm, read_write>, coords: u32) -> vec4<f32>
+fn textureLoad_92dd61() {
+ var res: vec4<f32> = textureLoad(arg_0, 1u);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_92dd61();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_92dd61();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_92dd61();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..667022f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_92dd61() {
+ float4 res = arg_0.Load(1u);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_92dd61();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_92dd61();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_92dd61();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..667022f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_92dd61() {
+ float4 res = arg_0.Load(1u);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_92dd61();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_92dd61();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_92dd61();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.glsl
new file mode 100644
index 0000000..02f8412
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_92dd61() {
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(1u, 0u)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_92dd61();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_92dd61() {
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(1u, 0u)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_92dd61();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_92dd61() {
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(1u, 0u)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_92dd61();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.msl
new file mode 100644
index 0000000..869407c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_92dd61(texture1d<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint(1u));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_92dd61(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_92dd61(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_92dd61(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.spvasm
new file mode 100644
index 0000000..3a22366
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.spvasm
@@ -0,0 +1,90 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_92dd61 "textureLoad_92dd61"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_92dd61 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %19 = OpImageRead %v4float %20 %uint_1
+ OpStore %res %19
+ %27 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %28 = OpLoad %v4float %res
+ OpStore %27 %28
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureLoad_92dd61
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_92dd61
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_92dd61
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.wgsl
new file mode 100644
index 0000000..c61b94e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/92dd61.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read_write>;
+
+fn textureLoad_92dd61() {
+ var res : vec4<f32> = textureLoad(arg_0, 1u);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_92dd61();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_92dd61();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_92dd61();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/947107.wgsl b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl
new file mode 100644
index 0000000..9ae5fae
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_1d<r8unorm, read>, coords: i32) -> vec4<f32>
+fn textureLoad_947107() {
+ var res: vec4<f32> = textureLoad(arg_0, 1i);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_947107();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_947107();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_947107();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..80749f4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_947107() {
+ float4 res = arg_0.Load(int2(1, 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_947107();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_947107();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_947107();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..80749f4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_947107() {
+ float4 res = arg_0.Load(int2(1, 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_947107();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_947107();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_947107();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.glsl
new file mode 100644
index 0000000..60d4fc5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_947107() {
+ vec4 res = imageLoad(arg_0, ivec2(1, 0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_947107();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_947107() {
+ vec4 res = imageLoad(arg_0, ivec2(1, 0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_947107();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_947107() {
+ vec4 res = imageLoad(arg_0, ivec2(1, 0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_947107();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.msl
new file mode 100644
index 0000000..c00ba20
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_947107(texture1d<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint(1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_947107(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_947107(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_947107(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.spvasm
new file mode 100644
index 0000000..17d72e0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_947107 "textureLoad_947107"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_947107 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %19 = OpImageRead %v4float %20 %int_1
+ OpStore %res %19
+ %28 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %29 = OpLoad %v4float %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureLoad_947107
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_947107
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureLoad_947107
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.wgsl
new file mode 100644
index 0000000..c5ada74
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/947107.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read>;
+
+fn textureLoad_947107() {
+ var res : vec4<f32> = textureLoad(arg_0, 1i);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_947107();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_947107();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_947107();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl
new file mode 100644
index 0000000..aa50814
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_3d<r8unorm, read_write>, coords: vec3<i32>) -> vec4<f32>
+fn textureLoad_99d8fa() {
+ var res: vec4<f32> = textureLoad(arg_0, vec3<i32>(1i));
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_99d8fa();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_99d8fa();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_99d8fa();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..86a2c04
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_99d8fa() {
+ float4 res = arg_0.Load(int3((1).xxx));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_99d8fa();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_99d8fa();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_99d8fa();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..86a2c04
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_99d8fa() {
+ float4 res = arg_0.Load(int3((1).xxx));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_99d8fa();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_99d8fa();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_99d8fa();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.glsl
new file mode 100644
index 0000000..b1c73f3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_99d8fa() {
+ vec4 res = imageLoad(arg_0, ivec3(1));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_99d8fa();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_99d8fa() {
+ vec4 res = imageLoad(arg_0, ivec3(1));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_99d8fa();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_99d8fa() {
+ vec4 res = imageLoad(arg_0, ivec3(1));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_99d8fa();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.msl
new file mode 100644
index 0000000..ee0a36b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_99d8fa(texture3d<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint3(int3(1)));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_99d8fa(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_99d8fa(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_99d8fa(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.spvasm
new file mode 100644
index 0000000..c0df3a6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 46
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_99d8fa "textureLoad_99d8fa"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %24 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %32 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_99d8fa = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %19 = OpImageRead %v4float %20 %24
+ OpStore %res %19
+ %30 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %31 = OpLoad %v4float %res
+ OpStore %30 %31
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %32
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_99d8fa
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %37 = OpLabel
+ %38 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %38
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_99d8fa
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureLoad_99d8fa
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.wgsl
new file mode 100644
index 0000000..a7962ce
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/99d8fa.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read_write>;
+
+fn textureLoad_99d8fa() {
+ var res : vec4<f32> = textureLoad(arg_0, vec3<i32>(1i));
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_99d8fa();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_99d8fa();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_99d8fa();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/9c2a14.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9c2a14.wgsl.expected.glsl
index b01aeca..9256906 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9c2a14.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9c2a14.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/9cf7df.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9cf7df.wgsl.expected.glsl
index 5514737..b2333b1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9cf7df.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9cf7df.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fa9fd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9fa9fd.wgsl.expected.glsl
index e6ef452..7227365 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9fa9fd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9fa9fd.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/9fd7be.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/9fd7be.wgsl.expected.glsl
index 1866e95..d2b69f0 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9fd7be.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9fd7be.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/a2b3f4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a2b3f4.wgsl.expected.glsl
index 4265426..8e50f92 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a2b3f4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a2b3f4.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/a3733f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a3733f.wgsl.expected.glsl
index 69e1001..bf1ae68 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a3733f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a3733f.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/a3f122.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a3f122.wgsl.expected.glsl
index 1898eb8..85fdbb0 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a3f122.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a3f122.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/a548a8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a548a8.wgsl.expected.glsl
index 378ccbb..596feaf 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a548a8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a548a8.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/a54e11.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a54e11.wgsl.expected.glsl
index 2bcb58c..e70509e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a54e11.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a54e11.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/a5c4e2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a5c4e2.wgsl.expected.glsl
index 54775a4..6f58bb0 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a5c4e2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a5c4e2.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/a64b1d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a64b1d.wgsl.expected.glsl
index 5b726b8..8c6bc1f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a64b1d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a64b1d.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/a7bcb4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a7bcb4.wgsl.expected.glsl
index caa6e41..92ff48d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a7bcb4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a7bcb4.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/a7c171.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a7c171.wgsl.expected.glsl
index 48c3dd2..6c3aa8a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a7c171.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a7c171.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/a92b18.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/a92b18.wgsl.expected.glsl
index 2178982..103c255 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a92b18.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a92b18.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/aa2579.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/aa2579.wgsl.expected.glsl
index 420f004..6b214ce 100644
--- a/test/tint/builtins/gen/literal/textureLoad/aa2579.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/aa2579.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/aa6130.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/aa6130.wgsl.expected.glsl
index 68c7c66..0e0dd6a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/aa6130.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/aa6130.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/aae9c3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/aae9c3.wgsl.expected.glsl
index 236313c..0ded627 100644
--- a/test/tint/builtins/gen/literal/textureLoad/aae9c3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/aae9c3.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/acf22f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/acf22f.wgsl.expected.glsl
index 678529f..016af46 100644
--- a/test/tint/builtins/gen/literal/textureLoad/acf22f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/acf22f.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/af0507.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/af0507.wgsl.expected.glsl
index 82fa095..fc68552 100644
--- a/test/tint/builtins/gen/literal/textureLoad/af0507.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/af0507.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/b1ca35.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/b1ca35.wgsl.expected.glsl
index 9c4ee21..ab39c6c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b1ca35.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b1ca35.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/b4d6c4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/b4d6c4.wgsl.expected.glsl
index d370dfc..6a5997b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b4d6c4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b4d6c4.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/b60a86.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/b60a86.wgsl.expected.glsl
index 5466cff..a361cb9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b60a86.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b60a86.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/b60db7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/b60db7.wgsl.expected.glsl
index 696ae5b..2fc0023 100644
--- a/test/tint/builtins/gen/literal/textureLoad/b60db7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/b60db7.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/ba74b2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/ba74b2.wgsl.expected.glsl
index 2ed9db7..6bd8f22 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ba74b2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ba74b2.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/babdf3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/babdf3.wgsl.expected.glsl
index 31959bd..40a85db 100644
--- a/test/tint/builtins/gen/literal/textureLoad/babdf3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/babdf3.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/bba04a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/bba04a.wgsl.expected.glsl
index a0ee904..593d188 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bba04a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bba04a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/bbb762.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/bbb762.wgsl.expected.glsl
index d5205f6..b329e92 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bbb762.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bbb762.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl
new file mode 100644
index 0000000..090b3c8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<u32>, array_index: i32) -> vec4<f32>
+fn textureLoad_bc882d() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_bc882d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_bc882d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_bc882d();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..cf20884
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_bc882d() {
+ float4 res = arg_0.Load(uint3((1u).xx, uint(1)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_bc882d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_bc882d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_bc882d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..cf20884
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_bc882d() {
+ float4 res = arg_0.Load(uint3((1u).xx, uint(1)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_bc882d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_bc882d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_bc882d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.glsl
new file mode 100644
index 0000000..a892e35
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_bc882d() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(uvec2(1u), uint(1))));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_bc882d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_bc882d() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(uvec2(1u), uint(1))));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_bc882d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_bc882d() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(uvec2(1u), uint(1))));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_bc882d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.msl
new file mode 100644
index 0000000..8b7b5c5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_bc882d(texture2d_array<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint2(uint2(1u)), 1);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_bc882d(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_bc882d(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_bc882d(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.spvasm
new file mode 100644
index 0000000..df9f58b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.spvasm
@@ -0,0 +1,98 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 52
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_bc882d "textureLoad_bc882d"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %25 = OpConstantComposite %v2uint %uint_1 %uint_1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %38 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_bc882d = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %26 = OpCompositeExtract %uint %25 0
+ %27 = OpCompositeExtract %uint %25 1
+ %28 = OpBitcast %uint %int_1
+ %31 = OpCompositeConstruct %v3uint %26 %27 %28
+ %19 = OpImageRead %v4float %20 %31
+ OpStore %res %19
+ %36 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %37 = OpLoad %v4float %res
+ OpStore %36 %37
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %38
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_bc882d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %44
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureLoad_bc882d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureLoad_bc882d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.wgsl
new file mode 100644
index 0000000..b6f59b2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/bc882d.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureLoad_bc882d() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1i);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_bc882d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_bc882d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_bc882d();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/bd990a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/bd990a.wgsl.expected.glsl
index f717bfb..afa4830 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bd990a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bd990a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/bdc67a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/bdc67a.wgsl.expected.glsl
index 5315c7e..f907b8e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/bdc67a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/bdc67a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/c5c86d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/c5c86d.wgsl.expected.glsl
index 355d64e..7c28f87 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c5c86d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c5c86d.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/c7e313.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/c7e313.wgsl.expected.glsl
index 096a2b4..ffcd8f2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c7e313.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c7e313.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/c8ed19.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/c8ed19.wgsl.expected.glsl
index b0ab768..3fe0918 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c8ed19.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c8ed19.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/c98bf4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/c98bf4.wgsl.expected.glsl
index 3ad8190..721592a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c98bf4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c98bf4.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/c9b083.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/c9b083.wgsl.expected.glsl
index a0ad8f7..2f03ed7 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c9b083.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c9b083.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/cac876.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/cac876.wgsl.expected.glsl
index 65948df..579b88d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cac876.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cac876.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/cdbcf6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/cdbcf6.wgsl.expected.glsl
index eca02bd..4ca11db 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cdbcf6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cdbcf6.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/cdccd2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/cdccd2.wgsl.expected.glsl
index 923763e..39a23c1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cdccd2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cdccd2.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/cddf6b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/cddf6b.wgsl.expected.glsl
index 2372797..5611aa9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/cddf6b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/cddf6b.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl
new file mode 100644
index 0000000..70a77e8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_3d<r8unorm, read>, coords: vec3<i32>) -> vec4<f32>
+fn textureLoad_cece6c() {
+ var res: vec4<f32> = textureLoad(arg_0, vec3<i32>(1i));
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_cece6c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_cece6c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_cece6c();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3315add
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_cece6c() {
+ float4 res = arg_0.Load(int4((1).xxx, 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_cece6c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_cece6c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_cece6c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3315add
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_cece6c() {
+ float4 res = arg_0.Load(int4((1).xxx, 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_cece6c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_cece6c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_cece6c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.glsl
new file mode 100644
index 0000000..3ee6489
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_cece6c() {
+ vec4 res = imageLoad(arg_0, ivec3(1));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_cece6c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_cece6c() {
+ vec4 res = imageLoad(arg_0, ivec3(1));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_cece6c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_cece6c() {
+ vec4 res = imageLoad(arg_0, ivec3(1));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_cece6c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.msl
new file mode 100644
index 0000000..aa12ce7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_cece6c(texture3d<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint3(int3(1)));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_cece6c(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_cece6c(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_cece6c(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.spvasm
new file mode 100644
index 0000000..c954a0a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.spvasm
@@ -0,0 +1,93 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 46
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_cece6c "textureLoad_cece6c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %24 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %32 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_cece6c = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %19 = OpImageRead %v4float %20 %24
+ OpStore %res %19
+ %30 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %31 = OpLoad %v4float %res
+ OpStore %30 %31
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %32
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_cece6c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %37 = OpLabel
+ %38 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %38
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_cece6c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureLoad_cece6c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.wgsl
new file mode 100644
index 0000000..b164b56
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/cece6c.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read>;
+
+fn textureLoad_cece6c() {
+ var res : vec4<f32> = textureLoad(arg_0, vec3<i32>(1i));
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_cece6c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_cece6c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_cece6c();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/d0e351.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/d0e351.wgsl.expected.glsl
index 988339e..0d50d67 100644
--- a/test/tint/builtins/gen/literal/textureLoad/d0e351.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/d0e351.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/d37a08.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/d37a08.wgsl.expected.glsl
index 4597ba0..bc4dfe51 100644
--- a/test/tint/builtins/gen/literal/textureLoad/d37a08.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/d37a08.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/d3d8fc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/d3d8fc.wgsl.expected.glsl
index 4ade367..dd24f4a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/d3d8fc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/d3d8fc.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/d41c72.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/d41c72.wgsl.expected.glsl
index 099dd0d..03ba55e 100644
--- a/test/tint/builtins/gen/literal/textureLoad/d41c72.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/d41c72.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/d72de9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/d72de9.wgsl.expected.glsl
index 15c0470..5f4ea89 100644
--- a/test/tint/builtins/gen/literal/textureLoad/d72de9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/d72de9.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/d7996a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/d7996a.wgsl.expected.glsl
index 868c7e9..ec45239 100644
--- a/test/tint/builtins/gen/literal/textureLoad/d7996a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/d7996a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/d79c5c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/d79c5c.wgsl.expected.glsl
index 9790169..2c73a58 100644
--- a/test/tint/builtins/gen/literal/textureLoad/d79c5c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/d79c5c.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/d80ff3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/d80ff3.wgsl.expected.glsl
index a440e27..3b82219 100644
--- a/test/tint/builtins/gen/literal/textureLoad/d80ff3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/d80ff3.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/d81c57.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/d81c57.wgsl.expected.glsl
index da8b27d..08f8875 100644
--- a/test/tint/builtins/gen/literal/textureLoad/d81c57.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/d81c57.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/d8617f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/d8617f.wgsl.expected.glsl
index 65933c5..4ae6bc1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/d8617f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/d8617f.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/d8be5a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/d8be5a.wgsl.expected.glsl
index f98ce94..2af20d1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/d8be5a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/d8be5a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/d91f37.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/d91f37.wgsl.expected.glsl
index 05cdd78..43a6b6d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/d91f37.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/d91f37.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/dab04f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/dab04f.wgsl.expected.glsl
index 2024711..0173f5b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/dab04f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/dab04f.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/dd5859.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/dd5859.wgsl.expected.glsl
index a11f300..33273cf 100644
--- a/test/tint/builtins/gen/literal/textureLoad/dd5859.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/dd5859.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/dd8776.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/dd8776.wgsl.expected.glsl
index 338d257..69a36e9 100644
--- a/test/tint/builtins/gen/literal/textureLoad/dd8776.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/dd8776.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/de5a0e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/de5a0e.wgsl.expected.glsl
index 58670d6..f29d950 100644
--- a/test/tint/builtins/gen/literal/textureLoad/de5a0e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/de5a0e.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/defd9a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/defd9a.wgsl.expected.glsl
index 0f5d682..6c32715 100644
--- a/test/tint/builtins/gen/literal/textureLoad/defd9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/defd9a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/e1c3cf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/e1c3cf.wgsl.expected.glsl
index 379b404..3967b97 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e1c3cf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e1c3cf.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/e2b3a1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/e2b3a1.wgsl.expected.glsl
index 8f65a29..8e9b263 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e2b3a1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e2b3a1.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/e2d7da.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/e2d7da.wgsl.expected.glsl
index f1ea79c..794ce78 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e2d7da.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e2d7da.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/e33285.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/e33285.wgsl.expected.glsl
index a4ed050..8346379 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e33285.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e33285.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl
new file mode 100644
index 0000000..a375726
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_2d<r8unorm, read_write>, coords: vec2<u32>) -> vec4<f32>
+fn textureLoad_e4051a() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u));
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_e4051a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_e4051a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_e4051a();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6ab29e4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_e4051a() {
+ float4 res = arg_0.Load((1u).xx);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_e4051a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_e4051a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_e4051a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6ab29e4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_e4051a() {
+ float4 res = arg_0.Load((1u).xx);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_e4051a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_e4051a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_e4051a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.glsl
new file mode 100644
index 0000000..235854f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_e4051a() {
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(1u)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_e4051a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_e4051a() {
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(1u)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_e4051a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_e4051a() {
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(1u)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_e4051a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.msl
new file mode 100644
index 0000000..35d71f0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_e4051a(texture2d<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint2(uint2(1u)));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_e4051a(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_e4051a(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_e4051a(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.spvasm
new file mode 100644
index 0000000..e3e663a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.spvasm
@@ -0,0 +1,91 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_e4051a "textureLoad_e4051a"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %24 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_e4051a = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %19 = OpImageRead %v4float %20 %24
+ OpStore %res %19
+ %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %30 = OpLoad %v4float %res
+ OpStore %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_e4051a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_e4051a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureLoad_e4051a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.wgsl
new file mode 100644
index 0000000..47de1d3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/e4051a.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read_write>;
+
+fn textureLoad_e4051a() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u));
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_e4051a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_e4051a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_e4051a();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/e59fdf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/e59fdf.wgsl.expected.glsl
index a285a98..59abca0 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e59fdf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e59fdf.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/e65916.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/e65916.wgsl.expected.glsl
index c5a621b..b4eca5a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e65916.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e65916.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/e9eb65.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/e9eb65.wgsl.expected.glsl
index 9b1aefa..747c7e3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e9eb65.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e9eb65.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/ed55a8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/ed55a8.wgsl.expected.glsl
index e01b48d..2e46808 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ed55a8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ed55a8.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/eecf7d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/eecf7d.wgsl.expected.glsl
index ab53992..8e7093b 100644
--- a/test/tint/builtins/gen/literal/textureLoad/eecf7d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/eecf7d.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/ef2ec3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/ef2ec3.wgsl.expected.glsl
index ef2bf37..64d636a 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ef2ec3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ef2ec3.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/ef5405.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/ef5405.wgsl.expected.glsl
index e354a6b..48ec922 100644
--- a/test/tint/builtins/gen/literal/textureLoad/ef5405.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/ef5405.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/f0514a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f0514a.wgsl.expected.glsl
index 8a4a94d..5515edc 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f0514a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f0514a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl
new file mode 100644
index 0000000..ffbcd20
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<u32>, array_index: u32) -> vec4<f32>
+fn textureLoad_f2bdd4() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f2bdd4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f2bdd4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f2bdd4();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9dd2a53
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_f2bdd4() {
+ float4 res = arg_0.Load(uint3((1u).xx, 1u));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f2bdd4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f2bdd4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f2bdd4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9dd2a53
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_f2bdd4() {
+ float4 res = arg_0.Load(uint3((1u).xx, 1u));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f2bdd4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f2bdd4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f2bdd4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.glsl
new file mode 100644
index 0000000..ba0e5fa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_f2bdd4() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(uvec2(1u), 1u)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_f2bdd4();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_f2bdd4() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(uvec2(1u), 1u)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_f2bdd4();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_f2bdd4() {
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(uvec2(1u), 1u)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_f2bdd4();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.msl
new file mode 100644
index 0000000..d5786e4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_f2bdd4(texture2d_array<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint2(uint2(1u)), 1u);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_f2bdd4(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_f2bdd4(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_f2bdd4(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.spvasm
new file mode 100644
index 0000000..50bfec3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.spvasm
@@ -0,0 +1,95 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 49
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_f2bdd4 "textureLoad_f2bdd4"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %25 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %35 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_f2bdd4 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %26 = OpCompositeExtract %uint %25 0
+ %27 = OpCompositeExtract %uint %25 1
+ %28 = OpCompositeConstruct %v3uint %26 %27 %uint_1
+ %19 = OpImageRead %v4float %20 %28
+ OpStore %res %19
+ %33 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %34 = OpLoad %v4float %res
+ OpStore %33 %34
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %35
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_f2bdd4
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %40 = OpLabel
+ %41 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %41
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureLoad_f2bdd4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureLoad_f2bdd4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.wgsl
new file mode 100644
index 0000000..c9a2276
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f2bdd4.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureLoad_f2bdd4() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u), 1u);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f2bdd4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f2bdd4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f2bdd4();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f2c311.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f2c311.wgsl.expected.glsl
index 694dd7a..e3a9710 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f2c311.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f2c311.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl
new file mode 100644
index 0000000..e8a0e9a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_2d<r8unorm, read>, coords: vec2<u32>) -> vec4<f32>
+fn textureLoad_f5aee2() {
+ var res: vec4<f32> = textureLoad(arg_0, vec2<u32>(1u));
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f5aee2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f5aee2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f5aee2();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..26bd490
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_f5aee2() {
+ float4 res = arg_0.Load(uint3((1u).xx, uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f5aee2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f5aee2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f5aee2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..26bd490
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_f5aee2() {
+ float4 res = arg_0.Load(uint3((1u).xx, uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f5aee2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f5aee2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f5aee2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.glsl
new file mode 100644
index 0000000..ca89409
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_f5aee2() {
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(1u)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_f5aee2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_f5aee2() {
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(1u)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_f5aee2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_f5aee2() {
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(1u)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_f5aee2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.msl
new file mode 100644
index 0000000..a95198a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_f5aee2(texture2d<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ float4 res = tint_symbol_1.read(uint2(uint2(1u)));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_f5aee2(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_f5aee2(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_f5aee2(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.spvasm
new file mode 100644
index 0000000..412f9f0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_f5aee2 "textureLoad_f5aee2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %24 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_f5aee2 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ %20 = OpLoad %11 %arg_0
+ %19 = OpImageRead %v4float %20 %24
+ OpStore %res %19
+ %29 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %30 = OpLoad %v4float %res
+ OpStore %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_f5aee2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_f5aee2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureLoad_f5aee2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.wgsl
new file mode 100644
index 0000000..20fc3cd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureLoad/f5aee2.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read>;
+
+fn textureLoad_f5aee2() {
+ var res : vec4<f32> = textureLoad(arg_0, vec2<u32>(1u));
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f5aee2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f5aee2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f5aee2();
+}
diff --git a/test/tint/builtins/gen/literal/textureLoad/f5fbc6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f5fbc6.wgsl.expected.glsl
index 27ce306..8761477 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f5fbc6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f5fbc6.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/f74bd8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f74bd8.wgsl.expected.glsl
index f467d3d..2dc4af1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f74bd8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f74bd8.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/f7f3bc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f7f3bc.wgsl.expected.glsl
index 343dad4..5e55a27 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f7f3bc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f7f3bc.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/f82eb2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/f82eb2.wgsl.expected.glsl
index 31050e8..653e86d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/f82eb2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/f82eb2.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/fc47ff.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/fc47ff.wgsl.expected.glsl
index 6e06e5a..d970b62 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fc47ff.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fc47ff.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/fd9606.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/fd9606.wgsl.expected.glsl
index 3b61958..5d556c4 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fd9606.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fd9606.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureLoad/fe2c1b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/fe2c1b.wgsl.expected.glsl
index b5690aa..f836ab2 100644
--- a/test/tint/builtins/gen/literal/textureLoad/fe2c1b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/fe2c1b.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:10: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:10: '' : compilation terminated
+ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:11: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.glsl
index 1a50dab..f4307a67 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/17ccad.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/17ccad.wgsl.expected.glsl
index 0aa22e5..5fb990b 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/17ccad.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/17ccad.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/24d572.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/24d572.wgsl.expected.glsl
index 1403066..2a5c2b9 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/24d572.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/24d572.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/2d95ea.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/2d95ea.wgsl.expected.glsl
index 672a12b..449c31b 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/2d95ea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/2d95ea.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.glsl
index ae17104..fefaea1 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.glsl
index 5b2e8e0..91a14c6 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.glsl
index 30cee48..2f19a4d 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl
new file mode 100644
index 0000000..e070c2b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<r8unorm, read>) -> u32
+fn textureNumLayers_59cc27() {
+ var res: u32 = textureNumLayers(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_59cc27();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_59cc27();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_59cc27();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..cc6f1a0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureNumLayers_59cc27() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_59cc27();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_59cc27();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_59cc27();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..cc6f1a0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureNumLayers_59cc27() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_59cc27();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_59cc27();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_59cc27();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.glsl
new file mode 100644
index 0000000..54839d4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_59cc27() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureNumLayers_59cc27();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_59cc27() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureNumLayers_59cc27();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_59cc27() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureNumLayers_59cc27();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.msl
new file mode 100644
index 0000000..262f62d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_59cc27(texture2d_array<float, access::read> tint_symbol_1, device uint* const tint_symbol_2) {
+ uint res = tint_symbol_1.get_array_size();
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read> tint_symbol_3, device uint* const tint_symbol_4) {
+ textureNumLayers_59cc27(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+ textureNumLayers_59cc27(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+ textureNumLayers_59cc27(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.spvasm
new file mode 100644
index 0000000..57ee337
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.spvasm
@@ -0,0 +1,93 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureNumLayers_59cc27 "textureNumLayers_59cc27"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %26 = OpConstantNull %uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_59cc27 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %26
+ %23 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v3uint %23
+ %20 = OpCompositeExtract %uint %21 2
+ OpStore %res %20
+ %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+ %30 = OpLoad %uint %res
+ OpStore %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_59cc27
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureNumLayers_59cc27
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureNumLayers_59cc27
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.wgsl
new file mode 100644
index 0000000..920a168
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59cc27.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read>;
+
+fn textureNumLayers_59cc27() {
+ var res : u32 = textureNumLayers(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_59cc27();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_59cc27();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_59cc27();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/622aa2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/622aa2.wgsl.expected.glsl
index 1315cbe..f5fcbd2 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/622aa2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/622aa2.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.glsl
index 70b9528..ce3296f 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.glsl
index dbc7930..dfe709b 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl
new file mode 100644
index 0000000..652cf0f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<r8unorm, write>) -> u32
+fn textureNumLayers_8356f7() {
+ var res: u32 = textureNumLayers(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8356f7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8356f7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8356f7();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2b75958
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureNumLayers_8356f7() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8356f7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8356f7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8356f7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2b75958
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureNumLayers_8356f7() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8356f7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8356f7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8356f7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.glsl
new file mode 100644
index 0000000..76782d9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_8356f7() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureNumLayers_8356f7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_8356f7() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureNumLayers_8356f7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_8356f7() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureNumLayers_8356f7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.msl
new file mode 100644
index 0000000..594960c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_8356f7(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
+ uint res = tint_symbol_1.get_array_size();
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+ textureNumLayers_8356f7(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+ textureNumLayers_8356f7(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+ textureNumLayers_8356f7(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.spvasm
new file mode 100644
index 0000000..0d23cb8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.spvasm
@@ -0,0 +1,93 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureNumLayers_8356f7 "textureNumLayers_8356f7"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %26 = OpConstantNull %uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_8356f7 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %26
+ %23 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v3uint %23
+ %20 = OpCompositeExtract %uint %21 2
+ OpStore %res %20
+ %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+ %30 = OpLoad %uint %res
+ OpStore %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_8356f7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureNumLayers_8356f7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureNumLayers_8356f7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.wgsl
new file mode 100644
index 0000000..d7fdd76
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8356f7.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, write>;
+
+fn textureNumLayers_8356f7() {
+ var res : u32 = textureNumLayers(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8356f7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8356f7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8356f7();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/90b8cc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/90b8cc.wgsl.expected.glsl
index 4fc489d..8125766 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/90b8cc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/90b8cc.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl
new file mode 100644
index 0000000..e7dc908
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<r8unorm, read_write>) -> u32
+fn textureNumLayers_aac630() {
+ var res: u32 = textureNumLayers(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_aac630();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_aac630();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_aac630();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1ede708
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureNumLayers_aac630() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_aac630();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_aac630();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_aac630();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1ede708
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureNumLayers_aac630() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_aac630();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_aac630();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_aac630();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.glsl
new file mode 100644
index 0000000..2853882
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_aac630() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureNumLayers_aac630();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_aac630() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureNumLayers_aac630();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_aac630() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureNumLayers_aac630();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.msl
new file mode 100644
index 0000000..dca1d16
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_aac630(texture2d_array<float, access::read_write> tint_symbol_1, device uint* const tint_symbol_2) {
+ uint res = tint_symbol_1.get_array_size();
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_3, device uint* const tint_symbol_4) {
+ textureNumLayers_aac630(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+ textureNumLayers_aac630(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+ textureNumLayers_aac630(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.spvasm
new file mode 100644
index 0000000..520b9bc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureNumLayers_aac630 "textureNumLayers_aac630"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %26 = OpConstantNull %uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_aac630 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %26
+ %23 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v3uint %23
+ %20 = OpCompositeExtract %uint %21 2
+ OpStore %res %20
+ %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+ %30 = OpLoad %uint %res
+ OpStore %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_aac630
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureNumLayers_aac630
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureNumLayers_aac630
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.wgsl
new file mode 100644
index 0000000..e1fe7a1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/aac630.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureNumLayers_aac630() {
+ var res : u32 = textureNumLayers(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_aac630();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_aac630();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_aac630();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/bf2f76.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/bf2f76.wgsl.expected.glsl
index 3353dc7..86fd086 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/bf2f76.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/bf2f76.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.glsl
index b3921eb..389a0c4 100644
--- a/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.glsl
index 2024f87..a7fd990 100644
--- a/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/4703d0.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -23,8 +24,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.glsl
index 6e023ea..ad94abd 100644
--- a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -23,8 +24,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.glsl
index 13181cf..2f00f1f 100644
--- a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -23,8 +24,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.glsl
index c004744..5a4dd45 100644
--- a/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/7fd8cb.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -23,8 +24,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.glsl
index c2b55d5..0da2ec5 100644
--- a/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/bc7477.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -23,8 +24,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.glsl
index db30ec3..ac6952f 100644
--- a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -23,8 +24,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.glsl
index 2ad03bf..baa809c 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/c6953d.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -23,8 +24,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.glsl
index 8944873..7e22ead 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -23,8 +24,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.glsl
index e47e0b3..39b683a 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/1912e5.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -23,8 +24,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.glsl
index 6981cb4..c8ffe50 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/7b5025.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -23,8 +24,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.glsl
index ef647da..92c9b02 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -23,8 +24,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.glsl
index 9b98f6a..485cb83 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -23,8 +24,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.glsl
index d2bd75c..c34ffd2 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.glsl
index ffb2132..0c8f5ad 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.glsl
index 0c879c3..162ed4d 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.glsl
index b76a38f..eba215d 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.glsl
index 95d5147..1058170 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/bbb58f.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.glsl
index 75f5bae..38fec77 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.glsl
index eb88092..a7b74cb 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.glsl
index 17520c1..0bdbb80 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeShadow arg_0_arg_1;
@@ -57,9 +58,9 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:11: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:12: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
+ERROR: 0:12: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.glsl
index d01b0c6..c290bf4 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -57,9 +58,9 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:11: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:12: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
+ERROR: 0:12: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.glsl
index a3ea92f..391e720 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/2974eb.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -57,9 +58,9 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:11: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:12: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
+ERROR: 0:12: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.glsl
index 3863cb0..e523642 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.glsl
index e860154..2732a8d 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36f0d3.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.glsl
index f189438..72fd0e2 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/3c3442.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -57,9 +58,9 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:11: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:12: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
+ERROR: 0:12: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.glsl
index 574e933..adb0dfa 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/615583.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -57,9 +58,9 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:11: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:12: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
+ERROR: 0:12: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.glsl
index e5cd107..68b1c91 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/941a53.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.glsl
index f079402..c273bd2 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/a12142.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.glsl
index 93669b9..c34a0cf 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/aab3b9.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.glsl
index ac7e0ca..92bb606 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.glsl
index 194bba4..081bf4a 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae92a2.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeShadow arg_0_arg_1;
@@ -57,9 +58,9 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:11: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:12: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
+ERROR: 0:12: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.glsl
index fb4f8e2..2d6cd2c 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/cdfe0f.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.glsl
index aa7f64c..8e51a12 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/e6ce9e.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.glsl
index 1ae0abc..e1476f6 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ff11bc.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl.expected.glsl
index 104d3f9..2e8b360 100644
--- a/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_064c7f() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl
new file mode 100644
index 0000000..c33be4a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_1d<r8unorm, read_write>, coords: i32, value: vec4<f32>)
+fn textureStore_0ad124() {
+ textureStore(arg_0, 1i, vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_0ad124();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_0ad124();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_0ad124();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a069f49
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_0ad124() {
+ arg_0[1] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_0ad124();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_0ad124();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_0ad124();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a069f49
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_0ad124() {
+ arg_0[1] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_0ad124();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_0ad124();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_0ad124();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.glsl
new file mode 100644
index 0000000..e387e43
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_0ad124() {
+ imageStore(arg_0, ivec2(1, 0), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_0ad124();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_0ad124() {
+ imageStore(arg_0, ivec2(1, 0), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_0ad124();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_0ad124() {
+ imageStore(arg_0, ivec2(1, 0), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_0ad124();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.msl
new file mode 100644
index 0000000..5aacfa2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_0ad124(texture1d<float, access::read_write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint(1)); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read_write> tint_symbol_2) {
+ textureStore_0ad124(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_0ad124(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_0ad124(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.spvasm
new file mode 100644
index 0000000..ece7679
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.spvasm
@@ -0,0 +1,72 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 35
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_0ad124 "textureStore_0ad124"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+ %21 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %22 = OpTypeFunction %v4float
+%textureStore_0ad124 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ OpImageWrite %17 %int_1 %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_0ad124
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_0ad124
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_0ad124
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.wgsl
new file mode 100644
index 0000000..0ee22bd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/0ad124.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read_write>;
+
+fn textureStore_0ad124() {
+ textureStore(arg_0, 1i, vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_0ad124();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_0ad124();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_0ad124();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/0ade9a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/0ade9a.wgsl.expected.glsl
index dbea7a0..e45d047 100644
--- a/test/tint/builtins/gen/literal/textureStore/0ade9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/0ade9a.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_0ade9a() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl
new file mode 100644
index 0000000..2d49463
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_3d<r8unorm, write>, coords: vec3<i32>, value: vec4<f32>)
+fn textureStore_1a264d() {
+ textureStore(arg_0, vec3<i32>(1i), vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_1a264d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_1a264d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_1a264d();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..96479dd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_1a264d() {
+ arg_0[(1).xxx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_1a264d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_1a264d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_1a264d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..96479dd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_1a264d() {
+ arg_0[(1).xxx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_1a264d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_1a264d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_1a264d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.glsl
new file mode 100644
index 0000000..6013fc5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_1a264d() {
+ imageStore(arg_0, ivec3(1), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_1a264d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_1a264d() {
+ imageStore(arg_0, ivec3(1), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_1a264d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_1a264d() {
+ imageStore(arg_0, ivec3(1), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_1a264d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.msl
new file mode 100644
index 0000000..36e1e8d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_1a264d(texture3d<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint3(int3(1)));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureStore_1a264d(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_1a264d(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_1a264d(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.spvasm
new file mode 100644
index 0000000..2d195be
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_1a264d "textureStore_1a264d"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %21 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %float_1 = OpConstant %float 1
+ %23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %24 = OpTypeFunction %v4float
+%textureStore_1a264d = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ OpImageWrite %17 %21 %23
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_1a264d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureStore_1a264d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_1a264d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.wgsl
new file mode 100644
index 0000000..6e4e18c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1a264d.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, write>;
+
+fn textureStore_1a264d() {
+ textureStore(arg_0, vec3<i32>(1i), vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_1a264d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_1a264d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_1a264d();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1a6c0b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/1a6c0b.wgsl.expected.glsl
index 829474d..5f8ddc2 100644
--- a/test/tint/builtins/gen/literal/textureStore/1a6c0b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/1a6c0b.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_1a6c0b() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl
new file mode 100644
index 0000000..79b7352
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, write>, coords: vec2<i32>, array_index: i32, value: vec4<f32>)
+fn textureStore_1e79f0() {
+ textureStore(arg_0, vec2<i32>(1i), 1i, vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_1e79f0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_1e79f0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_1e79f0();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..872d399
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_1e79f0() {
+ arg_0[int3((1).xx, 1)] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_1e79f0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_1e79f0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_1e79f0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..872d399
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_1e79f0() {
+ arg_0[int3((1).xx, 1)] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_1e79f0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_1e79f0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_1e79f0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.glsl
new file mode 100644
index 0000000..09dfe76
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_1e79f0() {
+ imageStore(arg_0, ivec3(ivec2(1), 1), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_1e79f0();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_1e79f0() {
+ imageStore(arg_0, ivec3(ivec2(1), 1), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_1e79f0();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_1e79f0() {
+ imageStore(arg_0, ivec3(ivec2(1), 1), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_1e79f0();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.msl
new file mode 100644
index 0000000..146af0c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_1e79f0(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint2(int2(1)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_1e79f0(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_1e79f0(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_1e79f0(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.spvasm
new file mode 100644
index 0000000..69b5229
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_1e79f0 "textureStore_1e79f0"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %22 = OpConstantComposite %v2int %int_1 %int_1
+ %float_1 = OpConstant %float 1
+ %27 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %28 = OpTypeFunction %v4float
+%textureStore_1e79f0 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %23 = OpCompositeExtract %int %22 0
+ %24 = OpCompositeExtract %int %22 1
+ %25 = OpCompositeConstruct %v3int %23 %24 %int_1
+ OpImageWrite %17 %25 %27
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_1e79f0
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_1e79f0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_1e79f0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.wgsl
new file mode 100644
index 0000000..bc5dccc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/1e79f0.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, write>;
+
+fn textureStore_1e79f0() {
+ textureStore(arg_0, vec2<i32>(1i), 1i, vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_1e79f0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_1e79f0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_1e79f0();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl
new file mode 100644
index 0000000..0495dd2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<i32>, array_index: u32, value: vec4<f32>)
+fn textureStore_272f5a() {
+ textureStore(arg_0, vec2<i32>(1i), 1u, vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_272f5a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_272f5a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_272f5a();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c366ad1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_272f5a() {
+ arg_0[int3((1).xx, int(1u))] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_272f5a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_272f5a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_272f5a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c366ad1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_272f5a() {
+ arg_0[int3((1).xx, int(1u))] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_272f5a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_272f5a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_272f5a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.glsl
new file mode 100644
index 0000000..dd05acc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_272f5a() {
+ imageStore(arg_0, ivec3(ivec2(1), int(1u)), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_272f5a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_272f5a() {
+ imageStore(arg_0, ivec3(ivec2(1), int(1u)), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_272f5a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_272f5a() {
+ imageStore(arg_0, ivec3(ivec2(1), int(1u)), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_272f5a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.msl
new file mode 100644
index 0000000..a9c8998
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_272f5a(texture2d_array<float, access::read_write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint2(int2(1)), 1u); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_2) {
+ textureStore_272f5a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_272f5a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_272f5a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.spvasm
new file mode 100644
index 0000000..75e2705
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_272f5a "textureStore_272f5a"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %22 = OpConstantComposite %v2int %int_1 %int_1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %float_1 = OpConstant %float 1
+ %30 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %31 = OpTypeFunction %v4float
+%textureStore_272f5a = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %23 = OpCompositeExtract %int %22 0
+ %24 = OpCompositeExtract %int %22 1
+ %25 = OpBitcast %int %uint_1
+ %28 = OpCompositeConstruct %v3int %23 %24 %25
+ OpImageWrite %17 %28 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_272f5a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_272f5a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureStore_272f5a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.wgsl
new file mode 100644
index 0000000..bbe8755
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/272f5a.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureStore_272f5a() {
+ textureStore(arg_0, vec2<i32>(1i), 1u, vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_272f5a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_272f5a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_272f5a();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl.expected.glsl
index 3855fd3..13a04c7 100644
--- a/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
void textureStore_2796b4() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/2d2835.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/2d2835.wgsl.expected.glsl
index 0e3debe..16b7226 100644
--- a/test/tint/builtins/gen/literal/textureStore/2d2835.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/2d2835.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_2d2835() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl
new file mode 100644
index 0000000..883f99f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_2d<r8unorm, read_write>, coords: vec2<u32>, value: vec4<f32>)
+fn textureStore_2e512f() {
+ textureStore(arg_0, vec2<u32>(1u), vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_2e512f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_2e512f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_2e512f();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f133a86
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_2e512f() {
+ arg_0[(1u).xx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_2e512f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_2e512f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_2e512f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f133a86
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_2e512f() {
+ arg_0[(1u).xx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_2e512f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_2e512f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_2e512f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.glsl
new file mode 100644
index 0000000..6c1521c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_2e512f() {
+ imageStore(arg_0, ivec2(uvec2(1u)), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_2e512f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_2e512f() {
+ imageStore(arg_0, ivec2(uvec2(1u)), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_2e512f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_2e512f() {
+ imageStore(arg_0, ivec2(uvec2(1u)), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_2e512f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.msl
new file mode 100644
index 0000000..d1e439a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_2e512f(texture2d<float, access::read_write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint2(uint2(1u))); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read_write> tint_symbol_2) {
+ textureStore_2e512f(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_2e512f(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_2e512f(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.spvasm
new file mode 100644
index 0000000..effeb34
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_2e512f "textureStore_2e512f"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %21 = OpConstantComposite %v2uint %uint_1 %uint_1
+ %float_1 = OpConstant %float 1
+ %23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %24 = OpTypeFunction %v4float
+%textureStore_2e512f = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ OpImageWrite %17 %21 %23
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_2e512f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureStore_2e512f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_2e512f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.wgsl
new file mode 100644
index 0000000..9017285
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/2e512f.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read_write>;
+
+fn textureStore_2e512f() {
+ textureStore(arg_0, vec2<u32>(1u), vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_2e512f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_2e512f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_2e512f();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/31745b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/31745b.wgsl.expected.glsl
index c880a93..bed3e63 100644
--- a/test/tint/builtins/gen/literal/textureStore/31745b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/31745b.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_31745b() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl
new file mode 100644
index 0000000..6d0d8ea
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, write>, coords: vec2<i32>, array_index: u32, value: vec4<f32>)
+fn textureStore_37eeef() {
+ textureStore(arg_0, vec2<i32>(1i), 1u, vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_37eeef();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_37eeef();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_37eeef();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..56d5ddd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_37eeef() {
+ arg_0[int3((1).xx, int(1u))] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_37eeef();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_37eeef();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_37eeef();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..56d5ddd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_37eeef() {
+ arg_0[int3((1).xx, int(1u))] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_37eeef();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_37eeef();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_37eeef();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.glsl
new file mode 100644
index 0000000..3344951
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_37eeef() {
+ imageStore(arg_0, ivec3(ivec2(1), int(1u)), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_37eeef();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_37eeef() {
+ imageStore(arg_0, ivec3(ivec2(1), int(1u)), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_37eeef();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_37eeef() {
+ imageStore(arg_0, ivec3(ivec2(1), int(1u)), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_37eeef();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.msl
new file mode 100644
index 0000000..fe04e5d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_37eeef(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint2(int2(1)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_37eeef(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_37eeef(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_37eeef(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.spvasm
new file mode 100644
index 0000000..318dae3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.spvasm
@@ -0,0 +1,81 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_37eeef "textureStore_37eeef"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %22 = OpConstantComposite %v2int %int_1 %int_1
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %float_1 = OpConstant %float 1
+ %30 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %31 = OpTypeFunction %v4float
+%textureStore_37eeef = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %23 = OpCompositeExtract %int %22 0
+ %24 = OpCompositeExtract %int %22 1
+ %25 = OpBitcast %int %uint_1
+ %28 = OpCompositeConstruct %v3int %23 %24 %25
+ OpImageWrite %17 %28 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_37eeef
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_37eeef
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureStore_37eeef
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.wgsl
new file mode 100644
index 0000000..793f876
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/37eeef.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, write>;
+
+fn textureStore_37eeef() {
+ textureStore(arg_0, vec2<i32>(1i), 1u, vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_37eeef();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_37eeef();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_37eeef();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/3d6f01.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/3d6f01.wgsl.expected.glsl
index c2dbb23..eb6813b 100644
--- a/test/tint/builtins/gen/literal/textureStore/3d6f01.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/3d6f01.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_3d6f01() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/3e0dc4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/3e0dc4.wgsl.expected.glsl
index 27fb79b..d684283 100644
--- a/test/tint/builtins/gen/literal/textureStore/3e0dc4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/3e0dc4.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_3e0dc4() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/3fb31f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/3fb31f.wgsl.expected.glsl
index c4a507b..3f1b03c 100644
--- a/test/tint/builtins/gen/literal/textureStore/3fb31f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/3fb31f.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
void textureStore_3fb31f() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl
new file mode 100644
index 0000000..d9b85fa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<i32>, array_index: i32, value: vec4<f32>)
+fn textureStore_43d1df() {
+ textureStore(arg_0, vec2<i32>(1i), 1i, vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_43d1df();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_43d1df();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_43d1df();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..068d224
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_43d1df() {
+ arg_0[int3((1).xx, 1)] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_43d1df();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_43d1df();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_43d1df();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..068d224
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_43d1df() {
+ arg_0[int3((1).xx, 1)] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_43d1df();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_43d1df();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_43d1df();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.glsl
new file mode 100644
index 0000000..ce0b759
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_43d1df() {
+ imageStore(arg_0, ivec3(ivec2(1), 1), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_43d1df();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_43d1df() {
+ imageStore(arg_0, ivec3(ivec2(1), 1), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_43d1df();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_43d1df() {
+ imageStore(arg_0, ivec3(ivec2(1), 1), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_43d1df();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.msl
new file mode 100644
index 0000000..012b3d7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_43d1df(texture2d_array<float, access::read_write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint2(int2(1)), 1); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_2) {
+ textureStore_43d1df(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_43d1df(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_43d1df(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.spvasm
new file mode 100644
index 0000000..ab35050
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_43d1df "textureStore_43d1df"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %22 = OpConstantComposite %v2int %int_1 %int_1
+ %float_1 = OpConstant %float 1
+ %27 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %28 = OpTypeFunction %v4float
+%textureStore_43d1df = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %23 = OpCompositeExtract %int %22 0
+ %24 = OpCompositeExtract %int %22 1
+ %25 = OpCompositeConstruct %v3int %23 %24 %int_1
+ OpImageWrite %17 %25 %27
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_43d1df
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_43d1df
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_43d1df
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.wgsl
new file mode 100644
index 0000000..8f43db2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/43d1df.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureStore_43d1df() {
+ textureStore(arg_0, vec2<i32>(1i), 1i, vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_43d1df();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_43d1df();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_43d1df();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/473ead.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/473ead.wgsl.expected.glsl
index b6c87b1..7e20e07 100644
--- a/test/tint/builtins/gen/literal/textureStore/473ead.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/473ead.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
void textureStore_473ead() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl
new file mode 100644
index 0000000..5f38612
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d<r8unorm, write>, coords: vec2<i32>, value: vec4<f32>)
+fn textureStore_48eae1() {
+ textureStore(arg_0, vec2<i32>(1i), vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_48eae1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_48eae1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_48eae1();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..648835f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_48eae1() {
+ arg_0[(1).xx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_48eae1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_48eae1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_48eae1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..648835f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_48eae1() {
+ arg_0[(1).xx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_48eae1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_48eae1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_48eae1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.glsl
new file mode 100644
index 0000000..e752b0e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_48eae1() {
+ imageStore(arg_0, ivec2(1), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_48eae1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_48eae1() {
+ imageStore(arg_0, ivec2(1), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_48eae1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_48eae1() {
+ imageStore(arg_0, ivec2(1), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_48eae1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.msl
new file mode 100644
index 0000000..df004d4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_48eae1(texture2d<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint2(int2(1)));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureStore_48eae1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_48eae1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_48eae1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.spvasm
new file mode 100644
index 0000000..63c8b23
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_48eae1 "textureStore_48eae1"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %21 = OpConstantComposite %v2int %int_1 %int_1
+ %float_1 = OpConstant %float 1
+ %23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %24 = OpTypeFunction %v4float
+%textureStore_48eae1 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ OpImageWrite %17 %21 %23
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_48eae1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureStore_48eae1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_48eae1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.wgsl
new file mode 100644
index 0000000..d6fbf5e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/48eae1.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, write>;
+
+fn textureStore_48eae1() {
+ textureStore(arg_0, vec2<i32>(1i), vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_48eae1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_48eae1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_48eae1();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/4c454f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/4c454f.wgsl.expected.glsl
index 3765edd..ed56190 100644
--- a/test/tint/builtins/gen/literal/textureStore/4c454f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/4c454f.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_4c454f() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/4cce74.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/4cce74.wgsl.expected.glsl
index 2f1de36..06f25ac 100644
--- a/test/tint/builtins/gen/literal/textureStore/4cce74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/4cce74.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_4cce74() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.glsl
index 0a6549d..85a6909 100644
--- a/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/4d359d.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_4d359d() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/4e2b3a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/4e2b3a.wgsl.expected.glsl
index 41718af..ff17aa3 100644
--- a/test/tint/builtins/gen/literal/textureStore/4e2b3a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/4e2b3a.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_4e2b3a() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/506a71.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/506a71.wgsl.expected.glsl
index 2201ba3..0abd094 100644
--- a/test/tint/builtins/gen/literal/textureStore/506a71.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/506a71.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_506a71() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/51ec82.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/51ec82.wgsl.expected.glsl
index a07ca3e..bd81d6f 100644
--- a/test/tint/builtins/gen/literal/textureStore/51ec82.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/51ec82.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_51ec82() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/5425ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/5425ab.wgsl.expected.glsl
index 74918fe..287dbd5 100644
--- a/test/tint/builtins/gen/literal/textureStore/5425ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/5425ab.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_5425ab() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/574a31.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/574a31.wgsl.expected.glsl
index 884b1d3..ba77dcd 100644
--- a/test/tint/builtins/gen/literal/textureStore/574a31.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/574a31.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_574a31() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/5b17eb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/5b17eb.wgsl.expected.glsl
index ee2ff89..7494f00 100644
--- a/test/tint/builtins/gen/literal/textureStore/5b17eb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/5b17eb.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_5b17eb() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/5bc4f3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/5bc4f3.wgsl.expected.glsl
index 7b0c6f6..ab3dea5 100644
--- a/test/tint/builtins/gen/literal/textureStore/5bc4f3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/5bc4f3.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_5bc4f3() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/5ee194.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/5ee194.wgsl.expected.glsl
index 3b30ebb..de1eeed 100644
--- a/test/tint/builtins/gen/literal/textureStore/5ee194.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/5ee194.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_5ee194() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/602b5a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/602b5a.wgsl.expected.glsl
index cdb6f8b..1dcb5be 100644
--- a/test/tint/builtins/gen/literal/textureStore/602b5a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/602b5a.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_602b5a() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/635584.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/635584.wgsl.expected.glsl
index 77128fd..64e99db 100644
--- a/test/tint/builtins/gen/literal/textureStore/635584.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/635584.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_635584() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/63f34a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/63f34a.wgsl.expected.glsl
index 932ede7..8e9491e 100644
--- a/test/tint/builtins/gen/literal/textureStore/63f34a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/63f34a.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_63f34a() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.glsl
index 175b580..e7ae5eb 100644
--- a/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/658a74.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_658a74() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl
new file mode 100644
index 0000000..080afba
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_2d<r8unorm, read_write>, coords: vec2<i32>, value: vec4<f32>)
+fn textureStore_65ba8b() {
+ textureStore(arg_0, vec2<i32>(1i), vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_65ba8b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_65ba8b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_65ba8b();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..dbbe687
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_65ba8b() {
+ arg_0[(1).xx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_65ba8b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_65ba8b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_65ba8b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..dbbe687
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_65ba8b() {
+ arg_0[(1).xx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_65ba8b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_65ba8b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_65ba8b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.glsl
new file mode 100644
index 0000000..3932602
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_65ba8b() {
+ imageStore(arg_0, ivec2(1), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_65ba8b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_65ba8b() {
+ imageStore(arg_0, ivec2(1), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_65ba8b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_65ba8b() {
+ imageStore(arg_0, ivec2(1), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_65ba8b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.msl
new file mode 100644
index 0000000..e45de13
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_65ba8b(texture2d<float, access::read_write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint2(int2(1))); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read_write> tint_symbol_2) {
+ textureStore_65ba8b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_65ba8b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_65ba8b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.spvasm
new file mode 100644
index 0000000..c8d5501
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_65ba8b "textureStore_65ba8b"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %21 = OpConstantComposite %v2int %int_1 %int_1
+ %float_1 = OpConstant %float 1
+ %23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %24 = OpTypeFunction %v4float
+%textureStore_65ba8b = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ OpImageWrite %17 %21 %23
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_65ba8b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureStore_65ba8b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_65ba8b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.wgsl
new file mode 100644
index 0000000..e9bc6ce
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/65ba8b.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read_write>;
+
+fn textureStore_65ba8b() {
+ textureStore(arg_0, vec2<i32>(1i), vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_65ba8b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_65ba8b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_65ba8b();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl.expected.glsl
index 370806d..564efc4 100644
--- a/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_682fd6() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl
new file mode 100644
index 0000000..d7dbffb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<u32>, array_index: i32, value: vec4<f32>)
+fn textureStore_6f0c92() {
+ textureStore(arg_0, vec2<u32>(1u), 1i, vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_6f0c92();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_6f0c92();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_6f0c92();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..7100f2e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_6f0c92() {
+ arg_0[uint3((1u).xx, uint(1))] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_6f0c92();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_6f0c92();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6f0c92();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..7100f2e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_6f0c92() {
+ arg_0[uint3((1u).xx, uint(1))] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_6f0c92();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_6f0c92();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6f0c92();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.glsl
new file mode 100644
index 0000000..4e2fb90
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_6f0c92() {
+ imageStore(arg_0, ivec3(uvec3(uvec2(1u), uint(1))), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_6f0c92();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_6f0c92() {
+ imageStore(arg_0, ivec3(uvec3(uvec2(1u), uint(1))), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_6f0c92();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_6f0c92() {
+ imageStore(arg_0, ivec3(uvec3(uvec2(1u), uint(1))), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_6f0c92();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.msl
new file mode 100644
index 0000000..353309f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_6f0c92(texture2d_array<float, access::read_write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint2(uint2(1u)), 1); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_2) {
+ textureStore_6f0c92(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_6f0c92(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_6f0c92(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.spvasm
new file mode 100644
index 0000000..3773f86
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_6f0c92 "textureStore_6f0c92"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+ %30 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %31 = OpTypeFunction %v4float
+%textureStore_6f0c92 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %23 = OpCompositeExtract %uint %22 0
+ %24 = OpCompositeExtract %uint %22 1
+ %25 = OpBitcast %uint %int_1
+ %28 = OpCompositeConstruct %v3uint %23 %24 %25
+ OpImageWrite %17 %28 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_6f0c92
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_6f0c92
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureStore_6f0c92
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.wgsl
new file mode 100644
index 0000000..75fff4e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6f0c92.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureStore_6f0c92() {
+ textureStore(arg_0, vec2<u32>(1u), 1i, vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_6f0c92();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_6f0c92();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_6f0c92();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl
new file mode 100644
index 0000000..7bac8e3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_1d<r8unorm, write>, coords: u32, value: vec4<f32>)
+fn textureStore_6fd2b1() {
+ textureStore(arg_0, 1u, vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_6fd2b1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_6fd2b1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_6fd2b1();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8ce935d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_6fd2b1() {
+ arg_0[1u] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_6fd2b1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_6fd2b1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6fd2b1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8ce935d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_6fd2b1() {
+ arg_0[1u] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_6fd2b1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_6fd2b1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6fd2b1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.glsl
new file mode 100644
index 0000000..5efe371
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_6fd2b1() {
+ imageStore(arg_0, ivec2(uvec2(1u, 0u)), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_6fd2b1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_6fd2b1() {
+ imageStore(arg_0, ivec2(uvec2(1u, 0u)), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_6fd2b1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_6fd2b1() {
+ imageStore(arg_0, ivec2(uvec2(1u, 0u)), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_6fd2b1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.msl
new file mode 100644
index 0000000..617dcaa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_6fd2b1(texture1d<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureStore_6fd2b1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_6fd2b1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_6fd2b1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.spvasm
new file mode 100644
index 0000000..e0e5a9d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 35
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_6fd2b1 "textureStore_6fd2b1"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %float_1 = OpConstant %float 1
+ %21 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %22 = OpTypeFunction %v4float
+%textureStore_6fd2b1 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ OpImageWrite %17 %uint_1 %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_6fd2b1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_6fd2b1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_6fd2b1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.wgsl
new file mode 100644
index 0000000..0cece45
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/6fd2b1.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, write>;
+
+fn textureStore_6fd2b1() {
+ textureStore(arg_0, 1u, vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_6fd2b1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_6fd2b1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_6fd2b1();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/726472.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/726472.wgsl.expected.glsl
index cbe82f3..546a4ca 100644
--- a/test/tint/builtins/gen/literal/textureStore/726472.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/726472.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_726472() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.glsl
index 0baf8de..d7e2a42 100644
--- a/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/72fa64.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_72fa64() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/74886f.wgsl b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl
new file mode 100644
index 0000000..72f1cba
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_1d<r8unorm, write>, coords: i32, value: vec4<f32>)
+fn textureStore_74886f() {
+ textureStore(arg_0, 1i, vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_74886f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_74886f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_74886f();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..77e17fe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_74886f() {
+ arg_0[1] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_74886f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_74886f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_74886f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..77e17fe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_74886f() {
+ arg_0[1] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_74886f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_74886f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_74886f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.glsl
new file mode 100644
index 0000000..3fe07e8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_74886f() {
+ imageStore(arg_0, ivec2(1, 0), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_74886f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_74886f() {
+ imageStore(arg_0, ivec2(1, 0), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_74886f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_74886f() {
+ imageStore(arg_0, ivec2(1, 0), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_74886f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.msl
new file mode 100644
index 0000000..0b8e3f0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_74886f(texture1d<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureStore_74886f(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_74886f(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_74886f(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.spvasm
new file mode 100644
index 0000000..79ffe47
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 35
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_74886f "textureStore_74886f"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+ %21 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %22 = OpTypeFunction %v4float
+%textureStore_74886f = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ OpImageWrite %17 %int_1 %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_74886f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_74886f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_74886f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.wgsl
new file mode 100644
index 0000000..e848b48
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/74886f.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, write>;
+
+fn textureStore_74886f() {
+ textureStore(arg_0, 1i, vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_74886f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_74886f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_74886f();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/75bbd5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/75bbd5.wgsl.expected.glsl
index 53504e8..422df25 100644
--- a/test/tint/builtins/gen/literal/textureStore/75bbd5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/75bbd5.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_75bbd5() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/7792fa.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/7792fa.wgsl.expected.glsl
index 274544f..9135de1 100644
--- a/test/tint/builtins/gen/literal/textureStore/7792fa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/7792fa.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
void textureStore_7792fa() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/7b8f86.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/7b8f86.wgsl.expected.glsl
index cde47ad..7ab97a0 100644
--- a/test/tint/builtins/gen/literal/textureStore/7b8f86.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/7b8f86.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
void textureStore_7b8f86() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.glsl
index b0738f7..3be643c 100644
--- a/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/7bb211.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_7bb211() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/803a10.wgsl b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl
new file mode 100644
index 0000000..228addc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_3d<r8unorm, read_write>, coords: vec3<u32>, value: vec4<f32>)
+fn textureStore_803a10() {
+ textureStore(arg_0, vec3<u32>(1u), vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_803a10();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_803a10();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_803a10();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8d71dc4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_803a10() {
+ arg_0[(1u).xxx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_803a10();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_803a10();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_803a10();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8d71dc4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_803a10() {
+ arg_0[(1u).xxx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_803a10();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_803a10();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_803a10();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.glsl
new file mode 100644
index 0000000..4b689ac
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_803a10() {
+ imageStore(arg_0, ivec3(uvec3(1u)), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_803a10();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_803a10() {
+ imageStore(arg_0, ivec3(uvec3(1u)), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_803a10();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_803a10() {
+ imageStore(arg_0, ivec3(uvec3(1u)), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_803a10();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.msl
new file mode 100644
index 0000000..98ef626
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_803a10(texture3d<float, access::read_write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint3(uint3(1u))); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read_write> tint_symbol_2) {
+ textureStore_803a10(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_803a10(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_803a10(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.spvasm
new file mode 100644
index 0000000..46b6308
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_803a10 "textureStore_803a10"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+ %21 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+ %float_1 = OpConstant %float 1
+ %23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %24 = OpTypeFunction %v4float
+%textureStore_803a10 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ OpImageWrite %17 %21 %23
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_803a10
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureStore_803a10
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_803a10
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.wgsl
new file mode 100644
index 0000000..ba21175
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/803a10.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read_write>;
+
+fn textureStore_803a10() {
+ textureStore(arg_0, vec3<u32>(1u), vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_803a10();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_803a10();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_803a10();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/80bf1d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/80bf1d.wgsl.expected.glsl
index 2838bf6..49eff5b 100644
--- a/test/tint/builtins/gen/literal/textureStore/80bf1d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/80bf1d.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_80bf1d() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/820272.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/820272.wgsl.expected.glsl
index 5c42032..4530869 100644
--- a/test/tint/builtins/gen/literal/textureStore/820272.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/820272.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_820272() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl.expected.glsl
index 77b1a51..f92e65d 100644
--- a/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_83bcc1() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/84d435.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/84d435.wgsl.expected.glsl
index e268f71..bbea78b 100644
--- a/test/tint/builtins/gen/literal/textureStore/84d435.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/84d435.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_84d435() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/872747.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/872747.wgsl.expected.glsl
index ffe0e80..616e460 100644
--- a/test/tint/builtins/gen/literal/textureStore/872747.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/872747.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_872747() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/8a8681.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/8a8681.wgsl.expected.glsl
index 5f9f2a5..95f68d1 100644
--- a/test/tint/builtins/gen/literal/textureStore/8a8681.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/8a8681.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_8a8681() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl
new file mode 100644
index 0000000..fafd1fb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_3d<r8unorm, write>, coords: vec3<u32>, value: vec4<f32>)
+fn textureStore_8cd611() {
+ textureStore(arg_0, vec3<u32>(1u), vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_8cd611();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_8cd611();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_8cd611();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d2ae9e9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_8cd611() {
+ arg_0[(1u).xxx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_8cd611();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_8cd611();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_8cd611();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d2ae9e9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_8cd611() {
+ arg_0[(1u).xxx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_8cd611();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_8cd611();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_8cd611();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.glsl
new file mode 100644
index 0000000..49c2c31
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_8cd611() {
+ imageStore(arg_0, ivec3(uvec3(1u)), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_8cd611();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_8cd611() {
+ imageStore(arg_0, ivec3(uvec3(1u)), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_8cd611();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_8cd611() {
+ imageStore(arg_0, ivec3(uvec3(1u)), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_8cd611();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.msl
new file mode 100644
index 0000000..0208b73
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_8cd611(texture3d<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint3(uint3(1u)));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureStore_8cd611(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_8cd611(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_8cd611(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.spvasm
new file mode 100644
index 0000000..b1dcd97
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_8cd611 "textureStore_8cd611"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+ %21 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+ %float_1 = OpConstant %float 1
+ %23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %24 = OpTypeFunction %v4float
+%textureStore_8cd611 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ OpImageWrite %17 %21 %23
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_8cd611
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureStore_8cd611
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_8cd611
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.wgsl
new file mode 100644
index 0000000..d7da4ce
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/8cd611.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, write>;
+
+fn textureStore_8cd611() {
+ textureStore(arg_0, vec3<u32>(1u), vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_8cd611();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_8cd611();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_8cd611();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl
new file mode 100644
index 0000000..a60ca5d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d<r8unorm, write>, coords: vec2<u32>, value: vec4<f32>)
+fn textureStore_9e5bc2() {
+ textureStore(arg_0, vec2<u32>(1u), vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_9e5bc2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_9e5bc2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_9e5bc2();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0b61171
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_9e5bc2() {
+ arg_0[(1u).xx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_9e5bc2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_9e5bc2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_9e5bc2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0b61171
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_9e5bc2() {
+ arg_0[(1u).xx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_9e5bc2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_9e5bc2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_9e5bc2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.glsl
new file mode 100644
index 0000000..34001b1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_9e5bc2() {
+ imageStore(arg_0, ivec2(uvec2(1u)), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_9e5bc2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_9e5bc2() {
+ imageStore(arg_0, ivec2(uvec2(1u)), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_9e5bc2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_9e5bc2() {
+ imageStore(arg_0, ivec2(uvec2(1u)), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_9e5bc2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.msl
new file mode 100644
index 0000000..94856b0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_9e5bc2(texture2d<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint2(uint2(1u)));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureStore_9e5bc2(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_9e5bc2(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_9e5bc2(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.spvasm
new file mode 100644
index 0000000..88a744d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_9e5bc2 "textureStore_9e5bc2"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %21 = OpConstantComposite %v2uint %uint_1 %uint_1
+ %float_1 = OpConstant %float 1
+ %23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %24 = OpTypeFunction %v4float
+%textureStore_9e5bc2 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ OpImageWrite %17 %21 %23
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_9e5bc2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureStore_9e5bc2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_9e5bc2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.wgsl
new file mode 100644
index 0000000..6659dbd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/9e5bc2.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, write>;
+
+fn textureStore_9e5bc2() {
+ textureStore(arg_0, vec2<u32>(1u), vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_9e5bc2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_9e5bc2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_9e5bc2();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/9f5318.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/9f5318.wgsl.expected.glsl
index 7693de3..6683ccb 100644
--- a/test/tint/builtins/gen/literal/textureStore/9f5318.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/9f5318.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_9f5318() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/a702b6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/a702b6.wgsl.expected.glsl
index 1015f1b..bdff6e3 100644
--- a/test/tint/builtins/gen/literal/textureStore/a702b6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/a702b6.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_a702b6() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl
new file mode 100644
index 0000000..317b277
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_1d<r8unorm, read_write>, coords: u32, value: vec4<f32>)
+fn textureStore_a7fc47() {
+ textureStore(arg_0, 1u, vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_a7fc47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_a7fc47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_a7fc47();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..dda40b7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_a7fc47() {
+ arg_0[1u] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_a7fc47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_a7fc47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_a7fc47();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..dda40b7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_a7fc47() {
+ arg_0[1u] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_a7fc47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_a7fc47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_a7fc47();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.glsl
new file mode 100644
index 0000000..f34f602
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_a7fc47() {
+ imageStore(arg_0, ivec2(uvec2(1u, 0u)), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_a7fc47();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_a7fc47() {
+ imageStore(arg_0, ivec2(uvec2(1u, 0u)), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_a7fc47();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_a7fc47() {
+ imageStore(arg_0, ivec2(uvec2(1u, 0u)), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_a7fc47();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.msl
new file mode 100644
index 0000000..4606735
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_a7fc47(texture1d<float, access::read_write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint(1u)); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read_write> tint_symbol_2) {
+ textureStore_a7fc47(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_a7fc47(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_a7fc47(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.spvasm
new file mode 100644
index 0000000..54508b7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.spvasm
@@ -0,0 +1,72 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 35
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_a7fc47 "textureStore_a7fc47"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+ %float_1 = OpConstant %float 1
+ %21 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %22 = OpTypeFunction %v4float
+%textureStore_a7fc47 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ OpImageWrite %17 %uint_1 %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureStore_a7fc47
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_a7fc47
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_a7fc47
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.wgsl
new file mode 100644
index 0000000..7497da8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/a7fc47.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read_write>;
+
+fn textureStore_a7fc47() {
+ textureStore(arg_0, 1u, vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_a7fc47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_a7fc47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_a7fc47();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/a9298c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/a9298c.wgsl.expected.glsl
index c8deb97..edf7119 100644
--- a/test/tint/builtins/gen/literal/textureStore/a9298c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/a9298c.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_a9298c() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/ab788e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/ab788e.wgsl.expected.glsl
index 46810f5..53f03e7 100644
--- a/test/tint/builtins/gen/literal/textureStore/ab788e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/ab788e.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_ab788e() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl.expected.glsl
index d1d862a..5efc8c3 100644
--- a/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
void textureStore_ac67aa() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl
new file mode 100644
index 0000000..ca39045
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<u32>, array_index: u32, value: vec4<f32>)
+fn textureStore_ae6a2a() {
+ textureStore(arg_0, vec2<u32>(1u), 1u, vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_ae6a2a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_ae6a2a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_ae6a2a();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b1186cd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_ae6a2a() {
+ arg_0[uint3((1u).xx, 1u)] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_ae6a2a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_ae6a2a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_ae6a2a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b1186cd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_ae6a2a() {
+ arg_0[uint3((1u).xx, 1u)] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_ae6a2a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_ae6a2a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_ae6a2a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.glsl
new file mode 100644
index 0000000..e38f4bf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_ae6a2a() {
+ imageStore(arg_0, ivec3(uvec3(uvec2(1u), 1u)), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_ae6a2a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_ae6a2a() {
+ imageStore(arg_0, ivec3(uvec3(uvec2(1u), 1u)), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_ae6a2a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_ae6a2a() {
+ imageStore(arg_0, ivec3(uvec3(uvec2(1u), 1u)), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_ae6a2a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.msl
new file mode 100644
index 0000000..32aff1b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_ae6a2a(texture2d_array<float, access::read_write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint2(uint2(1u)), 1u); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_2) {
+ textureStore_ae6a2a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_ae6a2a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_ae6a2a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.spvasm
new file mode 100644
index 0000000..b628767
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_ae6a2a "textureStore_ae6a2a"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+ %float_1 = OpConstant %float 1
+ %27 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %28 = OpTypeFunction %v4float
+%textureStore_ae6a2a = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %23 = OpCompositeExtract %uint %22 0
+ %24 = OpCompositeExtract %uint %22 1
+ %25 = OpCompositeConstruct %v3uint %23 %24 %uint_1
+ OpImageWrite %17 %25 %27
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_ae6a2a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_ae6a2a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_ae6a2a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.wgsl
new file mode 100644
index 0000000..a4d1da2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ae6a2a.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureStore_ae6a2a() {
+ textureStore(arg_0, vec2<u32>(1u), 1u, vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_ae6a2a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_ae6a2a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_ae6a2a();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/b71c13.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/b71c13.wgsl.expected.glsl
index a200dbc..c9c0a3e 100644
--- a/test/tint/builtins/gen/literal/textureStore/b71c13.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/b71c13.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_b71c13() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/b77161.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/b77161.wgsl.expected.glsl
index acb53c7..cc9ede4 100644
--- a/test/tint/builtins/gen/literal/textureStore/b77161.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/b77161.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_b77161() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl
new file mode 100644
index 0000000..02a83ca
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, write>, coords: vec2<u32>, array_index: i32, value: vec4<f32>)
+fn textureStore_b91b86() {
+ textureStore(arg_0, vec2<u32>(1u), 1i, vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_b91b86();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_b91b86();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_b91b86();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0cf080a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_b91b86() {
+ arg_0[uint3((1u).xx, uint(1))] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_b91b86();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_b91b86();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_b91b86();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0cf080a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_b91b86() {
+ arg_0[uint3((1u).xx, uint(1))] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_b91b86();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_b91b86();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_b91b86();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.glsl
new file mode 100644
index 0000000..e7d3c8b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_b91b86() {
+ imageStore(arg_0, ivec3(uvec3(uvec2(1u), uint(1))), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_b91b86();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_b91b86() {
+ imageStore(arg_0, ivec3(uvec3(uvec2(1u), uint(1))), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_b91b86();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_b91b86() {
+ imageStore(arg_0, ivec3(uvec3(uvec2(1u), uint(1))), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_b91b86();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.msl
new file mode 100644
index 0000000..f08eb9b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_b91b86(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint2(uint2(1u)), 1);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_b91b86(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_b91b86(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_b91b86(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.spvasm
new file mode 100644
index 0000000..5db9f6c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.spvasm
@@ -0,0 +1,81 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_b91b86 "textureStore_b91b86"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+ %float_1 = OpConstant %float 1
+ %30 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %31 = OpTypeFunction %v4float
+%textureStore_b91b86 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %23 = OpCompositeExtract %uint %22 0
+ %24 = OpCompositeExtract %uint %22 1
+ %25 = OpBitcast %uint %int_1
+ %28 = OpCompositeConstruct %v3uint %23 %24 %25
+ OpImageWrite %17 %28 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_b91b86
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_b91b86
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureStore_b91b86
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.wgsl
new file mode 100644
index 0000000..21d811a7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/b91b86.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, write>;
+
+fn textureStore_b91b86() {
+ textureStore(arg_0, vec2<u32>(1u), 1i, vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_b91b86();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_b91b86();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_b91b86();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/b9c81a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/b9c81a.wgsl.expected.glsl
index d6da33c..4247870 100644
--- a/test/tint/builtins/gen/literal/textureStore/b9c81a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/b9c81a.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
void textureStore_b9c81a() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/bd6602.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/bd6602.wgsl.expected.glsl
index 04057b7..f995c8d 100644
--- a/test/tint/builtins/gen/literal/textureStore/bd6602.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/bd6602.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_bd6602() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/c33478.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/c33478.wgsl.expected.glsl
index ac439ab..e572406 100644
--- a/test/tint/builtins/gen/literal/textureStore/c33478.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/c33478.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
void textureStore_c33478() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/c863be.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/c863be.wgsl.expected.glsl
index a356ba9..85287dd 100644
--- a/test/tint/builtins/gen/literal/textureStore/c863be.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/c863be.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_c863be() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/d19db4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/d19db4.wgsl.expected.glsl
index 170cb6b..7644dc4 100644
--- a/test/tint/builtins/gen/literal/textureStore/d19db4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/d19db4.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
void textureStore_d19db4() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl.expected.glsl
index 73efbc8..b9e8bca 100644
--- a/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_d73b5c() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/d82b0a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/d82b0a.wgsl.expected.glsl
index b0828d6..59e9fcd 100644
--- a/test/tint/builtins/gen/literal/textureStore/d82b0a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/d82b0a.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
void textureStore_d82b0a() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/dde364.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/dde364.wgsl.expected.glsl
index 5a5dbf5..0acd3b4 100644
--- a/test/tint/builtins/gen/literal/textureStore/dde364.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/dde364.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_dde364() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.glsl
index 66f7618..3f6fad4 100644
--- a/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/dfa9a1.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_dfa9a1() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.glsl
index 90e8381..0793869 100644
--- a/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/dffb13.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_dffb13() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/e077e7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/e077e7.wgsl.expected.glsl
index a23da5d..74bff8c 100644
--- a/test/tint/builtins/gen/literal/textureStore/e077e7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/e077e7.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_e077e7() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/ea30d2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/ea30d2.wgsl.expected.glsl
index 1832ec7..0d3834a 100644
--- a/test/tint/builtins/gen/literal/textureStore/ea30d2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/ea30d2.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_ea30d2() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl
new file mode 100644
index 0000000..c54cd63
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_3d<r8unorm, read_write>, coords: vec3<i32>, value: vec4<f32>)
+fn textureStore_ed6198() {
+ textureStore(arg_0, vec3<i32>(1i), vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_ed6198();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_ed6198();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_ed6198();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e6575ea
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_ed6198() {
+ arg_0[(1).xxx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_ed6198();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_ed6198();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_ed6198();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e6575ea
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_ed6198() {
+ arg_0[(1).xxx] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_ed6198();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_ed6198();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_ed6198();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.glsl
new file mode 100644
index 0000000..f45fdda
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_ed6198() {
+ imageStore(arg_0, ivec3(1), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_ed6198();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_ed6198() {
+ imageStore(arg_0, ivec3(1), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_ed6198();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_ed6198() {
+ imageStore(arg_0, ivec3(1), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_ed6198();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.msl
new file mode 100644
index 0000000..8d39702
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_ed6198(texture3d<float, access::read_write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint3(int3(1))); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read_write> tint_symbol_2) {
+ textureStore_ed6198(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_ed6198(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_ed6198(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.spvasm
new file mode 100644
index 0000000..9190b56
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.spvasm
@@ -0,0 +1,73 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_ed6198 "textureStore_ed6198"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %21 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+ %float_1 = OpConstant %float 1
+ %23 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %24 = OpTypeFunction %v4float
+%textureStore_ed6198 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ OpImageWrite %17 %21 %23
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureStore_ed6198
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureStore_ed6198
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_ed6198
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.wgsl
new file mode 100644
index 0000000..150245a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/ed6198.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read_write>;
+
+fn textureStore_ed6198() {
+ textureStore(arg_0, vec3<i32>(1i), vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_ed6198();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_ed6198();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_ed6198();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl.expected.glsl
index 000a6ec..e2ef12b 100644
--- a/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
void textureStore_ee6acc() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl
new file mode 100644
index 0000000..1d8dbb2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl
@@ -0,0 +1,59 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, write>, coords: vec2<u32>, array_index: u32, value: vec4<f32>)
+fn textureStore_f7b0ab() {
+ textureStore(arg_0, vec2<u32>(1u), 1u, vec4<f32>(1.f));
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_f7b0ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_f7b0ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_f7b0ab();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6dc72f9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.dxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_f7b0ab() {
+ arg_0[uint3((1u).xx, 1u)] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_f7b0ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_f7b0ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_f7b0ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6dc72f9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.fxc.hlsl
@@ -0,0 +1,32 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_f7b0ab() {
+ arg_0[uint3((1u).xx, 1u)] = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_f7b0ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_f7b0ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_f7b0ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.glsl
new file mode 100644
index 0000000..2c6b931
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.glsl
@@ -0,0 +1,76 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_f7b0ab() {
+ imageStore(arg_0, ivec3(uvec3(uvec2(1u), 1u)), vec4(1.0f));
+}
+
+vec4 vertex_main() {
+ textureStore_f7b0ab();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_f7b0ab() {
+ imageStore(arg_0, ivec3(uvec3(uvec2(1u), 1u)), vec4(1.0f));
+}
+
+void fragment_main() {
+ textureStore_f7b0ab();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_f7b0ab() {
+ imageStore(arg_0, ivec3(uvec3(uvec2(1u), 1u)), vec4(1.0f));
+}
+
+void compute_main() {
+ textureStore_f7b0ab();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.msl
new file mode 100644
index 0000000..39fee91
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_f7b0ab(texture2d_array<float, access::write> tint_symbol_1) {
+ tint_symbol_1.write(float4(1.0f), uint2(uint2(1u)), 1u);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_f7b0ab(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_f7b0ab(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_f7b0ab(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..aa612b8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_f7b0ab "textureStore_f7b0ab"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+ %float_1 = OpConstant %float 1
+ %27 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+ %28 = OpTypeFunction %v4float
+%textureStore_f7b0ab = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %11 %arg_0
+ %23 = OpCompositeExtract %uint %22 0
+ %24 = OpCompositeExtract %uint %22 1
+ %25 = OpCompositeConstruct %v3uint %23 %24 %uint_1
+ OpImageWrite %17 %25 %27
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_f7b0ab
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_f7b0ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_f7b0ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..dfd8972
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureStore/f7b0ab.wgsl.expected.wgsl
@@ -0,0 +1,23 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, write>;
+
+fn textureStore_f7b0ab() {
+ textureStore(arg_0, vec2<u32>(1u), 1u, vec4<f32>(1.0f));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_f7b0ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_f7b0ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_f7b0ab();
+}
diff --git a/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl.expected.glsl
index fc5848f..e9f5373 100644
--- a/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_f9be83() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/literal/textureStore/fcbe66.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureStore/fcbe66.wgsl.expected.glsl
index e56202f..b0e71d4 100644
--- a/test/tint/builtins/gen/literal/textureStore/fcbe66.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureStore/fcbe66.wgsl.expected.glsl
@@ -29,6 +29,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
void textureStore_fcbe66() {
@@ -44,8 +45,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl
new file mode 100644
index 0000000..f13d44a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read>;
+
+// fn textureDimensions(texture: texture_storage_3d<r8unorm, read>) -> vec3<u32>
+fn textureDimensions_00229f() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_00229f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_00229f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_00229f();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9819f9a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_00229f() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+ prevent_dce.Store3(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_00229f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_00229f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_00229f();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9819f9a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_00229f() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+ prevent_dce.Store3(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_00229f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_00229f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_00229f();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.glsl
new file mode 100644
index 0000000..8fa9903
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_00229f() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_00229f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_00229f() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_00229f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_00229f() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_00229f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.msl
new file mode 100644
index 0000000..0266662
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_00229f(texture3d<float, access::read> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+ *(tint_symbol_2) = packed_uint3(res);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+ textureDimensions_00229f(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_00229f(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_00229f(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.spvasm
new file mode 100644
index 0000000..eae0111
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_00229f "textureDimensions_00229f"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %25 = OpConstantNull %v3uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_00229f = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v3uint %22
+ OpStore %res %21
+ %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+ %29 = OpLoad %v3uint %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_00229f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_00229f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_00229f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.wgsl
new file mode 100644
index 0000000..d49f90c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00229f.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read>;
+
+fn textureDimensions_00229f() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_00229f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_00229f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_00229f();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/01e21e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/01e21e.wgsl.expected.glsl
index 5b0dc9a..bb83cc6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/01e21e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/01e21e.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/029589.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/029589.wgsl.expected.glsl
index 9f076b3..997a1c6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/029589.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/029589.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/08e371.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/08e371.wgsl.expected.glsl
index 172375f..f721462 100644
--- a/test/tint/builtins/gen/var/textureDimensions/08e371.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/08e371.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.glsl
index ad5988e..78fe881 100644
--- a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl
new file mode 100644
index 0000000..5ca7020
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read_write>;
+
+// fn textureDimensions(texture: texture_storage_2d<r8unorm, read_write>) -> vec2<u32>
+fn textureDimensions_18160d() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_18160d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_18160d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_18160d();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8d7086b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_18160d() {
+ uint2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_18160d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_18160d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_18160d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8d7086b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_18160d() {
+ uint2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_18160d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_18160d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_18160d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.glsl
new file mode 100644
index 0000000..6899921
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_18160d() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_18160d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_18160d() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_18160d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_18160d() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_18160d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.msl
new file mode 100644
index 0000000..642939b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_18160d(texture2d<float, access::read_write> tint_symbol_1, device uint2* const tint_symbol_2) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read_write> tint_symbol_3, device uint2* const tint_symbol_4) {
+ textureDimensions_18160d(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read_write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read_write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_18160d(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read_write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_18160d(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.spvasm
new file mode 100644
index 0000000..4039245
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.spvasm
@@ -0,0 +1,91 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_18160d "textureDimensions_18160d"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_18160d = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v2uint %22
+ OpStore %res %21
+ %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+ %29 = OpLoad %v2uint %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_18160d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_18160d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_18160d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.wgsl
new file mode 100644
index 0000000..fe96e98
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18160d.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read_write>;
+
+fn textureDimensions_18160d() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_18160d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_18160d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_18160d();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl
new file mode 100644
index 0000000..7f97102
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<r8unorm, write>) -> vec2<u32>
+fn textureDimensions_18f19f() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_18f19f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_18f19f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_18f19f();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..52a6582
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_18f19f() {
+ uint2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_18f19f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_18f19f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_18f19f();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..52a6582
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_18f19f() {
+ uint2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_18f19f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_18f19f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_18f19f();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.glsl
new file mode 100644
index 0000000..8ad231d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_18f19f() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_18f19f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_18f19f() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_18f19f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_18f19f() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_18f19f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.msl
new file mode 100644
index 0000000..f3d2074
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_18f19f(texture2d<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+ textureDimensions_18f19f(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_18f19f(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_18f19f(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.spvasm
new file mode 100644
index 0000000..a58c448
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_18f19f "textureDimensions_18f19f"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_18f19f = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v2uint %22
+ OpStore %res %21
+ %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+ %29 = OpLoad %v2uint %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_18f19f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_18f19f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_18f19f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.wgsl
new file mode 100644
index 0000000..7762b88
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/18f19f.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, write>;
+
+fn textureDimensions_18f19f() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_18f19f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_18f19f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_18f19f();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.glsl
index ee33487..3dffdb6 100644
--- a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl
new file mode 100644
index 0000000..41f985a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<r8unorm, write>) -> vec2<u32>
+fn textureDimensions_25d284() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_25d284();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_25d284();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_25d284();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2df33a6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_25d284() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_25d284();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_25d284();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_25d284();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2df33a6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_25d284() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_25d284();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_25d284();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_25d284();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.glsl
new file mode 100644
index 0000000..530a42f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_25d284() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_25d284();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_25d284() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_25d284();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_25d284() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_25d284();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.msl
new file mode 100644
index 0000000..0cc7abc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_25d284(texture2d_array<float, access::write> tint_symbol_1, device uint2* const tint_symbol_2) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint2* const tint_symbol_4) {
+ textureDimensions_25d284(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_25d284(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_25d284(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.spvasm
new file mode 100644
index 0000000..d7124af
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.spvasm
@@ -0,0 +1,94 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 46
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_25d284 "textureDimensions_25d284"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %27 = OpConstantNull %v2uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+ %32 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_25d284 = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %27
+ %24 = OpLoad %11 %arg_0
+ %22 = OpImageQuerySize %v3uint %24
+ %21 = OpVectorShuffle %v2uint %22 %22 0 1
+ OpStore %res %21
+ %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+ %31 = OpLoad %v2uint %res
+ OpStore %30 %31
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %32
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_25d284
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %37 = OpLabel
+ %38 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %38
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_25d284
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureDimensions_25d284
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.wgsl
new file mode 100644
index 0000000..1c8be5f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/25d284.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, write>;
+
+fn textureDimensions_25d284() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_25d284();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_25d284();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_25d284();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.glsl
index d6a9c6e..bd21c27 100644
--- a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/282978.wgsl b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl
new file mode 100644
index 0000000..9ef2e86
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read_write>;
+
+// fn textureDimensions(texture: texture_storage_3d<r8unorm, read_write>) -> vec3<u32>
+fn textureDimensions_282978() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_282978();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_282978();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_282978();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f664a39
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_282978() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+ prevent_dce.Store3(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_282978();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_282978();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_282978();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f664a39
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_282978() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+ prevent_dce.Store3(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_282978();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_282978();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_282978();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.glsl
new file mode 100644
index 0000000..5448d1d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_282978() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_282978();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_282978() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_282978();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_282978() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_282978();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.msl
new file mode 100644
index 0000000..3a2f5b8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_282978(texture3d<float, access::read_write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+ *(tint_symbol_2) = packed_uint3(res);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read_write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+ textureDimensions_282978(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read_write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read_write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_282978(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read_write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_282978(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.spvasm
new file mode 100644
index 0000000..58c52c3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.spvasm
@@ -0,0 +1,91 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_282978 "textureDimensions_282978"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %25 = OpConstantNull %v3uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_282978 = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v3uint %22
+ OpStore %res %21
+ %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+ %29 = OpLoad %v3uint %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_282978
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_282978
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_282978
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.wgsl
new file mode 100644
index 0000000..54b0c61
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/282978.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read_write>;
+
+fn textureDimensions_282978() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_282978();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_282978();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_282978();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/284c27.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/284c27.wgsl.expected.glsl
index ec40f11..9ffb020 100644
--- a/test/tint/builtins/gen/var/textureDimensions/284c27.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/284c27.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.glsl
index 33ed69b..468c8d7 100644
--- a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.glsl
index 14d4bb7..c0d15ec 100644
--- a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_35ee69() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_35ee69() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_35ee69() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.glsl
index 9427dfc..a8b0ae4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.glsl
index 1bf01e7..c649bbe 100644
--- a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl
new file mode 100644
index 0000000..dc1df71
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read>;
+
+// fn textureDimensions(texture: texture_storage_2d<r8unorm, read>) -> vec2<u32>
+fn textureDimensions_40da20() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_40da20();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_40da20();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_40da20();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4ec3a73
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_40da20() {
+ uint2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_40da20();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_40da20();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_40da20();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4ec3a73
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_40da20() {
+ uint2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_40da20();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_40da20();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_40da20();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.glsl
new file mode 100644
index 0000000..ae8a8360
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_40da20() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_40da20();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_40da20() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_40da20();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_40da20() {
+ uvec2 res = uvec2(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_40da20();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.msl
new file mode 100644
index 0000000..8af0da9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_40da20(texture2d<float, access::read> tint_symbol_1, device uint2* const tint_symbol_2) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read> tint_symbol_3, device uint2* const tint_symbol_4) {
+ textureDimensions_40da20(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_40da20(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_40da20(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.spvasm
new file mode 100644
index 0000000..faf1d61
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_40da20 "textureDimensions_40da20"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_40da20 = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v2uint %22
+ OpStore %res %21
+ %28 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+ %29 = OpLoad %v2uint %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_40da20
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_40da20
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_40da20
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.wgsl
new file mode 100644
index 0000000..81140cb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40da20.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read>;
+
+fn textureDimensions_40da20() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_40da20();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_40da20();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_40da20();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.glsl
index 36ea079..a762619 100644
--- a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.glsl
index 992ca3c..0c893b0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/4d1f71.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/4d1f71.wgsl.expected.glsl
index 09fb035..85348c2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4d1f71.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4d1f71.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/4df14c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/4df14c.wgsl.expected.glsl
index d1381c5..9956046 100644
--- a/test/tint/builtins/gen/var/textureDimensions/4df14c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/4df14c.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_4df14c() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_4df14c() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_4df14c() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/52cf60.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/52cf60.wgsl.expected.glsl
index 94150d5..69c3fc5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/52cf60.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/52cf60.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl
new file mode 100644
index 0000000..83438e3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<r8unorm, write>) -> u32
+fn textureDimensions_542c62() {
+ var res: u32 = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_542c62();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_542c62();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_542c62();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..162de9b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_542c62() {
+ uint tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_542c62();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_542c62();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_542c62();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..162de9b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_542c62() {
+ uint tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_542c62();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_542c62();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_542c62();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.glsl
new file mode 100644
index 0000000..e436c5e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_542c62() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_542c62();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_542c62() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_542c62();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_542c62() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_542c62();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.msl
new file mode 100644
index 0000000..c21ad73
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_542c62(texture1d<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
+ uint res = tint_symbol_1.get_width(0);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+ textureDimensions_542c62(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_542c62(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_542c62(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.spvasm
new file mode 100644
index 0000000..3b62495
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_542c62 "textureDimensions_542c62"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_542c62 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %uint %21
+ OpStore %res %20
+ %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+ %28 = OpLoad %uint %res
+ OpStore %27 %28
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_542c62
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_542c62
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_542c62
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.wgsl
new file mode 100644
index 0000000..bd3741d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/542c62.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, write>;
+
+fn textureDimensions_542c62() {
+ var res : u32 = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_542c62();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_542c62();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_542c62();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl
new file mode 100644
index 0000000..50ab98d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<r8unorm, read_write>) -> vec2<u32>
+fn textureDimensions_578e75() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_578e75();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_578e75();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_578e75();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..81df8a2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_578e75() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_578e75();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_578e75();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_578e75();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..81df8a2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_578e75() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_578e75();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_578e75();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_578e75();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.glsl
new file mode 100644
index 0000000..45c3096
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_578e75() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_578e75();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_578e75() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_578e75();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_578e75() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_578e75();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.msl
new file mode 100644
index 0000000..12ac6de
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_578e75(texture2d_array<float, access::read_write> tint_symbol_1, device uint2* const tint_symbol_2) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_3, device uint2* const tint_symbol_4) {
+ textureDimensions_578e75(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_578e75(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_578e75(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.spvasm
new file mode 100644
index 0000000..426a01e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.spvasm
@@ -0,0 +1,93 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 46
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_578e75 "textureDimensions_578e75"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %27 = OpConstantNull %v2uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+ %32 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_578e75 = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %27
+ %24 = OpLoad %11 %arg_0
+ %22 = OpImageQuerySize %v3uint %24
+ %21 = OpVectorShuffle %v2uint %22 %22 0 1
+ OpStore %res %21
+ %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+ %31 = OpLoad %v2uint %res
+ OpStore %30 %31
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %32
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_578e75
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %37 = OpLabel
+ %38 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %38
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_578e75
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureDimensions_578e75
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.wgsl
new file mode 100644
index 0000000..f0a4f7b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/578e75.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureDimensions_578e75() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_578e75();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_578e75();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_578e75();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6dae40.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/6dae40.wgsl.expected.glsl
index 05b4395..8815615 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6dae40.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/6dae40.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32f) uniform highp readonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_6dae40() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_6dae40() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32f) uniform highp readonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_6dae40() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/6dbef4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/6dbef4.wgsl.expected.glsl
index e47086f..1ee6bbb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/6dbef4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/6dbef4.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32i) uniform highp readonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_6dbef4() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_6dbef4() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32i) uniform highp readonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_6dbef4() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/740e7c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/740e7c.wgsl.expected.glsl
index 935af5f..83e274d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/740e7c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/740e7c.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/7c7c64.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/7c7c64.wgsl.expected.glsl
index c460d46..917fe4e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7c7c64.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7c7c64.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/7d8439.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/7d8439.wgsl.expected.glsl
index dc720ac..9af6882 100644
--- a/test/tint/builtins/gen/var/textureDimensions/7d8439.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/7d8439.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/835f90.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/835f90.wgsl.expected.glsl
index f036e74..00ddd2c 100644
--- a/test/tint/builtins/gen/var/textureDimensions/835f90.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/835f90.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.glsl
index a5aa090..7b5f46b 100644
--- a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.glsl
index 32a82ca..87202cb 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl
new file mode 100644
index 0000000..b1d858b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<r8unorm, read>) -> vec2<u32>
+fn textureDimensions_8af728() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_8af728();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_8af728();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_8af728();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a057749
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_8af728() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_8af728();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_8af728();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8af728();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a057749
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_8af728() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+ prevent_dce.Store2(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_8af728();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_8af728();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8af728();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.glsl
new file mode 100644
index 0000000..07cf06e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_8af728() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_8af728();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_8af728() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_8af728();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec2 inner;
+} prevent_dce;
+
+void textureDimensions_8af728() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_8af728();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.msl
new file mode 100644
index 0000000..da4be3e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8af728(texture2d_array<float, access::read> tint_symbol_1, device uint2* const tint_symbol_2) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read> tint_symbol_3, device uint2* const tint_symbol_4) {
+ textureDimensions_8af728(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read> tint_symbol_5 [[texture(0)]], device uint2* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read> tint_symbol_7 [[texture(0)]], device uint2* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_8af728(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read> tint_symbol_9 [[texture(0)]], device uint2* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_8af728(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.spvasm
new file mode 100644
index 0000000..9864468
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.spvasm
@@ -0,0 +1,94 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 46
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_8af728 "textureDimensions_8af728"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%prevent_dce_block = OpTypeStruct %v2uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %27 = OpConstantNull %v2uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v2uint = OpTypePointer StorageBuffer %v2uint
+ %32 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_8af728 = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %27
+ %24 = OpLoad %11 %arg_0
+ %22 = OpImageQuerySize %v3uint %24
+ %21 = OpVectorShuffle %v2uint %22 %22 0 1
+ OpStore %res %21
+ %30 = OpAccessChain %_ptr_StorageBuffer_v2uint %prevent_dce %uint_0
+ %31 = OpLoad %v2uint %res
+ OpStore %30 %31
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %32
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_8af728
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %37 = OpLabel
+ %38 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %38
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_8af728
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureDimensions_8af728
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.wgsl
new file mode 100644
index 0000000..a4213da
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8af728.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read>;
+
+fn textureDimensions_8af728() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec2<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_8af728();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_8af728();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_8af728();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8e15f4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/8e15f4.wgsl.expected.glsl
index 974eb81..bfebfb4 100644
--- a/test/tint/builtins/gen/var/textureDimensions/8e15f4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/8e15f4.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/91e3b4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/91e3b4.wgsl.expected.glsl
index 49f6194..071973d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/91e3b4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/91e3b4.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_91e3b4() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_91e3b4() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_91e3b4() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.glsl
index 316b9cf..21fdf97 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.glsl
index 025b3a0..3701429 100644
--- a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.glsl
index 6d3fab6..d2c96d0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_9cd8ad() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_9cd8ad() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_9cd8ad() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/9dc27a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9dc27a.wgsl.expected.glsl
index aba26f7..aa32982 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9dc27a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9dc27a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.glsl
index ac48298..7b65160 100644
--- a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.glsl
index 600acff..f572dc0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl
new file mode 100644
index 0000000..f59767e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<r8unorm, write>) -> vec3<u32>
+fn textureDimensions_a20ba2() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a20ba2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a20ba2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a20ba2();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..205a438
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_a20ba2() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+ prevent_dce.Store3(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a20ba2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a20ba2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a20ba2();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..205a438
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_a20ba2() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+ prevent_dce.Store3(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a20ba2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a20ba2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a20ba2();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.glsl
new file mode 100644
index 0000000..414da05
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_a20ba2() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_a20ba2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_a20ba2() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_a20ba2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uvec3 inner;
+ uint pad;
+} prevent_dce;
+
+void textureDimensions_a20ba2() {
+ uvec3 res = uvec3(imageSize(arg_0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_a20ba2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.msl
new file mode 100644
index 0000000..87cfc47
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a20ba2(texture3d<float, access::write> tint_symbol_1, device packed_uint3* const tint_symbol_2) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+ *(tint_symbol_2) = packed_uint3(res);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_3, device packed_uint3* const tint_symbol_4) {
+ textureDimensions_a20ba2(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]], device packed_uint3* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_7 [[texture(0)]], device packed_uint3* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_a20ba2(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_9 [[texture(0)]], device packed_uint3* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_a20ba2(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.spvasm
new file mode 100644
index 0000000..cddc7bd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_a20ba2 "textureDimensions_a20ba2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%prevent_dce_block = OpTypeStruct %v3uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %17 = OpTypeFunction %void
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %25 = OpConstantNull %v3uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v3uint = OpTypePointer StorageBuffer %v3uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_a20ba2 = OpFunction %void None %17
+ %20 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v3uint %22
+ OpStore %res %21
+ %28 = OpAccessChain %_ptr_StorageBuffer_v3uint %prevent_dce %uint_0
+ %29 = OpLoad %v3uint %res
+ OpStore %28 %29
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_a20ba2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %17
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %17
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_a20ba2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %17
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_a20ba2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.wgsl
new file mode 100644
index 0000000..e5b4bb5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a20ba2.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, write>;
+
+fn textureDimensions_a20ba2() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec3<u32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a20ba2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a20ba2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a20ba2();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ae4595.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/ae4595.wgsl.expected.glsl
index 7939a5b..4a9b48a 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ae4595.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ae4595.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_ae4595() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_ae4595() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_ae4595() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.glsl
index c9de38d..65a6963 100644
--- a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.glsl
index 4380359..a2239d0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.glsl
index 276a14d..2d351f2 100644
--- a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.glsl
index 6a5d7ed..e7d8827 100644
--- a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl
new file mode 100644
index 0000000..d1ba650
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read_write>;
+
+// fn textureDimensions(texture: texture_storage_1d<r8unorm, read_write>) -> u32
+fn textureDimensions_c6b985() {
+ var res: u32 = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c6b985();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c6b985();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c6b985();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..753cf17
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_c6b985() {
+ uint tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c6b985();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c6b985();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c6b985();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..753cf17
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_c6b985() {
+ uint tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c6b985();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c6b985();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c6b985();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.glsl
new file mode 100644
index 0000000..8c574c9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_c6b985() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_c6b985();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_c6b985() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_c6b985();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_c6b985() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_c6b985();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.msl
new file mode 100644
index 0000000..b0a6fb9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c6b985(texture1d<float, access::read_write> tint_symbol_1, device uint* const tint_symbol_2) {
+ uint res = tint_symbol_1.get_width(0);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read_write> tint_symbol_3, device uint* const tint_symbol_4) {
+ textureDimensions_c6b985(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read_write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read_write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_c6b985(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read_write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_c6b985(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.spvasm
new file mode 100644
index 0000000..3de8c99
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.spvasm
@@ -0,0 +1,91 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_c6b985 "textureDimensions_c6b985"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_c6b985 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %uint %21
+ OpStore %res %20
+ %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+ %28 = OpLoad %uint %res
+ OpStore %27 %28
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_c6b985
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_c6b985
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_c6b985
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.wgsl
new file mode 100644
index 0000000..5c45f89
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c6b985.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read_write>;
+
+fn textureDimensions_c6b985() {
+ var res : u32 = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c6b985();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c6b985();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c6b985();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c7ea63.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c7ea63.wgsl.expected.glsl
index e52b162..a0e13a8 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c7ea63.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c7ea63.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/c82420.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c82420.wgsl.expected.glsl
index 67ad2a7..7330a10 100644
--- a/test/tint/builtins/gen/var/textureDimensions/c82420.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/c82420.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/cd3033.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cd3033.wgsl.expected.glsl
index c4cbb76..d80d06f 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cd3033.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cd3033.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/cedabd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cedabd.wgsl.expected.glsl
index 5c381de..660ac58 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cedabd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cedabd.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.glsl
index 1c83296..43460f5 100644
--- a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/d0778e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d0778e.wgsl.expected.glsl
index cdab91a..231c1ff 100644
--- a/test/tint/builtins/gen/var/textureDimensions/d0778e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/d0778e.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32ui) uniform highp readonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_d0778e() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_d0778e() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32ui) uniform highp readonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_d0778e() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.glsl
index bccffc1..4af55e0 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.glsl
@@ -5,6 +5,7 @@
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_e738f4() {
@@ -34,10 +35,12 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_e738f4() {
@@ -54,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -65,6 +68,7 @@
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uvec3 inner;
+ uint pad;
} prevent_dce;
void textureDimensions_e738f4() {
diff --git a/test/tint/builtins/gen/var/textureDimensions/e824b6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e824b6.wgsl.expected.glsl
index 58ba0a9..cf97acc 100644
--- a/test/tint/builtins/gen/var/textureDimensions/e824b6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/e824b6.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.glsl
index 2103274..51b9660 100644
--- a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.glsl
index aa05eec..309208d 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/f94e55.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f94e55.wgsl.expected.glsl
index cf15ef3..fc0773e 100644
--- a/test/tint/builtins/gen/var/textureDimensions/f94e55.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureDimensions/f94e55.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl
new file mode 100644
index 0000000..c94b03f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read>;
+
+// fn textureDimensions(texture: texture_storage_1d<r8unorm, read>) -> u32
+fn textureDimensions_fdbae8() {
+ var res: u32 = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_fdbae8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_fdbae8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_fdbae8();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2bdaafe
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_fdbae8() {
+ uint tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_fdbae8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_fdbae8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_fdbae8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2bdaafe
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureDimensions_fdbae8() {
+ uint tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_fdbae8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_fdbae8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_fdbae8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.glsl
new file mode 100644
index 0000000..190fbcc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_fdbae8() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureDimensions_fdbae8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_fdbae8() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureDimensions_fdbae8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureDimensions_fdbae8() {
+ uint res = uvec2(imageSize(arg_0)).x;
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureDimensions_fdbae8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.msl
new file mode 100644
index 0000000..5bbf3e2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_fdbae8(texture1d<float, access::read> tint_symbol_1, device uint* const tint_symbol_2) {
+ uint res = tint_symbol_1.get_width(0);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read> tint_symbol_3, device uint* const tint_symbol_4) {
+ textureDimensions_fdbae8(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+ textureDimensions_fdbae8(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+ textureDimensions_fdbae8(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.spvasm
new file mode 100644
index 0000000..ab89525
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureDimensions_fdbae8 "textureDimensions_fdbae8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_fdbae8 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %uint %21
+ OpStore %res %20
+ %27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+ %28 = OpLoad %uint %res
+ OpStore %27 %28
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_fdbae8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_fdbae8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_fdbae8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.wgsl
new file mode 100644
index 0000000..81d4d5b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdbae8.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read>;
+
+fn textureDimensions_fdbae8() {
+ var res : u32 = textureDimensions(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_fdbae8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_fdbae8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_fdbae8();
+}
diff --git a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.glsl
index 2f1271f..df32d65 100644
--- a/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/04fa78.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_1_arg_2;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.glsl
index 39f3f3d..9d8cd55 100644
--- a/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/43025d.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.glsl
index 4d34e35..a1e83d5 100644
--- a/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/751f8a.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_1_arg_2;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.glsl
index 92d1281..9805833 100644
--- a/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/788010.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_1_arg_2;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.glsl
index 09984e4..0fd6558 100644
--- a/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/7dd226.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.glsl
index 19d67207..39071df 100644
--- a/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/829357.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_1_arg_2;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.glsl
index dd2b55c..2df2832 100644
--- a/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/8578bc.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_1_arg_2;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.glsl
index eff89db..638ab12 100644
--- a/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/aaf6bd.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_1_arg_2;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.glsl
index b6f2b4c..c98b29f 100644
--- a/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/be276f.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_1_arg_2;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.glsl
index 1c0f215..c119cad 100644
--- a/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/c0640c.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_1_arg_2;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.glsl
index 3b91be9..07747b1 100644
--- a/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/d4b5c6.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_1_arg_2;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.glsl
index 4c54a69..61eacaf 100644
--- a/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/d98d59.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_1_arg_2;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.glsl
index 674d9af..d1f667c 100644
--- a/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/e2acac.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_1_arg_2;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.glsl
index 50618a9..ab43427 100644
--- a/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGather/f2c6e3.wgsl.expected.glsl
@@ -37,6 +37,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_1_arg_2;
@@ -60,8 +61,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.glsl
index 6815525..c79e929 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/2e409c.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.glsl
index c63eea8..607dcf8 100644
--- a/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureGatherCompare/60d2d1.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/012e11.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/012e11.wgsl.expected.glsl
index 10f87fa..95d7759 100644
--- a/test/tint/builtins/gen/var/textureLoad/012e11.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/012e11.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/02c48d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/02c48d.wgsl.expected.glsl
index 12b069c..dd83b1b 100644
--- a/test/tint/builtins/gen/var/textureLoad/02c48d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/02c48d.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/03e03e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/03e03e.wgsl.expected.glsl
index f614dbf..a25e5ba 100644
--- a/test/tint/builtins/gen/var/textureLoad/03e03e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/03e03e.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/050c33.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/050c33.wgsl.expected.glsl
index 5979397..1211007 100644
--- a/test/tint/builtins/gen/var/textureLoad/050c33.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/050c33.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/054350.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/054350.wgsl.expected.glsl
index cc5ab0f..c09bd6b 100644
--- a/test/tint/builtins/gen/var/textureLoad/054350.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/054350.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/0b515a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/0b515a.wgsl.expected.glsl
index a548ce6..c79d792 100644
--- a/test/tint/builtins/gen/var/textureLoad/0b515a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/0b515a.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/126466.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/126466.wgsl.expected.glsl
index 279234b..6dd4988 100644
--- a/test/tint/builtins/gen/var/textureLoad/126466.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/126466.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/143d84.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/143d84.wgsl.expected.glsl
index 57d2750..0b2490b 100644
--- a/test/tint/builtins/gen/var/textureLoad/143d84.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/143d84.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/14cc4c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/14cc4c.wgsl.expected.glsl
index b5d94dc..9b41268 100644
--- a/test/tint/builtins/gen/var/textureLoad/14cc4c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/14cc4c.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/170593.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/170593.wgsl.expected.glsl
index 8a48741..b2132ba 100644
--- a/test/tint/builtins/gen/var/textureLoad/170593.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/170593.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/17095b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/17095b.wgsl.expected.glsl
index 971051d..087f134 100644
--- a/test/tint/builtins/gen/var/textureLoad/17095b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/17095b.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/18ac11.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/18ac11.wgsl.expected.glsl
index 45abfd6..0e7f6da 100644
--- a/test/tint/builtins/gen/var/textureLoad/18ac11.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/18ac11.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl
new file mode 100644
index 0000000..ef1597e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl
@@ -0,0 +1,64 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read>, coords: vec2<i32>, array_index: u32) -> vec4<f32>
+fn textureLoad_19e5ca() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1u;
+ var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_19e5ca();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_19e5ca();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_19e5ca();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6a9aca2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_19e5ca() {
+ int2 arg_1 = (1).xx;
+ uint arg_2 = 1u;
+ float4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_19e5ca();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_19e5ca();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_19e5ca();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6a9aca2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_19e5ca() {
+ int2 arg_1 = (1).xx;
+ uint arg_2 = 1u;
+ float4 res = arg_0.Load(int4(int3(arg_1, int(arg_2)), 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_19e5ca();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_19e5ca();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_19e5ca();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.glsl
new file mode 100644
index 0000000..b7bdf91
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.glsl
@@ -0,0 +1,97 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_19e5ca() {
+ ivec2 arg_1 = ivec2(1);
+ uint arg_2 = 1u;
+ vec4 res = imageLoad(arg_0, ivec3(arg_1, int(arg_2)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_19e5ca();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_19e5ca() {
+ ivec2 arg_1 = ivec2(1);
+ uint arg_2 = 1u;
+ vec4 res = imageLoad(arg_0, ivec3(arg_1, int(arg_2)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_19e5ca();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_19e5ca() {
+ ivec2 arg_1 = ivec2(1);
+ uint arg_2 = 1u;
+ vec4 res = imageLoad(arg_0, ivec3(arg_1, int(arg_2)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_19e5ca();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.msl
new file mode 100644
index 0000000..886df4b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_19e5ca(texture2d_array<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ int2 arg_1 = int2(1);
+ uint arg_2 = 1u;
+ float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_19e5ca(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_19e5ca(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_19e5ca(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.spvasm
new file mode 100644
index 0000000..62b3533
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.spvasm
@@ -0,0 +1,111 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 60
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_19e5ca "textureLoad_19e5ca"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %22 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %25 = OpConstantNull %v2int
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %30 = OpConstantNull %uint
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %46 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_19e5ca = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+ %arg_2 = OpVariable %_ptr_Function_uint Function %30
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ OpStore %arg_2 %uint_1
+ %32 = OpLoad %11 %arg_0
+ %34 = OpLoad %v2int %arg_1
+ %35 = OpCompositeExtract %int %34 0
+ %36 = OpCompositeExtract %int %34 1
+ %38 = OpLoad %uint %arg_2
+ %37 = OpBitcast %int %38
+ %39 = OpCompositeConstruct %v3int %35 %36 %37
+ %31 = OpImageRead %v4float %32 %39
+ OpStore %res %31
+ %44 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %45 = OpLoad %v4float %res
+ OpStore %44 %45
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %46
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureLoad_19e5ca
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %51 = OpLabel
+ %52 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %52
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %55 = OpLabel
+ %56 = OpFunctionCall %void %textureLoad_19e5ca
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %58 = OpLabel
+ %59 = OpFunctionCall %void %textureLoad_19e5ca
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.wgsl
new file mode 100644
index 0000000..58da9b6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/19e5ca.wgsl.expected.wgsl
@@ -0,0 +1,28 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read>;
+
+fn textureLoad_19e5ca() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1u;
+ var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_19e5ca();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_19e5ca();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_19e5ca();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/1bc5ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1bc5ab.wgsl.expected.glsl
index ecbd5a4..3ff7c1e 100644
--- a/test/tint/builtins/gen/var/textureLoad/1bc5ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1bc5ab.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/1d43ae.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1d43ae.wgsl.expected.glsl
index 51111f5..d63996f 100644
--- a/test/tint/builtins/gen/var/textureLoad/1d43ae.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1d43ae.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/1e6baa.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1e6baa.wgsl.expected.glsl
index 8517e72..c712063 100644
--- a/test/tint/builtins/gen/var/textureLoad/1e6baa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1e6baa.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/1eb93f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1eb93f.wgsl.expected.glsl
index ea500a7..96cfeb6 100644
--- a/test/tint/builtins/gen/var/textureLoad/1eb93f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1eb93f.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl
new file mode 100644
index 0000000..f80ba53
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl
@@ -0,0 +1,63 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_3d<r8unorm, read_write>, coords: vec3<u32>) -> vec4<f32>
+fn textureLoad_1fde63() {
+ var arg_1 = vec3<u32>(1u);
+ var res: vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_1fde63();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_1fde63();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_1fde63();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..86f7353
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_1fde63() {
+ uint3 arg_1 = (1u).xxx;
+ float4 res = arg_0.Load(arg_1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_1fde63();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_1fde63();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_1fde63();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..86f7353
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_1fde63() {
+ uint3 arg_1 = (1u).xxx;
+ float4 res = arg_0.Load(arg_1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_1fde63();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_1fde63();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_1fde63();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.glsl
new file mode 100644
index 0000000..71d72d8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_1fde63() {
+ uvec3 arg_1 = uvec3(1u);
+ vec4 res = imageLoad(arg_0, ivec3(arg_1));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_1fde63();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_1fde63() {
+ uvec3 arg_1 = uvec3(1u);
+ vec4 res = imageLoad(arg_0, ivec3(arg_1));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_1fde63();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_1fde63() {
+ uvec3 arg_1 = uvec3(1u);
+ vec4 res = imageLoad(arg_0, ivec3(arg_1));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_1fde63();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.msl
new file mode 100644
index 0000000..e4488f9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_1fde63(texture3d<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ uint3 arg_1 = uint3(1u);
+ float4 res = tint_symbol_1.read(uint3(arg_1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_1fde63(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_1fde63(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_1fde63(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.spvasm
new file mode 100644
index 0000000..e6c6d7a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.spvasm
@@ -0,0 +1,97 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 49
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_1fde63 "textureLoad_1fde63"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+ %22 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %25 = OpConstantNull %v3uint
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %35 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_1fde63 = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3uint Function %25
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ %27 = OpLoad %11 %arg_0
+ %28 = OpLoad %v3uint %arg_1
+ %26 = OpImageRead %v4float %27 %28
+ OpStore %res %26
+ %33 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %34 = OpLoad %v4float %res
+ OpStore %33 %34
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %35
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_1fde63
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %40 = OpLabel
+ %41 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %41
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureLoad_1fde63
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureLoad_1fde63
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.wgsl
new file mode 100644
index 0000000..b2be9e4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/1fde63.wgsl.expected.wgsl
@@ -0,0 +1,27 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read_write>;
+
+fn textureLoad_1fde63() {
+ var arg_1 = vec3<u32>(1u);
+ var res : vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_1fde63();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_1fde63();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_1fde63();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/20fa2f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/20fa2f.wgsl.expected.glsl
index 910916d..540ad08 100644
--- a/test/tint/builtins/gen/var/textureLoad/20fa2f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/20fa2f.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/23007a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/23007a.wgsl.expected.glsl
index c859a5c..b152175 100644
--- a/test/tint/builtins/gen/var/textureLoad/23007a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/23007a.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/25b67f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/25b67f.wgsl.expected.glsl
index cdb560e..fcaa2af 100644
--- a/test/tint/builtins/gen/var/textureLoad/25b67f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/25b67f.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/26b8f6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/26b8f6.wgsl.expected.glsl
index 3aa5e0f..821c8ec 100644
--- a/test/tint/builtins/gen/var/textureLoad/26b8f6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/26b8f6.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/26d7f1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/26d7f1.wgsl.expected.glsl
index 1463458..aa37db8 100644
--- a/test/tint/builtins/gen/var/textureLoad/26d7f1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/26d7f1.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/276643.wgsl b/test/tint/builtins/gen/var/textureLoad/276643.wgsl
new file mode 100644
index 0000000..c4a0fd5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/276643.wgsl
@@ -0,0 +1,63 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_1d<r8unorm, read>, coords: u32) -> vec4<f32>
+fn textureLoad_276643() {
+ var arg_1 = 1u;
+ var res: vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_276643();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_276643();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_276643();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0c3ee2e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_276643() {
+ uint arg_1 = 1u;
+ float4 res = arg_0.Load(uint2(arg_1, uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_276643();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_276643();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_276643();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0c3ee2e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_276643() {
+ uint arg_1 = 1u;
+ float4 res = arg_0.Load(uint2(arg_1, uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_276643();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_276643();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_276643();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.glsl
new file mode 100644
index 0000000..57444e4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_276643() {
+ uint arg_1 = 1u;
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(arg_1, 0u)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_276643();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_276643() {
+ uint arg_1 = 1u;
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(arg_1, 0u)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_276643();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_276643() {
+ uint arg_1 = 1u;
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(arg_1, 0u)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_276643();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.msl
new file mode 100644
index 0000000..d402c6d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_276643(texture1d<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ uint arg_1 = 1u;
+ float4 res = tint_symbol_1.read(uint(arg_1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_276643(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_276643(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_276643(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.spvasm
new file mode 100644
index 0000000..43d887d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.spvasm
@@ -0,0 +1,97 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 47
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_276643 "textureLoad_276643"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %33 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_276643 = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %23
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %uint_1
+ %25 = OpLoad %11 %arg_0
+ %26 = OpLoad %uint %arg_1
+ %24 = OpImageRead %v4float %25 %26
+ OpStore %res %24
+ %31 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %32 = OpLoad %v4float %res
+ OpStore %31 %32
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %33
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_276643
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %38 = OpLabel
+ %39 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %39
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureLoad_276643
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureLoad_276643
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.wgsl
new file mode 100644
index 0000000..56cd759
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/276643.wgsl.expected.wgsl
@@ -0,0 +1,27 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read>;
+
+fn textureLoad_276643() {
+ var arg_1 = 1u;
+ var res : vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_276643();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_276643();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_276643();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/2cee30.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/2cee30.wgsl.expected.glsl
index 1257196..ec8ab67 100644
--- a/test/tint/builtins/gen/var/textureLoad/2cee30.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/2cee30.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/2d6cf7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/2d6cf7.wgsl.expected.glsl
index 48fcb88..494602d 100644
--- a/test/tint/builtins/gen/var/textureLoad/2d6cf7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/2d6cf7.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/2dbfc2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/2dbfc2.wgsl.expected.glsl
index a757dd0..d10e3ab 100644
--- a/test/tint/builtins/gen/var/textureLoad/2dbfc2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/2dbfc2.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/2eaf31.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/2eaf31.wgsl.expected.glsl
index e28c1ed..7cc33a0 100644
--- a/test/tint/builtins/gen/var/textureLoad/2eaf31.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/2eaf31.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/32a7b8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/32a7b8.wgsl.expected.glsl
index b0cd96a..2da1f40 100644
--- a/test/tint/builtins/gen/var/textureLoad/32a7b8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/32a7b8.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/34d97c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/34d97c.wgsl.expected.glsl
index a660294..a2fd7ec 100644
--- a/test/tint/builtins/gen/var/textureLoad/34d97c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/34d97c.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl
new file mode 100644
index 0000000..4c92f36
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl
@@ -0,0 +1,63 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_1d<r8unorm, read_write>, coords: i32) -> vec4<f32>
+fn textureLoad_35a5e2() {
+ var arg_1 = 1i;
+ var res: vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_35a5e2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_35a5e2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_35a5e2();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..412d591
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_35a5e2() {
+ int arg_1 = 1;
+ float4 res = arg_0.Load(arg_1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_35a5e2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_35a5e2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_35a5e2();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..412d591
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_35a5e2() {
+ int arg_1 = 1;
+ float4 res = arg_0.Load(arg_1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_35a5e2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_35a5e2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_35a5e2();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.glsl
new file mode 100644
index 0000000..1677eb6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_35a5e2() {
+ int arg_1 = 1;
+ vec4 res = imageLoad(arg_0, ivec2(arg_1, 0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_35a5e2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_35a5e2() {
+ int arg_1 = 1;
+ vec4 res = imageLoad(arg_0, ivec2(arg_1, 0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_35a5e2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_35a5e2() {
+ int arg_1 = 1;
+ vec4 res = imageLoad(arg_0, ivec2(arg_1, 0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_35a5e2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.msl
new file mode 100644
index 0000000..c7b6d84
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_35a5e2(texture1d<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ int arg_1 = 1;
+ float4 res = tint_symbol_1.read(uint(arg_1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_35a5e2(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_35a5e2(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_35a5e2(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.spvasm
new file mode 100644
index 0000000..f68d7e6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.spvasm
@@ -0,0 +1,97 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 48
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_35a5e2 "textureLoad_35a5e2"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %23 = OpConstantNull %int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %34 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_35a5e2 = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %23
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %int_1
+ %25 = OpLoad %11 %arg_0
+ %26 = OpLoad %int %arg_1
+ %24 = OpImageRead %v4float %25 %26
+ OpStore %res %24
+ %32 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %33 = OpLoad %v4float %res
+ OpStore %32 %33
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %34
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_35a5e2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %39 = OpLabel
+ %40 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %40
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureLoad_35a5e2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %46 = OpLabel
+ %47 = OpFunctionCall %void %textureLoad_35a5e2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.wgsl
new file mode 100644
index 0000000..52dd4e5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35a5e2.wgsl.expected.wgsl
@@ -0,0 +1,27 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read_write>;
+
+fn textureLoad_35a5e2() {
+ var arg_1 = 1i;
+ var res : vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_35a5e2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_35a5e2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_35a5e2();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/35d464.wgsl b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl
new file mode 100644
index 0000000..82aac8f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl
@@ -0,0 +1,64 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read>, coords: vec2<i32>, array_index: i32) -> vec4<f32>
+fn textureLoad_35d464() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1i;
+ var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_35d464();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_35d464();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_35d464();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..25391a0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_35d464() {
+ int2 arg_1 = (1).xx;
+ int arg_2 = 1;
+ float4 res = arg_0.Load(int4(int3(arg_1, arg_2), 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_35d464();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_35d464();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_35d464();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..25391a0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_35d464() {
+ int2 arg_1 = (1).xx;
+ int arg_2 = 1;
+ float4 res = arg_0.Load(int4(int3(arg_1, arg_2), 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_35d464();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_35d464();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_35d464();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.glsl
new file mode 100644
index 0000000..413a57e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.glsl
@@ -0,0 +1,97 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_35d464() {
+ ivec2 arg_1 = ivec2(1);
+ int arg_2 = 1;
+ vec4 res = imageLoad(arg_0, ivec3(arg_1, arg_2));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_35d464();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_35d464() {
+ ivec2 arg_1 = ivec2(1);
+ int arg_2 = 1;
+ vec4 res = imageLoad(arg_0, ivec3(arg_1, arg_2));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_35d464();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_35d464() {
+ ivec2 arg_1 = ivec2(1);
+ int arg_2 = 1;
+ vec4 res = imageLoad(arg_0, ivec3(arg_1, arg_2));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_35d464();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.msl
new file mode 100644
index 0000000..781e234
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_35d464(texture2d_array<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ int2 arg_1 = int2(1);
+ int arg_2 = 1;
+ float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_35d464(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_35d464(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_35d464(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.spvasm
new file mode 100644
index 0000000..c91e74b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.spvasm
@@ -0,0 +1,109 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 58
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_35d464 "textureLoad_35d464"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %22 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %25 = OpConstantNull %v2int
+%_ptr_Function_int = OpTypePointer Function %int
+ %28 = OpConstantNull %int
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %44 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_35d464 = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+ %arg_2 = OpVariable %_ptr_Function_int Function %28
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ OpStore %arg_2 %int_1
+ %30 = OpLoad %11 %arg_0
+ %32 = OpLoad %v2int %arg_1
+ %33 = OpCompositeExtract %int %32 0
+ %34 = OpCompositeExtract %int %32 1
+ %35 = OpLoad %int %arg_2
+ %36 = OpCompositeConstruct %v3int %33 %34 %35
+ %29 = OpImageRead %v4float %30 %36
+ OpStore %res %29
+ %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %43 = OpLoad %v4float %res
+ OpStore %42 %43
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %44
+ %46 = OpLabel
+ %47 = OpFunctionCall %void %textureLoad_35d464
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %49 = OpLabel
+ %50 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %50
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %53 = OpLabel
+ %54 = OpFunctionCall %void %textureLoad_35d464
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %56 = OpLabel
+ %57 = OpFunctionCall %void %textureLoad_35d464
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.wgsl
new file mode 100644
index 0000000..dae4a0d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/35d464.wgsl.expected.wgsl
@@ -0,0 +1,28 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read>;
+
+fn textureLoad_35d464() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1i;
+ var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_35d464();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_35d464();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_35d464();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/39016c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/39016c.wgsl.expected.glsl
index d9aa4df..38ae78d 100644
--- a/test/tint/builtins/gen/var/textureLoad/39016c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/39016c.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/395447.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/395447.wgsl.expected.glsl
index 81fb228..2c8567f 100644
--- a/test/tint/builtins/gen/var/textureLoad/395447.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/395447.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/3a2350.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/3a2350.wgsl.expected.glsl
index b4ea874..64089ba 100644
--- a/test/tint/builtins/gen/var/textureLoad/3a2350.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/3a2350.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/3cfb9c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/3cfb9c.wgsl.expected.glsl
index 2f38615..0e34927 100644
--- a/test/tint/builtins/gen/var/textureLoad/3cfb9c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/3cfb9c.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl
new file mode 100644
index 0000000..96f5285
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl
@@ -0,0 +1,63 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_2d<r8unorm, read_write>, coords: vec2<i32>) -> vec4<f32>
+fn textureLoad_3e16a8() {
+ var arg_1 = vec2<i32>(1i);
+ var res: vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_3e16a8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_3e16a8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_3e16a8();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5e1004f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_3e16a8() {
+ int2 arg_1 = (1).xx;
+ float4 res = arg_0.Load(arg_1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_3e16a8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_3e16a8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3e16a8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5e1004f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_3e16a8() {
+ int2 arg_1 = (1).xx;
+ float4 res = arg_0.Load(arg_1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_3e16a8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_3e16a8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_3e16a8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.glsl
new file mode 100644
index 0000000..c0fdc5b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_3e16a8() {
+ ivec2 arg_1 = ivec2(1);
+ vec4 res = imageLoad(arg_0, arg_1);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_3e16a8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_3e16a8() {
+ ivec2 arg_1 = ivec2(1);
+ vec4 res = imageLoad(arg_0, arg_1);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_3e16a8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_3e16a8() {
+ ivec2 arg_1 = ivec2(1);
+ vec4 res = imageLoad(arg_0, arg_1);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_3e16a8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.msl
new file mode 100644
index 0000000..b51dd54
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_3e16a8(texture2d<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ int2 arg_1 = int2(1);
+ float4 res = tint_symbol_1.read(uint2(arg_1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_3e16a8(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_3e16a8(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_3e16a8(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.spvasm
new file mode 100644
index 0000000..18e81bf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.spvasm
@@ -0,0 +1,98 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 50
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_3e16a8 "textureLoad_3e16a8"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %22 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %25 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %36 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_3e16a8 = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ %27 = OpLoad %11 %arg_0
+ %28 = OpLoad %v2int %arg_1
+ %26 = OpImageRead %v4float %27 %28
+ OpStore %res %26
+ %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %35 = OpLoad %v4float %res
+ OpStore %34 %35
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_3e16a8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureLoad_3e16a8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureLoad_3e16a8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.wgsl
new file mode 100644
index 0000000..6422cfb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/3e16a8.wgsl.expected.wgsl
@@ -0,0 +1,27 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read_write>;
+
+fn textureLoad_3e16a8() {
+ var arg_1 = vec2<i32>(1i);
+ var res : vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_3e16a8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_3e16a8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_3e16a8();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/40ee8b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/40ee8b.wgsl.expected.glsl
index a01d2cf..26883a8 100644
--- a/test/tint/builtins/gen/var/textureLoad/40ee8b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/40ee8b.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/4212a1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/4212a1.wgsl.expected.glsl
index a8d1793..7e52398 100644
--- a/test/tint/builtins/gen/var/textureLoad/4212a1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/4212a1.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/424afd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/424afd.wgsl.expected.glsl
index 4a4f120..d68f32f 100644
--- a/test/tint/builtins/gen/var/textureLoad/424afd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/424afd.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/42a631.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/42a631.wgsl.expected.glsl
index 1764a82..f040c3a 100644
--- a/test/tint/builtins/gen/var/textureLoad/42a631.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/42a631.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/43cd86.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/43cd86.wgsl.expected.glsl
index f338a65..87fedf2 100644
--- a/test/tint/builtins/gen/var/textureLoad/43cd86.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/43cd86.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/44c826.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/44c826.wgsl.expected.glsl
index 26574ae..88d7bde 100644
--- a/test/tint/builtins/gen/var/textureLoad/44c826.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/44c826.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/4542ae.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/4542ae.wgsl.expected.glsl
index 8638eb8..a0dbda9 100644
--- a/test/tint/builtins/gen/var/textureLoad/4542ae.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/4542ae.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/469912.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/469912.wgsl.expected.glsl
index bd4b619..9972a5a 100644
--- a/test/tint/builtins/gen/var/textureLoad/469912.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/469912.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/473d3e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/473d3e.wgsl.expected.glsl
index 2203510..2dfa401 100644
--- a/test/tint/builtins/gen/var/textureLoad/473d3e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/473d3e.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/482627.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/482627.wgsl.expected.glsl
index 74c9944..79a6429 100644
--- a/test/tint/builtins/gen/var/textureLoad/482627.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/482627.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl
new file mode 100644
index 0000000..f94ef3e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl
@@ -0,0 +1,64 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read>, coords: vec2<u32>, array_index: i32) -> vec4<f32>
+fn textureLoad_4951bb() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1i;
+ var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_4951bb();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_4951bb();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_4951bb();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a44dd26
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_4951bb() {
+ uint2 arg_1 = (1u).xx;
+ int arg_2 = 1;
+ float4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_4951bb();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_4951bb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_4951bb();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a44dd26
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_4951bb() {
+ uint2 arg_1 = (1u).xx;
+ int arg_2 = 1;
+ float4 res = arg_0.Load(uint4(uint3(arg_1, uint(arg_2)), uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_4951bb();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_4951bb();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_4951bb();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.glsl
new file mode 100644
index 0000000..f41c485
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.glsl
@@ -0,0 +1,97 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_4951bb() {
+ uvec2 arg_1 = uvec2(1u);
+ int arg_2 = 1;
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(arg_1, uint(arg_2))));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_4951bb();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_4951bb() {
+ uvec2 arg_1 = uvec2(1u);
+ int arg_2 = 1;
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(arg_1, uint(arg_2))));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_4951bb();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_4951bb() {
+ uvec2 arg_1 = uvec2(1u);
+ int arg_2 = 1;
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(arg_1, uint(arg_2))));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_4951bb();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.msl
new file mode 100644
index 0000000..3a7f451
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_4951bb(texture2d_array<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ uint2 arg_1 = uint2(1u);
+ int arg_2 = 1;
+ float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_4951bb(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_4951bb(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_4951bb(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.spvasm
new file mode 100644
index 0000000..17e3617
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.spvasm
@@ -0,0 +1,111 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 60
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_4951bb "textureLoad_4951bb"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %30 = OpConstantNull %int
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %46 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_4951bb = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+ %arg_2 = OpVariable %_ptr_Function_int Function %30
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ OpStore %arg_2 %int_1
+ %32 = OpLoad %11 %arg_0
+ %34 = OpLoad %v2uint %arg_1
+ %35 = OpCompositeExtract %uint %34 0
+ %36 = OpCompositeExtract %uint %34 1
+ %38 = OpLoad %int %arg_2
+ %37 = OpBitcast %uint %38
+ %39 = OpCompositeConstruct %v3uint %35 %36 %37
+ %31 = OpImageRead %v4float %32 %39
+ OpStore %res %31
+ %44 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %45 = OpLoad %v4float %res
+ OpStore %44 %45
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %46
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureLoad_4951bb
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %51 = OpLabel
+ %52 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %52
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %55 = OpLabel
+ %56 = OpFunctionCall %void %textureLoad_4951bb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %58 = OpLabel
+ %59 = OpFunctionCall %void %textureLoad_4951bb
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.wgsl
new file mode 100644
index 0000000..a7b4171
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/4951bb.wgsl.expected.wgsl
@@ -0,0 +1,28 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read>;
+
+fn textureLoad_4951bb() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1i;
+ var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_4951bb();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_4951bb();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_4951bb();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/4a5c55.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/4a5c55.wgsl.expected.glsl
index 110e5f0..c8e76d9 100644
--- a/test/tint/builtins/gen/var/textureLoad/4a5c55.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/4a5c55.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/4c15b2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/4c15b2.wgsl.expected.glsl
index d40b0c1..c152d0c 100644
--- a/test/tint/builtins/gen/var/textureLoad/4c15b2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/4c15b2.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/4c1a1e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/4c1a1e.wgsl.expected.glsl
index ce8f401..64d4f6b 100644
--- a/test/tint/builtins/gen/var/textureLoad/4c1a1e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/4c1a1e.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/4ccf9a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/4ccf9a.wgsl.expected.glsl
index 065b236..6892fce 100644
--- a/test/tint/builtins/gen/var/textureLoad/4ccf9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/4ccf9a.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/4e2c5c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/4e2c5c.wgsl.expected.glsl
index 7bb864f..4f7e285 100644
--- a/test/tint/builtins/gen/var/textureLoad/4e2c5c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/4e2c5c.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/4f90bb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/4f90bb.wgsl.expected.glsl
index 9d1e4bd..df0caf7 100644
--- a/test/tint/builtins/gen/var/textureLoad/4f90bb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/4f90bb.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/5154e1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/5154e1.wgsl.expected.glsl
index 6981085..fa03673 100644
--- a/test/tint/builtins/gen/var/textureLoad/5154e1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/5154e1.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/53378a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/53378a.wgsl.expected.glsl
index 03c6f8c..b9aa1e5 100644
--- a/test/tint/builtins/gen/var/textureLoad/53378a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/53378a.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/53941c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/53941c.wgsl.expected.glsl
index 554fca1..850829a 100644
--- a/test/tint/builtins/gen/var/textureLoad/53941c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/53941c.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/54fb38.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/54fb38.wgsl.expected.glsl
index 25798ec..e3a05e5 100644
--- a/test/tint/builtins/gen/var/textureLoad/54fb38.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/54fb38.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/56a000.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/56a000.wgsl.expected.glsl
index 66ec17a..9fe699e 100644
--- a/test/tint/builtins/gen/var/textureLoad/56a000.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/56a000.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/5abbf2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/5abbf2.wgsl.expected.glsl
index 3897a3d..a728394 100644
--- a/test/tint/builtins/gen/var/textureLoad/5abbf2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/5abbf2.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/5b0f5b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/5b0f5b.wgsl.expected.glsl
index 34df1f5..86844a6 100644
--- a/test/tint/builtins/gen/var/textureLoad/5b0f5b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/5b0f5b.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/5b4947.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/5b4947.wgsl.expected.glsl
index e70f7fb..144aa52 100644
--- a/test/tint/builtins/gen/var/textureLoad/5b4947.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/5b4947.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/5bb7fb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/5bb7fb.wgsl.expected.glsl
index 40b48a3..0128e60 100644
--- a/test/tint/builtins/gen/var/textureLoad/5bb7fb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/5bb7fb.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/5c69f8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/5c69f8.wgsl.expected.glsl
index f228cae..12c0029 100644
--- a/test/tint/builtins/gen/var/textureLoad/5c69f8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/5c69f8.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl
new file mode 100644
index 0000000..7e24523
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl
@@ -0,0 +1,63 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_2d<r8unorm, read>, coords: vec2<i32>) -> vec4<f32>
+fn textureLoad_5dd4c7() {
+ var arg_1 = vec2<i32>(1i);
+ var res: vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_5dd4c7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_5dd4c7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_5dd4c7();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a4329a4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_5dd4c7() {
+ int2 arg_1 = (1).xx;
+ float4 res = arg_0.Load(int3(arg_1, 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_5dd4c7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_5dd4c7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_5dd4c7();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a4329a4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_5dd4c7() {
+ int2 arg_1 = (1).xx;
+ float4 res = arg_0.Load(int3(arg_1, 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_5dd4c7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_5dd4c7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_5dd4c7();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.glsl
new file mode 100644
index 0000000..8e19ba1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_5dd4c7() {
+ ivec2 arg_1 = ivec2(1);
+ vec4 res = imageLoad(arg_0, arg_1);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_5dd4c7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_5dd4c7() {
+ ivec2 arg_1 = ivec2(1);
+ vec4 res = imageLoad(arg_0, arg_1);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_5dd4c7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_5dd4c7() {
+ ivec2 arg_1 = ivec2(1);
+ vec4 res = imageLoad(arg_0, arg_1);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_5dd4c7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.msl
new file mode 100644
index 0000000..646e7ba5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_5dd4c7(texture2d<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ int2 arg_1 = int2(1);
+ float4 res = tint_symbol_1.read(uint2(arg_1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_5dd4c7(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_5dd4c7(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_5dd4c7(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.spvasm
new file mode 100644
index 0000000..57cd89d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.spvasm
@@ -0,0 +1,99 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 50
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_5dd4c7 "textureLoad_5dd4c7"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %22 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %25 = OpConstantNull %v2int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %36 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_5dd4c7 = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ %27 = OpLoad %11 %arg_0
+ %28 = OpLoad %v2int %arg_1
+ %26 = OpImageRead %v4float %27 %28
+ OpStore %res %26
+ %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %35 = OpLoad %v4float %res
+ OpStore %34 %35
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_5dd4c7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureLoad_5dd4c7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureLoad_5dd4c7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.wgsl
new file mode 100644
index 0000000..6a74e8f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5dd4c7.wgsl.expected.wgsl
@@ -0,0 +1,27 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read>;
+
+fn textureLoad_5dd4c7() {
+ var arg_1 = vec2<i32>(1i);
+ var res : vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_5dd4c7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_5dd4c7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_5dd4c7();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/5e17a7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/5e17a7.wgsl.expected.glsl
index 467e400..cc1180a 100644
--- a/test/tint/builtins/gen/var/textureLoad/5e17a7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/5e17a7.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/5e1843.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/5e1843.wgsl.expected.glsl
index 7449711..2031b6d 100644
--- a/test/tint/builtins/gen/var/textureLoad/5e1843.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/5e1843.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl
new file mode 100644
index 0000000..5941a6d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl
@@ -0,0 +1,64 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read>, coords: vec2<u32>, array_index: u32) -> vec4<f32>
+fn textureLoad_5ed6ad() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1u;
+ var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_5ed6ad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_5ed6ad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_5ed6ad();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e47a60b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_5ed6ad() {
+ uint2 arg_1 = (1u).xx;
+ uint arg_2 = 1u;
+ float4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_5ed6ad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_5ed6ad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_5ed6ad();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e47a60b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_5ed6ad() {
+ uint2 arg_1 = (1u).xx;
+ uint arg_2 = 1u;
+ float4 res = arg_0.Load(uint4(uint3(arg_1, arg_2), uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_5ed6ad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_5ed6ad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_5ed6ad();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.glsl
new file mode 100644
index 0000000..e916493
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.glsl
@@ -0,0 +1,97 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_5ed6ad() {
+ uvec2 arg_1 = uvec2(1u);
+ uint arg_2 = 1u;
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(arg_1, arg_2)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_5ed6ad();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_5ed6ad() {
+ uvec2 arg_1 = uvec2(1u);
+ uint arg_2 = 1u;
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(arg_1, arg_2)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_5ed6ad();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_5ed6ad() {
+ uvec2 arg_1 = uvec2(1u);
+ uint arg_2 = 1u;
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(arg_1, arg_2)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_5ed6ad();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.msl
new file mode 100644
index 0000000..226c692
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_5ed6ad(texture2d_array<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ uint2 arg_1 = uint2(1u);
+ uint arg_2 = 1u;
+ float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_5ed6ad(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_5ed6ad(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_5ed6ad(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.spvasm
new file mode 100644
index 0000000..9c0b15a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.spvasm
@@ -0,0 +1,108 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 57
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_5ed6ad "textureLoad_5ed6ad"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %28 = OpConstantNull %uint
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %43 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_5ed6ad = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+ %arg_2 = OpVariable %_ptr_Function_uint Function %28
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ OpStore %arg_2 %uint_1
+ %30 = OpLoad %11 %arg_0
+ %32 = OpLoad %v2uint %arg_1
+ %33 = OpCompositeExtract %uint %32 0
+ %34 = OpCompositeExtract %uint %32 1
+ %35 = OpLoad %uint %arg_2
+ %36 = OpCompositeConstruct %v3uint %33 %34 %35
+ %29 = OpImageRead %v4float %30 %36
+ OpStore %res %29
+ %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %42 = OpLoad %v4float %res
+ OpStore %41 %42
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %43
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureLoad_5ed6ad
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %48 = OpLabel
+ %49 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %49
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %52 = OpLabel
+ %53 = OpFunctionCall %void %textureLoad_5ed6ad
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %55 = OpLabel
+ %56 = OpFunctionCall %void %textureLoad_5ed6ad
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.wgsl
new file mode 100644
index 0000000..d61b57c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/5ed6ad.wgsl.expected.wgsl
@@ -0,0 +1,28 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read>;
+
+fn textureLoad_5ed6ad() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1u;
+ var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_5ed6ad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_5ed6ad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_5ed6ad();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/61e2e8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/61e2e8.wgsl.expected.glsl
index 207cf77..e29846c 100644
--- a/test/tint/builtins/gen/var/textureLoad/61e2e8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/61e2e8.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/620caa.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/620caa.wgsl.expected.glsl
index 3cb8479..1a5d8d5 100644
--- a/test/tint/builtins/gen/var/textureLoad/620caa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/620caa.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/622278.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/622278.wgsl.expected.glsl
index 8474426..fa286a6 100644
--- a/test/tint/builtins/gen/var/textureLoad/622278.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/622278.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/63be18.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/63be18.wgsl.expected.glsl
index 106d804..d76b370 100644
--- a/test/tint/builtins/gen/var/textureLoad/63be18.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/63be18.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/64c372.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/64c372.wgsl.expected.glsl
index 8bd5971..601805e 100644
--- a/test/tint/builtins/gen/var/textureLoad/64c372.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/64c372.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/666010.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/666010.wgsl.expected.glsl
index 471db76..d8dcd86 100644
--- a/test/tint/builtins/gen/var/textureLoad/666010.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/666010.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/68d273.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/68d273.wgsl.expected.glsl
index 8abaf67..5181f77 100644
--- a/test/tint/builtins/gen/var/textureLoad/68d273.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/68d273.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/6a6871.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6a6871.wgsl.expected.glsl
index 8f19844..f05ef4f 100644
--- a/test/tint/builtins/gen/var/textureLoad/6a6871.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6a6871.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/6b8ba6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6b8ba6.wgsl.expected.glsl
index 5c34eccf..5b09edb 100644
--- a/test/tint/builtins/gen/var/textureLoad/6b8ba6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6b8ba6.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/6ba9ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6ba9ab.wgsl.expected.glsl
index 6318821..977a134 100644
--- a/test/tint/builtins/gen/var/textureLoad/6ba9ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6ba9ab.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/6bf3e2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6bf3e2.wgsl.expected.glsl
index 49dccd5..debcb96 100644
--- a/test/tint/builtins/gen/var/textureLoad/6bf3e2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6bf3e2.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/6d7bb5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6d7bb5.wgsl.expected.glsl
index 9ffe7a9..81d47db 100644
--- a/test/tint/builtins/gen/var/textureLoad/6d7bb5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6d7bb5.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/6e903f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6e903f.wgsl.expected.glsl
index 9d01fbd..1fe40a8 100644
--- a/test/tint/builtins/gen/var/textureLoad/6e903f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6e903f.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl
new file mode 100644
index 0000000..8eda953
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl
@@ -0,0 +1,63 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_3d<r8unorm, read>, coords: vec3<u32>) -> vec4<f32>
+fn textureLoad_6f0370() {
+ var arg_1 = vec3<u32>(1u);
+ var res: vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_6f0370();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_6f0370();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_6f0370();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..32aa4c3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_6f0370() {
+ uint3 arg_1 = (1u).xxx;
+ float4 res = arg_0.Load(uint4(arg_1, uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_6f0370();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_6f0370();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_6f0370();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..32aa4c3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_6f0370() {
+ uint3 arg_1 = (1u).xxx;
+ float4 res = arg_0.Load(uint4(arg_1, uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_6f0370();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_6f0370();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_6f0370();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.glsl
new file mode 100644
index 0000000..64cc17c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_6f0370() {
+ uvec3 arg_1 = uvec3(1u);
+ vec4 res = imageLoad(arg_0, ivec3(arg_1));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_6f0370();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_6f0370() {
+ uvec3 arg_1 = uvec3(1u);
+ vec4 res = imageLoad(arg_0, ivec3(arg_1));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_6f0370();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_6f0370() {
+ uvec3 arg_1 = uvec3(1u);
+ vec4 res = imageLoad(arg_0, ivec3(arg_1));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_6f0370();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.msl
new file mode 100644
index 0000000..452d2dc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_6f0370(texture3d<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ uint3 arg_1 = uint3(1u);
+ float4 res = tint_symbol_1.read(uint3(arg_1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_6f0370(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_6f0370(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_6f0370(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.spvasm
new file mode 100644
index 0000000..b27a09b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.spvasm
@@ -0,0 +1,98 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 49
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_6f0370 "textureLoad_6f0370"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+ %22 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %25 = OpConstantNull %v3uint
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %35 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_6f0370 = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3uint Function %25
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ %27 = OpLoad %11 %arg_0
+ %28 = OpLoad %v3uint %arg_1
+ %26 = OpImageRead %v4float %27 %28
+ OpStore %res %26
+ %33 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %34 = OpLoad %v4float %res
+ OpStore %33 %34
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %35
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_6f0370
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %40 = OpLabel
+ %41 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %41
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureLoad_6f0370
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureLoad_6f0370
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.wgsl
new file mode 100644
index 0000000..b0b04b9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/6f0370.wgsl.expected.wgsl
@@ -0,0 +1,27 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read>;
+
+fn textureLoad_6f0370() {
+ var arg_1 = vec3<u32>(1u);
+ var res : vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_6f0370();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_6f0370();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_6f0370();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/6f0ea8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6f0ea8.wgsl.expected.glsl
index 0e6aecb..6f991e2 100644
--- a/test/tint/builtins/gen/var/textureLoad/6f0ea8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6f0ea8.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/6f8927.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/6f8927.wgsl.expected.glsl
index bc904d7..d51f612 100644
--- a/test/tint/builtins/gen/var/textureLoad/6f8927.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/6f8927.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl
new file mode 100644
index 0000000..d6c8b0a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl
@@ -0,0 +1,64 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<i32>, array_index: u32) -> vec4<f32>
+fn textureLoad_72c9c3() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1u;
+ var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_72c9c3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_72c9c3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_72c9c3();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e3b6466
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_72c9c3() {
+ int2 arg_1 = (1).xx;
+ uint arg_2 = 1u;
+ float4 res = arg_0.Load(int3(arg_1, int(arg_2)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_72c9c3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_72c9c3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_72c9c3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e3b6466
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_72c9c3() {
+ int2 arg_1 = (1).xx;
+ uint arg_2 = 1u;
+ float4 res = arg_0.Load(int3(arg_1, int(arg_2)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_72c9c3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_72c9c3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_72c9c3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.glsl
new file mode 100644
index 0000000..06311d9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.glsl
@@ -0,0 +1,97 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_72c9c3() {
+ ivec2 arg_1 = ivec2(1);
+ uint arg_2 = 1u;
+ vec4 res = imageLoad(arg_0, ivec3(arg_1, int(arg_2)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_72c9c3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_72c9c3() {
+ ivec2 arg_1 = ivec2(1);
+ uint arg_2 = 1u;
+ vec4 res = imageLoad(arg_0, ivec3(arg_1, int(arg_2)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_72c9c3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_72c9c3() {
+ ivec2 arg_1 = ivec2(1);
+ uint arg_2 = 1u;
+ vec4 res = imageLoad(arg_0, ivec3(arg_1, int(arg_2)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_72c9c3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.msl
new file mode 100644
index 0000000..814c1ca
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_72c9c3(texture2d_array<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ int2 arg_1 = int2(1);
+ uint arg_2 = 1u;
+ float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_72c9c3(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_72c9c3(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_72c9c3(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.spvasm
new file mode 100644
index 0000000..1ba6ea9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.spvasm
@@ -0,0 +1,110 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 60
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_72c9c3 "textureLoad_72c9c3"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %22 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %25 = OpConstantNull %v2int
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %30 = OpConstantNull %uint
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %46 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_72c9c3 = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+ %arg_2 = OpVariable %_ptr_Function_uint Function %30
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ OpStore %arg_2 %uint_1
+ %32 = OpLoad %11 %arg_0
+ %34 = OpLoad %v2int %arg_1
+ %35 = OpCompositeExtract %int %34 0
+ %36 = OpCompositeExtract %int %34 1
+ %38 = OpLoad %uint %arg_2
+ %37 = OpBitcast %int %38
+ %39 = OpCompositeConstruct %v3int %35 %36 %37
+ %31 = OpImageRead %v4float %32 %39
+ OpStore %res %31
+ %44 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %45 = OpLoad %v4float %res
+ OpStore %44 %45
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %46
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureLoad_72c9c3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %51 = OpLabel
+ %52 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %52
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %55 = OpLabel
+ %56 = OpFunctionCall %void %textureLoad_72c9c3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %58 = OpLabel
+ %59 = OpFunctionCall %void %textureLoad_72c9c3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.wgsl
new file mode 100644
index 0000000..2fc463a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/72c9c3.wgsl.expected.wgsl
@@ -0,0 +1,28 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureLoad_72c9c3() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1u;
+ var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_72c9c3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_72c9c3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_72c9c3();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/742f1b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/742f1b.wgsl.expected.glsl
index 6c52f32..4af4e62 100644
--- a/test/tint/builtins/gen/var/textureLoad/742f1b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/742f1b.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/74a387.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/74a387.wgsl.expected.glsl
index 04262bb..bbde354 100644
--- a/test/tint/builtins/gen/var/textureLoad/74a387.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/74a387.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/773c46.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/773c46.wgsl.expected.glsl
index 9c9edd6..d5e991e 100644
--- a/test/tint/builtins/gen/var/textureLoad/773c46.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/773c46.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/7dab57.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/7dab57.wgsl.expected.glsl
index da76b32..00c0693 100644
--- a/test/tint/builtins/gen/var/textureLoad/7dab57.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/7dab57.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl
new file mode 100644
index 0000000..c95ab05
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl
@@ -0,0 +1,64 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<i32>, array_index: i32) -> vec4<f32>
+fn textureLoad_7dd3d5() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1i;
+ var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_7dd3d5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_7dd3d5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_7dd3d5();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8392570
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_7dd3d5() {
+ int2 arg_1 = (1).xx;
+ int arg_2 = 1;
+ float4 res = arg_0.Load(int3(arg_1, arg_2));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_7dd3d5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_7dd3d5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_7dd3d5();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8392570
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_7dd3d5() {
+ int2 arg_1 = (1).xx;
+ int arg_2 = 1;
+ float4 res = arg_0.Load(int3(arg_1, arg_2));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_7dd3d5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_7dd3d5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_7dd3d5();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.glsl
new file mode 100644
index 0000000..ac371b6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.glsl
@@ -0,0 +1,97 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_7dd3d5() {
+ ivec2 arg_1 = ivec2(1);
+ int arg_2 = 1;
+ vec4 res = imageLoad(arg_0, ivec3(arg_1, arg_2));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_7dd3d5();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_7dd3d5() {
+ ivec2 arg_1 = ivec2(1);
+ int arg_2 = 1;
+ vec4 res = imageLoad(arg_0, ivec3(arg_1, arg_2));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_7dd3d5();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_7dd3d5() {
+ ivec2 arg_1 = ivec2(1);
+ int arg_2 = 1;
+ vec4 res = imageLoad(arg_0, ivec3(arg_1, arg_2));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_7dd3d5();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.msl
new file mode 100644
index 0000000..8c230c2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_7dd3d5(texture2d_array<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ int2 arg_1 = int2(1);
+ int arg_2 = 1;
+ float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_7dd3d5(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_7dd3d5(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_7dd3d5(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.spvasm
new file mode 100644
index 0000000..565ce40
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.spvasm
@@ -0,0 +1,108 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 58
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_7dd3d5 "textureLoad_7dd3d5"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %22 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %25 = OpConstantNull %v2int
+%_ptr_Function_int = OpTypePointer Function %int
+ %28 = OpConstantNull %int
+ %v3int = OpTypeVector %int 3
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %44 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_7dd3d5 = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %25
+ %arg_2 = OpVariable %_ptr_Function_int Function %28
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ OpStore %arg_2 %int_1
+ %30 = OpLoad %11 %arg_0
+ %32 = OpLoad %v2int %arg_1
+ %33 = OpCompositeExtract %int %32 0
+ %34 = OpCompositeExtract %int %32 1
+ %35 = OpLoad %int %arg_2
+ %36 = OpCompositeConstruct %v3int %33 %34 %35
+ %29 = OpImageRead %v4float %30 %36
+ OpStore %res %29
+ %42 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %43 = OpLoad %v4float %res
+ OpStore %42 %43
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %44
+ %46 = OpLabel
+ %47 = OpFunctionCall %void %textureLoad_7dd3d5
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %49 = OpLabel
+ %50 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %50
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %53 = OpLabel
+ %54 = OpFunctionCall %void %textureLoad_7dd3d5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %56 = OpLabel
+ %57 = OpFunctionCall %void %textureLoad_7dd3d5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.wgsl
new file mode 100644
index 0000000..db0d0b3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/7dd3d5.wgsl.expected.wgsl
@@ -0,0 +1,28 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureLoad_7dd3d5() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1i;
+ var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_7dd3d5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_7dd3d5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_7dd3d5();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/7e5cbc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/7e5cbc.wgsl.expected.glsl
index 808c3d6..418b875 100644
--- a/test/tint/builtins/gen/var/textureLoad/7e5cbc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/7e5cbc.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/80dae1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/80dae1.wgsl.expected.glsl
index bc0aa77..6f272ce 100644
--- a/test/tint/builtins/gen/var/textureLoad/80dae1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/80dae1.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/83162f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/83162f.wgsl.expected.glsl
index f6b5abc..928f7c5 100644
--- a/test/tint/builtins/gen/var/textureLoad/83162f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/83162f.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/848d85.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/848d85.wgsl.expected.glsl
index 8ac9da9..d43d8fd 100644
--- a/test/tint/builtins/gen/var/textureLoad/848d85.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/848d85.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/84a438.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/84a438.wgsl.expected.glsl
index 41a25e1..fe0b7c9 100644
--- a/test/tint/builtins/gen/var/textureLoad/84a438.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/84a438.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/878e24.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/878e24.wgsl.expected.glsl
index e250f89..7438b6e 100644
--- a/test/tint/builtins/gen/var/textureLoad/878e24.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/878e24.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/87f0a6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/87f0a6.wgsl.expected.glsl
index cf9edaf..e534377 100644
--- a/test/tint/builtins/gen/var/textureLoad/87f0a6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/87f0a6.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/881349.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/881349.wgsl.expected.glsl
index 3d55d0c..c7b37d9 100644
--- a/test/tint/builtins/gen/var/textureLoad/881349.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/881349.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/8a9988.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/8a9988.wgsl.expected.glsl
index f3653d3..e9eace7 100644
--- a/test/tint/builtins/gen/var/textureLoad/8a9988.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/8a9988.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/8b62fb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/8b62fb.wgsl.expected.glsl
index 6209f6b..b9a1c98 100644
--- a/test/tint/builtins/gen/var/textureLoad/8b62fb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/8b62fb.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/8c6176.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/8c6176.wgsl.expected.glsl
index b865d85..fb51468 100644
--- a/test/tint/builtins/gen/var/textureLoad/8c6176.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/8c6176.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/8d64c3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/8d64c3.wgsl.expected.glsl
index 8a53846..410b532 100644
--- a/test/tint/builtins/gen/var/textureLoad/8d64c3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/8d64c3.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/8e5032.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/8e5032.wgsl.expected.glsl
index c419092..d8ffc43 100644
--- a/test/tint/builtins/gen/var/textureLoad/8e5032.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/8e5032.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/8e68c9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/8e68c9.wgsl.expected.glsl
index 6631a71..a4747cd 100644
--- a/test/tint/builtins/gen/var/textureLoad/8e68c9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/8e68c9.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/8fc29b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/8fc29b.wgsl.expected.glsl
index 3d0e346..da15269 100644
--- a/test/tint/builtins/gen/var/textureLoad/8fc29b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/8fc29b.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/91ede5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/91ede5.wgsl.expected.glsl
index 1afb255..892afe2 100644
--- a/test/tint/builtins/gen/var/textureLoad/91ede5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/91ede5.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/9242e7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/9242e7.wgsl.expected.glsl
index 863b682..b8dc35a 100644
--- a/test/tint/builtins/gen/var/textureLoad/9242e7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/9242e7.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl
new file mode 100644
index 0000000..dda183a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl
@@ -0,0 +1,63 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_1d<r8unorm, read_write>, coords: u32) -> vec4<f32>
+fn textureLoad_92dd61() {
+ var arg_1 = 1u;
+ var res: vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_92dd61();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_92dd61();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_92dd61();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2ffc6e6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_92dd61() {
+ uint arg_1 = 1u;
+ float4 res = arg_0.Load(arg_1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_92dd61();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_92dd61();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_92dd61();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2ffc6e6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_92dd61() {
+ uint arg_1 = 1u;
+ float4 res = arg_0.Load(arg_1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_92dd61();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_92dd61();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_92dd61();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.glsl
new file mode 100644
index 0000000..9a5b2b7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_92dd61() {
+ uint arg_1 = 1u;
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(arg_1, 0u)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_92dd61();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_92dd61() {
+ uint arg_1 = 1u;
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(arg_1, 0u)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_92dd61();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_92dd61() {
+ uint arg_1 = 1u;
+ vec4 res = imageLoad(arg_0, ivec2(uvec2(arg_1, 0u)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_92dd61();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.msl
new file mode 100644
index 0000000..46edbf1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_92dd61(texture1d<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ uint arg_1 = 1u;
+ float4 res = tint_symbol_1.read(uint(arg_1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_92dd61(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_92dd61(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_92dd61(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.spvasm
new file mode 100644
index 0000000..5b52910
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.spvasm
@@ -0,0 +1,96 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 47
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_92dd61 "textureLoad_92dd61"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %33 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_92dd61 = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %23
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %uint_1
+ %25 = OpLoad %11 %arg_0
+ %26 = OpLoad %uint %arg_1
+ %24 = OpImageRead %v4float %25 %26
+ OpStore %res %24
+ %31 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %32 = OpLoad %v4float %res
+ OpStore %31 %32
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %33
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_92dd61
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %38 = OpLabel
+ %39 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %39
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureLoad_92dd61
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureLoad_92dd61
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.wgsl
new file mode 100644
index 0000000..8706f19
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/92dd61.wgsl.expected.wgsl
@@ -0,0 +1,27 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read_write>;
+
+fn textureLoad_92dd61() {
+ var arg_1 = 1u;
+ var res : vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_92dd61();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_92dd61();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_92dd61();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/947107.wgsl b/test/tint/builtins/gen/var/textureLoad/947107.wgsl
new file mode 100644
index 0000000..142c71b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/947107.wgsl
@@ -0,0 +1,63 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_1d<r8unorm, read>, coords: i32) -> vec4<f32>
+fn textureLoad_947107() {
+ var arg_1 = 1i;
+ var res: vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_947107();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_947107();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_947107();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f8c392d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_947107() {
+ int arg_1 = 1;
+ float4 res = arg_0.Load(int2(arg_1, 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_947107();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_947107();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_947107();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f8c392d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_947107() {
+ int arg_1 = 1;
+ float4 res = arg_0.Load(int2(arg_1, 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_947107();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_947107();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_947107();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.glsl
new file mode 100644
index 0000000..243d06f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_947107() {
+ int arg_1 = 1;
+ vec4 res = imageLoad(arg_0, ivec2(arg_1, 0));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_947107();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_947107() {
+ int arg_1 = 1;
+ vec4 res = imageLoad(arg_0, ivec2(arg_1, 0));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_947107();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_947107() {
+ int arg_1 = 1;
+ vec4 res = imageLoad(arg_0, ivec2(arg_1, 0));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_947107();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.msl
new file mode 100644
index 0000000..6730277
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_947107(texture1d<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ int arg_1 = 1;
+ float4 res = tint_symbol_1.read(uint(arg_1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_947107(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_947107(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_947107(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.spvasm
new file mode 100644
index 0000000..76082e6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.spvasm
@@ -0,0 +1,98 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 48
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_947107 "textureLoad_947107"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %23 = OpConstantNull %int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %34 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_947107 = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %23
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %int_1
+ %25 = OpLoad %11 %arg_0
+ %26 = OpLoad %int %arg_1
+ %24 = OpImageRead %v4float %25 %26
+ OpStore %res %24
+ %32 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %33 = OpLoad %v4float %res
+ OpStore %32 %33
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %34
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_947107
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %39 = OpLabel
+ %40 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %40
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureLoad_947107
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %46 = OpLabel
+ %47 = OpFunctionCall %void %textureLoad_947107
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.wgsl
new file mode 100644
index 0000000..bfd0a93
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/947107.wgsl.expected.wgsl
@@ -0,0 +1,27 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read>;
+
+fn textureLoad_947107() {
+ var arg_1 = 1i;
+ var res : vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_947107();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_947107();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_947107();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl
new file mode 100644
index 0000000..d399b09
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl
@@ -0,0 +1,63 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_3d<r8unorm, read_write>, coords: vec3<i32>) -> vec4<f32>
+fn textureLoad_99d8fa() {
+ var arg_1 = vec3<i32>(1i);
+ var res: vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_99d8fa();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_99d8fa();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_99d8fa();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9abc3ca
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_99d8fa() {
+ int3 arg_1 = (1).xxx;
+ float4 res = arg_0.Load(arg_1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_99d8fa();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_99d8fa();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_99d8fa();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9abc3ca
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_99d8fa() {
+ int3 arg_1 = (1).xxx;
+ float4 res = arg_0.Load(arg_1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_99d8fa();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_99d8fa();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_99d8fa();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.glsl
new file mode 100644
index 0000000..f6b6954
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_99d8fa() {
+ ivec3 arg_1 = ivec3(1);
+ vec4 res = imageLoad(arg_0, arg_1);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_99d8fa();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_99d8fa() {
+ ivec3 arg_1 = ivec3(1);
+ vec4 res = imageLoad(arg_0, arg_1);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_99d8fa();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_99d8fa() {
+ ivec3 arg_1 = ivec3(1);
+ vec4 res = imageLoad(arg_0, arg_1);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_99d8fa();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.msl
new file mode 100644
index 0000000..abcfcf2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_99d8fa(texture3d<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ int3 arg_1 = int3(1);
+ float4 res = tint_symbol_1.read(uint3(arg_1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_99d8fa(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_99d8fa(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_99d8fa(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.spvasm
new file mode 100644
index 0000000..af47518
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.spvasm
@@ -0,0 +1,98 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 50
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_99d8fa "textureLoad_99d8fa"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %22 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %25 = OpConstantNull %v3int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %36 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_99d8fa = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3int Function %25
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ %27 = OpLoad %11 %arg_0
+ %28 = OpLoad %v3int %arg_1
+ %26 = OpImageRead %v4float %27 %28
+ OpStore %res %26
+ %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %35 = OpLoad %v4float %res
+ OpStore %34 %35
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_99d8fa
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureLoad_99d8fa
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureLoad_99d8fa
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.wgsl
new file mode 100644
index 0000000..9fb9591
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/99d8fa.wgsl.expected.wgsl
@@ -0,0 +1,27 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read_write>;
+
+fn textureLoad_99d8fa() {
+ var arg_1 = vec3<i32>(1i);
+ var res : vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_99d8fa();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_99d8fa();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_99d8fa();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/9c2a14.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/9c2a14.wgsl.expected.glsl
index d2ec394..be3374e 100644
--- a/test/tint/builtins/gen/var/textureLoad/9c2a14.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/9c2a14.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/9cf7df.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/9cf7df.wgsl.expected.glsl
index 41dd7a5..7e8a940 100644
--- a/test/tint/builtins/gen/var/textureLoad/9cf7df.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/9cf7df.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/9fa9fd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/9fa9fd.wgsl.expected.glsl
index 12d6f2d..5f7bdc7 100644
--- a/test/tint/builtins/gen/var/textureLoad/9fa9fd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/9fa9fd.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/9fd7be.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/9fd7be.wgsl.expected.glsl
index 13c0776..d7d9db5 100644
--- a/test/tint/builtins/gen/var/textureLoad/9fd7be.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/9fd7be.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/a2b3f4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/a2b3f4.wgsl.expected.glsl
index 7d3d4a7..6ddd68f 100644
--- a/test/tint/builtins/gen/var/textureLoad/a2b3f4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/a2b3f4.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/a3733f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/a3733f.wgsl.expected.glsl
index 08c3ff4..ccb11ba 100644
--- a/test/tint/builtins/gen/var/textureLoad/a3733f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/a3733f.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/a3f122.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/a3f122.wgsl.expected.glsl
index aafa471..8023e77 100644
--- a/test/tint/builtins/gen/var/textureLoad/a3f122.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/a3f122.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/a548a8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/a548a8.wgsl.expected.glsl
index ad016f1..39e8af6 100644
--- a/test/tint/builtins/gen/var/textureLoad/a548a8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/a548a8.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/a54e11.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/a54e11.wgsl.expected.glsl
index e2bbae0..11fe502 100644
--- a/test/tint/builtins/gen/var/textureLoad/a54e11.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/a54e11.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/a5c4e2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/a5c4e2.wgsl.expected.glsl
index f012200..7bf7ae8 100644
--- a/test/tint/builtins/gen/var/textureLoad/a5c4e2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/a5c4e2.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/a64b1d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/a64b1d.wgsl.expected.glsl
index ba7fb7a..175a4b6 100644
--- a/test/tint/builtins/gen/var/textureLoad/a64b1d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/a64b1d.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/a7bcb4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/a7bcb4.wgsl.expected.glsl
index dbe2326..76a5a1c 100644
--- a/test/tint/builtins/gen/var/textureLoad/a7bcb4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/a7bcb4.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/a7c171.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/a7c171.wgsl.expected.glsl
index 6e95d8f..5af908c 100644
--- a/test/tint/builtins/gen/var/textureLoad/a7c171.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/a7c171.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/a92b18.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/a92b18.wgsl.expected.glsl
index 31ecc97..9fddacb 100644
--- a/test/tint/builtins/gen/var/textureLoad/a92b18.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/a92b18.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/aa2579.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/aa2579.wgsl.expected.glsl
index 3c28bf4..e654f88 100644
--- a/test/tint/builtins/gen/var/textureLoad/aa2579.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/aa2579.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/aa6130.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/aa6130.wgsl.expected.glsl
index 5ea1862..1c354ed 100644
--- a/test/tint/builtins/gen/var/textureLoad/aa6130.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/aa6130.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/aae9c3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/aae9c3.wgsl.expected.glsl
index 9187944..b2c5dc3 100644
--- a/test/tint/builtins/gen/var/textureLoad/aae9c3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/aae9c3.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/acf22f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/acf22f.wgsl.expected.glsl
index 3a7a1c9..94f2524 100644
--- a/test/tint/builtins/gen/var/textureLoad/acf22f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/acf22f.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/af0507.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/af0507.wgsl.expected.glsl
index 380c6d4..f57fbd2 100644
--- a/test/tint/builtins/gen/var/textureLoad/af0507.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/af0507.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/b1ca35.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/b1ca35.wgsl.expected.glsl
index 147c630..9d2d1160 100644
--- a/test/tint/builtins/gen/var/textureLoad/b1ca35.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/b1ca35.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/b4d6c4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/b4d6c4.wgsl.expected.glsl
index 303c73e..483b44c 100644
--- a/test/tint/builtins/gen/var/textureLoad/b4d6c4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/b4d6c4.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/b60a86.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/b60a86.wgsl.expected.glsl
index 6246af2..dd26653 100644
--- a/test/tint/builtins/gen/var/textureLoad/b60a86.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/b60a86.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/b60db7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/b60db7.wgsl.expected.glsl
index 08c04ec..28ef8e1 100644
--- a/test/tint/builtins/gen/var/textureLoad/b60db7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/b60db7.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/ba74b2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/ba74b2.wgsl.expected.glsl
index ad77079..55cffa3 100644
--- a/test/tint/builtins/gen/var/textureLoad/ba74b2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/ba74b2.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/babdf3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/babdf3.wgsl.expected.glsl
index 03da72b..61a6b1d 100644
--- a/test/tint/builtins/gen/var/textureLoad/babdf3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/babdf3.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/bba04a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/bba04a.wgsl.expected.glsl
index 9963936..007afca 100644
--- a/test/tint/builtins/gen/var/textureLoad/bba04a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/bba04a.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/bbb762.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/bbb762.wgsl.expected.glsl
index 4a2a5eb..5098923 100644
--- a/test/tint/builtins/gen/var/textureLoad/bbb762.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/bbb762.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl
new file mode 100644
index 0000000..bffa1f0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl
@@ -0,0 +1,64 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<u32>, array_index: i32) -> vec4<f32>
+fn textureLoad_bc882d() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1i;
+ var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_bc882d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_bc882d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_bc882d();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ae2aa11
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_bc882d() {
+ uint2 arg_1 = (1u).xx;
+ int arg_2 = 1;
+ float4 res = arg_0.Load(uint3(arg_1, uint(arg_2)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_bc882d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_bc882d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_bc882d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ae2aa11
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_bc882d() {
+ uint2 arg_1 = (1u).xx;
+ int arg_2 = 1;
+ float4 res = arg_0.Load(uint3(arg_1, uint(arg_2)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_bc882d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_bc882d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_bc882d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.glsl
new file mode 100644
index 0000000..71380c8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.glsl
@@ -0,0 +1,97 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_bc882d() {
+ uvec2 arg_1 = uvec2(1u);
+ int arg_2 = 1;
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(arg_1, uint(arg_2))));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_bc882d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_bc882d() {
+ uvec2 arg_1 = uvec2(1u);
+ int arg_2 = 1;
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(arg_1, uint(arg_2))));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_bc882d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_bc882d() {
+ uvec2 arg_1 = uvec2(1u);
+ int arg_2 = 1;
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(arg_1, uint(arg_2))));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_bc882d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.msl
new file mode 100644
index 0000000..d283242
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_bc882d(texture2d_array<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ uint2 arg_1 = uint2(1u);
+ int arg_2 = 1;
+ float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_bc882d(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_bc882d(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_bc882d(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.spvasm
new file mode 100644
index 0000000..19f7530
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.spvasm
@@ -0,0 +1,110 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 60
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_bc882d "textureLoad_bc882d"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %30 = OpConstantNull %int
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %46 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_bc882d = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+ %arg_2 = OpVariable %_ptr_Function_int Function %30
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ OpStore %arg_2 %int_1
+ %32 = OpLoad %11 %arg_0
+ %34 = OpLoad %v2uint %arg_1
+ %35 = OpCompositeExtract %uint %34 0
+ %36 = OpCompositeExtract %uint %34 1
+ %38 = OpLoad %int %arg_2
+ %37 = OpBitcast %uint %38
+ %39 = OpCompositeConstruct %v3uint %35 %36 %37
+ %31 = OpImageRead %v4float %32 %39
+ OpStore %res %31
+ %44 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %45 = OpLoad %v4float %res
+ OpStore %44 %45
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %46
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureLoad_bc882d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %51 = OpLabel
+ %52 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %52
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %55 = OpLabel
+ %56 = OpFunctionCall %void %textureLoad_bc882d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %58 = OpLabel
+ %59 = OpFunctionCall %void %textureLoad_bc882d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.wgsl
new file mode 100644
index 0000000..9bf80d5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/bc882d.wgsl.expected.wgsl
@@ -0,0 +1,28 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureLoad_bc882d() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1i;
+ var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_bc882d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_bc882d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_bc882d();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/bd990a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/bd990a.wgsl.expected.glsl
index 4d24926..33fda54 100644
--- a/test/tint/builtins/gen/var/textureLoad/bd990a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/bd990a.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/bdc67a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/bdc67a.wgsl.expected.glsl
index 24d523b..7c2330e 100644
--- a/test/tint/builtins/gen/var/textureLoad/bdc67a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/bdc67a.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/c5c86d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/c5c86d.wgsl.expected.glsl
index 532fadd..5b4e8ae 100644
--- a/test/tint/builtins/gen/var/textureLoad/c5c86d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/c5c86d.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/c7e313.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/c7e313.wgsl.expected.glsl
index c3a8646..0457cb3 100644
--- a/test/tint/builtins/gen/var/textureLoad/c7e313.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/c7e313.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/c8ed19.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/c8ed19.wgsl.expected.glsl
index 7d806bc..e7c187d 100644
--- a/test/tint/builtins/gen/var/textureLoad/c8ed19.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/c8ed19.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/c98bf4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/c98bf4.wgsl.expected.glsl
index dca493b..d519f1c 100644
--- a/test/tint/builtins/gen/var/textureLoad/c98bf4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/c98bf4.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/c9b083.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/c9b083.wgsl.expected.glsl
index c18703d..a4a8c7c 100644
--- a/test/tint/builtins/gen/var/textureLoad/c9b083.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/c9b083.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/cac876.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/cac876.wgsl.expected.glsl
index 615b799..b55ae79 100644
--- a/test/tint/builtins/gen/var/textureLoad/cac876.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/cac876.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/cdbcf6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/cdbcf6.wgsl.expected.glsl
index 6a2cd5f..7c77445 100644
--- a/test/tint/builtins/gen/var/textureLoad/cdbcf6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/cdbcf6.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/cdccd2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/cdccd2.wgsl.expected.glsl
index ebd446e..d4a10e9 100644
--- a/test/tint/builtins/gen/var/textureLoad/cdccd2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/cdccd2.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/cddf6b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/cddf6b.wgsl.expected.glsl
index 2d911c7..bdce72a 100644
--- a/test/tint/builtins/gen/var/textureLoad/cddf6b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/cddf6b.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl
new file mode 100644
index 0000000..58e85ba
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl
@@ -0,0 +1,63 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_3d<r8unorm, read>, coords: vec3<i32>) -> vec4<f32>
+fn textureLoad_cece6c() {
+ var arg_1 = vec3<i32>(1i);
+ var res: vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_cece6c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_cece6c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_cece6c();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3726124
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_cece6c() {
+ int3 arg_1 = (1).xxx;
+ float4 res = arg_0.Load(int4(arg_1, 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_cece6c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_cece6c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_cece6c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3726124
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_cece6c() {
+ int3 arg_1 = (1).xxx;
+ float4 res = arg_0.Load(int4(arg_1, 0));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_cece6c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_cece6c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_cece6c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.glsl
new file mode 100644
index 0000000..8cf30e8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_cece6c() {
+ ivec3 arg_1 = ivec3(1);
+ vec4 res = imageLoad(arg_0, arg_1);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_cece6c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_cece6c() {
+ ivec3 arg_1 = ivec3(1);
+ vec4 res = imageLoad(arg_0, arg_1);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_cece6c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image3D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_cece6c() {
+ ivec3 arg_1 = ivec3(1);
+ vec4 res = imageLoad(arg_0, arg_1);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_cece6c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.msl
new file mode 100644
index 0000000..e62f8a1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_cece6c(texture3d<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ int3 arg_1 = int3(1);
+ float4 res = tint_symbol_1.read(uint3(arg_1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_cece6c(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_cece6c(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_cece6c(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.spvasm
new file mode 100644
index 0000000..a2a2f70
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.spvasm
@@ -0,0 +1,99 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 50
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_cece6c "textureLoad_cece6c"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %22 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %25 = OpConstantNull %v3int
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint = OpTypeInt 32 0
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %36 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_cece6c = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3int Function %25
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ %27 = OpLoad %11 %arg_0
+ %28 = OpLoad %v3int %arg_1
+ %26 = OpImageRead %v4float %27 %28
+ OpStore %res %26
+ %34 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %35 = OpLoad %v4float %res
+ OpStore %34 %35
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %36
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_cece6c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %42
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureLoad_cece6c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %48 = OpLabel
+ %49 = OpFunctionCall %void %textureLoad_cece6c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.wgsl
new file mode 100644
index 0000000..f827d71
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/cece6c.wgsl.expected.wgsl
@@ -0,0 +1,27 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read>;
+
+fn textureLoad_cece6c() {
+ var arg_1 = vec3<i32>(1i);
+ var res : vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_cece6c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_cece6c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_cece6c();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/d0e351.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/d0e351.wgsl.expected.glsl
index 2ea2634..18913df 100644
--- a/test/tint/builtins/gen/var/textureLoad/d0e351.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/d0e351.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/d37a08.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/d37a08.wgsl.expected.glsl
index b3e07d4..856c099 100644
--- a/test/tint/builtins/gen/var/textureLoad/d37a08.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/d37a08.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/d3d8fc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/d3d8fc.wgsl.expected.glsl
index f55e6be..1c62555 100644
--- a/test/tint/builtins/gen/var/textureLoad/d3d8fc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/d3d8fc.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/d41c72.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/d41c72.wgsl.expected.glsl
index 45238c3..a4c3673 100644
--- a/test/tint/builtins/gen/var/textureLoad/d41c72.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/d41c72.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/d72de9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/d72de9.wgsl.expected.glsl
index 3cda745..c7db781 100644
--- a/test/tint/builtins/gen/var/textureLoad/d72de9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/d72de9.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/d7996a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/d7996a.wgsl.expected.glsl
index 5ed7aaf..9652845 100644
--- a/test/tint/builtins/gen/var/textureLoad/d7996a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/d7996a.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32i) uniform highp writeonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/d79c5c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/d79c5c.wgsl.expected.glsl
index fea110e..f4dd481 100644
--- a/test/tint/builtins/gen/var/textureLoad/d79c5c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/d79c5c.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/d80ff3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/d80ff3.wgsl.expected.glsl
index 74e6a0b..33486cb 100644
--- a/test/tint/builtins/gen/var/textureLoad/d80ff3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/d80ff3.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/d81c57.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/d81c57.wgsl.expected.glsl
index 5bdd617..04ec9b0 100644
--- a/test/tint/builtins/gen/var/textureLoad/d81c57.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/d81c57.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/d8617f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/d8617f.wgsl.expected.glsl
index 5cb6a98..e88d4cd 100644
--- a/test/tint/builtins/gen/var/textureLoad/d8617f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/d8617f.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/d8be5a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/d8be5a.wgsl.expected.glsl
index c8974ce..fc397ec 100644
--- a/test/tint/builtins/gen/var/textureLoad/d8be5a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/d8be5a.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/d91f37.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/d91f37.wgsl.expected.glsl
index 5daee2a..1c2c913 100644
--- a/test/tint/builtins/gen/var/textureLoad/d91f37.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/d91f37.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/dab04f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/dab04f.wgsl.expected.glsl
index aebc7d9..2d7cadc 100644
--- a/test/tint/builtins/gen/var/textureLoad/dab04f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/dab04f.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/dd5859.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/dd5859.wgsl.expected.glsl
index 7ee732e..d16f234 100644
--- a/test/tint/builtins/gen/var/textureLoad/dd5859.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/dd5859.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/dd8776.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/dd8776.wgsl.expected.glsl
index 05bcd99..4087ca9 100644
--- a/test/tint/builtins/gen/var/textureLoad/dd8776.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/dd8776.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/de5a0e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/de5a0e.wgsl.expected.glsl
index e44e3eb..abf27bd 100644
--- a/test/tint/builtins/gen/var/textureLoad/de5a0e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/de5a0e.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/defd9a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/defd9a.wgsl.expected.glsl
index 1ff79c9..e0e82b9 100644
--- a/test/tint/builtins/gen/var/textureLoad/defd9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/defd9a.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/e1c3cf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/e1c3cf.wgsl.expected.glsl
index 4bde96f..a4fdd2e 100644
--- a/test/tint/builtins/gen/var/textureLoad/e1c3cf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/e1c3cf.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/e2b3a1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/e2b3a1.wgsl.expected.glsl
index 4222011..021ee94 100644
--- a/test/tint/builtins/gen/var/textureLoad/e2b3a1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/e2b3a1.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/e2d7da.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/e2d7da.wgsl.expected.glsl
index dc54bcb..2f787c6 100644
--- a/test/tint/builtins/gen/var/textureLoad/e2d7da.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/e2d7da.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/e33285.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/e33285.wgsl.expected.glsl
index f1ac9d2..72edd0f 100644
--- a/test/tint/builtins/gen/var/textureLoad/e33285.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/e33285.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl
new file mode 100644
index 0000000..d35c17d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl
@@ -0,0 +1,63 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_2d<r8unorm, read_write>, coords: vec2<u32>) -> vec4<f32>
+fn textureLoad_e4051a() {
+ var arg_1 = vec2<u32>(1u);
+ var res: vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_e4051a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_e4051a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_e4051a();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..df81b9d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_e4051a() {
+ uint2 arg_1 = (1u).xx;
+ float4 res = arg_0.Load(arg_1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_e4051a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_e4051a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_e4051a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..df81b9d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_e4051a() {
+ uint2 arg_1 = (1u).xx;
+ float4 res = arg_0.Load(arg_1);
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_e4051a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_e4051a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_e4051a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.glsl
new file mode 100644
index 0000000..bec9a78
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_e4051a() {
+ uvec2 arg_1 = uvec2(1u);
+ vec4 res = imageLoad(arg_0, ivec2(arg_1));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_e4051a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_e4051a() {
+ uvec2 arg_1 = uvec2(1u);
+ vec4 res = imageLoad(arg_0, ivec2(arg_1));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_e4051a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_e4051a() {
+ uvec2 arg_1 = uvec2(1u);
+ vec4 res = imageLoad(arg_0, ivec2(arg_1));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_e4051a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.msl
new file mode 100644
index 0000000..83c64a0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_e4051a(texture2d<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ uint2 arg_1 = uint2(1u);
+ float4 res = tint_symbol_1.read(uint2(arg_1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_e4051a(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_e4051a(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_e4051a(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.spvasm
new file mode 100644
index 0000000..f004b6d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.spvasm
@@ -0,0 +1,97 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 49
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_e4051a "textureLoad_e4051a"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %35 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_e4051a = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ %27 = OpLoad %11 %arg_0
+ %28 = OpLoad %v2uint %arg_1
+ %26 = OpImageRead %v4float %27 %28
+ OpStore %res %26
+ %33 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %34 = OpLoad %v4float %res
+ OpStore %33 %34
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %35
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_e4051a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %40 = OpLabel
+ %41 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %41
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureLoad_e4051a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureLoad_e4051a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.wgsl
new file mode 100644
index 0000000..3b36987
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/e4051a.wgsl.expected.wgsl
@@ -0,0 +1,27 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read_write>;
+
+fn textureLoad_e4051a() {
+ var arg_1 = vec2<u32>(1u);
+ var res : vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_e4051a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_e4051a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_e4051a();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/e59fdf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/e59fdf.wgsl.expected.glsl
index 96bfccf..ea6afbb 100644
--- a/test/tint/builtins/gen/var/textureLoad/e59fdf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/e59fdf.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/e65916.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/e65916.wgsl.expected.glsl
index 6aa6b22..5c4a985 100644
--- a/test/tint/builtins/gen/var/textureLoad/e65916.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/e65916.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/e9eb65.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/e9eb65.wgsl.expected.glsl
index ebd4618..02a4a78 100644
--- a/test/tint/builtins/gen/var/textureLoad/e9eb65.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/e9eb65.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/ed55a8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/ed55a8.wgsl.expected.glsl
index fd02439..33a8490 100644
--- a/test/tint/builtins/gen/var/textureLoad/ed55a8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/ed55a8.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/eecf7d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/eecf7d.wgsl.expected.glsl
index cf84bee..034b6d5 100644
--- a/test/tint/builtins/gen/var/textureLoad/eecf7d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/eecf7d.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/ef2ec3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/ef2ec3.wgsl.expected.glsl
index a7ef482..82b3522 100644
--- a/test/tint/builtins/gen/var/textureLoad/ef2ec3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/ef2ec3.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/ef5405.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/ef5405.wgsl.expected.glsl
index 36cbae6..55ad2de 100644
--- a/test/tint/builtins/gen/var/textureLoad/ef5405.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/ef5405.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/f0514a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/f0514a.wgsl.expected.glsl
index 0642b2f..8bf19e9 100644
--- a/test/tint/builtins/gen/var/textureLoad/f0514a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/f0514a.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl
new file mode 100644
index 0000000..de3e146
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl
@@ -0,0 +1,64 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureLoad(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<u32>, array_index: u32) -> vec4<f32>
+fn textureLoad_f2bdd4() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1u;
+ var res: vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f2bdd4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f2bdd4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f2bdd4();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1d8a3fb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_f2bdd4() {
+ uint2 arg_1 = (1u).xx;
+ uint arg_2 = 1u;
+ float4 res = arg_0.Load(uint3(arg_1, arg_2));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f2bdd4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f2bdd4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f2bdd4();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1d8a3fb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_f2bdd4() {
+ uint2 arg_1 = (1u).xx;
+ uint arg_2 = 1u;
+ float4 res = arg_0.Load(uint3(arg_1, arg_2));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f2bdd4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f2bdd4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f2bdd4();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.glsl
new file mode 100644
index 0000000..7d61254
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.glsl
@@ -0,0 +1,97 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_f2bdd4() {
+ uvec2 arg_1 = uvec2(1u);
+ uint arg_2 = 1u;
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(arg_1, arg_2)));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_f2bdd4();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_f2bdd4() {
+ uvec2 arg_1 = uvec2(1u);
+ uint arg_2 = 1u;
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(arg_1, arg_2)));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_f2bdd4();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_f2bdd4() {
+ uvec2 arg_1 = uvec2(1u);
+ uint arg_2 = 1u;
+ vec4 res = imageLoad(arg_0, ivec3(uvec3(arg_1, arg_2)));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_f2bdd4();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.msl
new file mode 100644
index 0000000..83034dc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_f2bdd4(texture2d_array<float, access::read_write> tint_symbol_1, device float4* const tint_symbol_2) {
+ uint2 arg_1 = uint2(1u);
+ uint arg_2 = 1u;
+ float4 res = tint_symbol_1.read(uint2(arg_1), arg_2);
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_f2bdd4(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_f2bdd4(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_f2bdd4(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.spvasm
new file mode 100644
index 0000000..6a98289
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.spvasm
@@ -0,0 +1,107 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 57
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_f2bdd4 "textureLoad_f2bdd4"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %28 = OpConstantNull %uint
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %43 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_f2bdd4 = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+ %arg_2 = OpVariable %_ptr_Function_uint Function %28
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ OpStore %arg_2 %uint_1
+ %30 = OpLoad %11 %arg_0
+ %32 = OpLoad %v2uint %arg_1
+ %33 = OpCompositeExtract %uint %32 0
+ %34 = OpCompositeExtract %uint %32 1
+ %35 = OpLoad %uint %arg_2
+ %36 = OpCompositeConstruct %v3uint %33 %34 %35
+ %29 = OpImageRead %v4float %30 %36
+ OpStore %res %29
+ %41 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %42 = OpLoad %v4float %res
+ OpStore %41 %42
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %43
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureLoad_f2bdd4
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %48 = OpLabel
+ %49 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %49
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %52 = OpLabel
+ %53 = OpFunctionCall %void %textureLoad_f2bdd4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %55 = OpLabel
+ %56 = OpFunctionCall %void %textureLoad_f2bdd4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.wgsl
new file mode 100644
index 0000000..e3e7c8e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f2bdd4.wgsl.expected.wgsl
@@ -0,0 +1,28 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureLoad_f2bdd4() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1u;
+ var res : vec4<f32> = textureLoad(arg_0, arg_1, arg_2);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f2bdd4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f2bdd4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f2bdd4();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/f2c311.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/f2c311.wgsl.expected.glsl
index 2bf3cd8..587092c 100644
--- a/test/tint/builtins/gen/var/textureLoad/f2c311.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/f2c311.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl
new file mode 100644
index 0000000..fb2de2a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl
@@ -0,0 +1,63 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read>;
+
+// fn textureLoad(texture: texture_storage_2d<r8unorm, read>, coords: vec2<u32>) -> vec4<f32>
+fn textureLoad_f5aee2() {
+ var arg_1 = vec2<u32>(1u);
+ var res: vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f5aee2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f5aee2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f5aee2();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..353b9a9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_f5aee2() {
+ uint2 arg_1 = (1u).xx;
+ float4 res = arg_0.Load(uint3(arg_1, uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f5aee2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f5aee2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f5aee2();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..353b9a9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureLoad_f5aee2() {
+ uint2 arg_1 = (1u).xx;
+ float4 res = arg_0.Load(uint3(arg_1, uint(0)));
+ prevent_dce.Store4(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureLoad_f5aee2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureLoad_f5aee2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureLoad_f5aee2();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.glsl
new file mode 100644
index 0000000..99c5f2a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.glsl
@@ -0,0 +1,94 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_f5aee2() {
+ uvec2 arg_1 = uvec2(1u);
+ vec4 res = imageLoad(arg_0, ivec2(arg_1));
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureLoad_f5aee2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_f5aee2() {
+ uvec2 arg_1 = uvec2(1u);
+ vec4 res = imageLoad(arg_0, ivec2(arg_1));
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureLoad_f5aee2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2D arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ vec4 inner;
+} prevent_dce;
+
+void textureLoad_f5aee2() {
+ uvec2 arg_1 = uvec2(1u);
+ vec4 res = imageLoad(arg_0, ivec2(arg_1));
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureLoad_f5aee2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.msl
new file mode 100644
index 0000000..275f441
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureLoad_f5aee2(texture2d<float, access::read> tint_symbol_1, device float4* const tint_symbol_2) {
+ uint2 arg_1 = uint2(1u);
+ float4 res = tint_symbol_1.read(uint2(arg_1));
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read> tint_symbol_3, device float4* const tint_symbol_4) {
+ textureLoad_f5aee2(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read> tint_symbol_5 [[texture(0)]], device float4* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read> tint_symbol_7 [[texture(0)]], device float4* tint_symbol_8 [[buffer(0)]]) {
+ textureLoad_f5aee2(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read> tint_symbol_9 [[texture(0)]], device float4* tint_symbol_10 [[buffer(0)]]) {
+ textureLoad_f5aee2(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.spvasm
new file mode 100644
index 0000000..b36bb77
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.spvasm
@@ -0,0 +1,98 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 49
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureLoad_f5aee2 "textureLoad_f5aee2"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+%prevent_dce_block = OpTypeStruct %v4float
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %22 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_v4float = OpTypePointer StorageBuffer %v4float
+ %35 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureLoad_f5aee2 = OpFunction %void None %15
+ %18 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %25
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %22
+ %27 = OpLoad %11 %arg_0
+ %28 = OpLoad %v2uint %arg_1
+ %26 = OpImageRead %v4float %27 %28
+ OpStore %res %26
+ %33 = OpAccessChain %_ptr_StorageBuffer_v4float %prevent_dce %uint_0
+ %34 = OpLoad %v4float %res
+ OpStore %33 %34
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %35
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_f5aee2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %15
+ %40 = OpLabel
+ %41 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %41
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureLoad_f5aee2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureLoad_f5aee2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.wgsl
new file mode 100644
index 0000000..f21cdf4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureLoad/f5aee2.wgsl.expected.wgsl
@@ -0,0 +1,27 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read>;
+
+fn textureLoad_f5aee2() {
+ var arg_1 = vec2<u32>(1u);
+ var res : vec4<f32> = textureLoad(arg_0, arg_1);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : vec4<f32>;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureLoad_f5aee2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureLoad_f5aee2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureLoad_f5aee2();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/f5fbc6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/f5fbc6.wgsl.expected.glsl
index 82598de..8b245ab 100644
--- a/test/tint/builtins/gen/var/textureLoad/f5fbc6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/f5fbc6.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/f74bd8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/f74bd8.wgsl.expected.glsl
index ebba256..d8111e7 100644
--- a/test/tint/builtins/gen/var/textureLoad/f74bd8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/f74bd8.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image3D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/f7f3bc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/f7f3bc.wgsl.expected.glsl
index dc62231..cc4c034 100644
--- a/test/tint/builtins/gen/var/textureLoad/f7f3bc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/f7f3bc.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/f82eb2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/f82eb2.wgsl.expected.glsl
index 46a0140..462d822 100644
--- a/test/tint/builtins/gen/var/textureLoad/f82eb2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/f82eb2.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32f) uniform highp writeonly image2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/fc47ff.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/fc47ff.wgsl.expected.glsl
index 1a5350f..83d749d 100644
--- a/test/tint/builtins/gen/var/textureLoad/fc47ff.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/fc47ff.wgsl.expected.glsl
@@ -35,6 +35,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8i) uniform highp writeonly iimage2D arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -56,8 +57,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:11: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:11: '' : compilation terminated
+ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:12: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/fd9606.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/fd9606.wgsl.expected.glsl
index 9c6608c..a950351 100644
--- a/test/tint/builtins/gen/var/textureLoad/fd9606.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/fd9606.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureLoad/fe2c1b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/fe2c1b.wgsl.expected.glsl
index fd4b058..5148767 100644
--- a/test/tint/builtins/gen/var/textureLoad/fe2c1b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/fe2c1b.wgsl.expected.glsl
@@ -36,6 +36,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -58,8 +59,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:12: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
-ERROR: 0:12: '' : compilation terminated
+ERROR: 0:13: 'writeonly' : argument cannot drop memory qualifier when passed to formal parameter
+ERROR: 0:13: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.glsl
index 1a50dab..f4307a67 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureNumLayers/17ccad.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/17ccad.wgsl.expected.glsl
index 0aa22e5..5fb990b 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/17ccad.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/17ccad.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureNumLayers/24d572.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/24d572.wgsl.expected.glsl
index 1403066..2a5c2b9 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/24d572.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/24d572.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureNumLayers/2d95ea.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/2d95ea.wgsl.expected.glsl
index 672a12b..449c31b 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/2d95ea.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/2d95ea.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp readonly uimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.glsl
index ae17104..fefaea1 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.glsl
index 5b2e8e0..91a14c6 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.glsl
index 30cee48..2f19a4d 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl
new file mode 100644
index 0000000..e070c2b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<r8unorm, read>) -> u32
+fn textureNumLayers_59cc27() {
+ var res: u32 = textureNumLayers(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_59cc27();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_59cc27();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_59cc27();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..cc6f1a0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureNumLayers_59cc27() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_59cc27();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_59cc27();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_59cc27();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..cc6f1a0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureNumLayers_59cc27() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_59cc27();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_59cc27();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_59cc27();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.glsl
new file mode 100644
index 0000000..54839d4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_59cc27() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureNumLayers_59cc27();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_59cc27() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureNumLayers_59cc27();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp readonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_59cc27() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureNumLayers_59cc27();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.msl
new file mode 100644
index 0000000..262f62d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_59cc27(texture2d_array<float, access::read> tint_symbol_1, device uint* const tint_symbol_2) {
+ uint res = tint_symbol_1.get_array_size();
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read> tint_symbol_3, device uint* const tint_symbol_4) {
+ textureNumLayers_59cc27(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+ textureNumLayers_59cc27(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+ textureNumLayers_59cc27(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.spvasm
new file mode 100644
index 0000000..57ee337
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.spvasm
@@ -0,0 +1,93 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureNumLayers_59cc27 "textureNumLayers_59cc27"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonWritable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %26 = OpConstantNull %uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_59cc27 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %26
+ %23 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v3uint %23
+ %20 = OpCompositeExtract %uint %21 2
+ OpStore %res %20
+ %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+ %30 = OpLoad %uint %res
+ OpStore %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_59cc27
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureNumLayers_59cc27
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureNumLayers_59cc27
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.wgsl
new file mode 100644
index 0000000..920a168
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59cc27.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read>;
+
+fn textureNumLayers_59cc27() {
+ var res : u32 = textureNumLayers(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_59cc27();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_59cc27();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_59cc27();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/622aa2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/622aa2.wgsl.expected.glsl
index 1315cbe..f5fcbd2 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/622aa2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/622aa2.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.glsl
index 70b9528..ce3296f 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp isamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.glsl
index dbc7930..dfe709b 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl
new file mode 100644
index 0000000..652cf0f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<r8unorm, write>) -> u32
+fn textureNumLayers_8356f7() {
+ var res: u32 = textureNumLayers(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8356f7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8356f7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8356f7();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2b75958
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureNumLayers_8356f7() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8356f7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8356f7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8356f7();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2b75958
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureNumLayers_8356f7() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8356f7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8356f7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8356f7();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.glsl
new file mode 100644
index 0000000..76782d9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_8356f7() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureNumLayers_8356f7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_8356f7() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureNumLayers_8356f7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_8356f7() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureNumLayers_8356f7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.msl
new file mode 100644
index 0000000..594960c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_8356f7(texture2d_array<float, access::write> tint_symbol_1, device uint* const tint_symbol_2) {
+ uint res = tint_symbol_1.get_array_size();
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_3, device uint* const tint_symbol_4) {
+ textureNumLayers_8356f7(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+ textureNumLayers_8356f7(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+ textureNumLayers_8356f7(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.spvasm
new file mode 100644
index 0000000..0d23cb8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.spvasm
@@ -0,0 +1,93 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureNumLayers_8356f7 "textureNumLayers_8356f7"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %26 = OpConstantNull %uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_8356f7 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %26
+ %23 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v3uint %23
+ %20 = OpCompositeExtract %uint %21 2
+ OpStore %res %20
+ %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+ %30 = OpLoad %uint %res
+ OpStore %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_8356f7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureNumLayers_8356f7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureNumLayers_8356f7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.wgsl
new file mode 100644
index 0000000..d7fdd76
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8356f7.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, write>;
+
+fn textureNumLayers_8356f7() {
+ var res : u32 = textureNumLayers(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8356f7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8356f7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8356f7();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/90b8cc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/90b8cc.wgsl.expected.glsl
index 4fc489d..8125766 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/90b8cc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/90b8cc.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp readonly image2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl
new file mode 100644
index 0000000..e7dc908
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<r8unorm, read_write>) -> u32
+fn textureNumLayers_aac630() {
+ var res: u32 = textureNumLayers(arg_0);
+ prevent_dce = res;
+}
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_aac630();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_aac630();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_aac630();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1ede708
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.dxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureNumLayers_aac630() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_aac630();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_aac630();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_aac630();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1ede708
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.fxc.hlsl
@@ -0,0 +1,36 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+RWByteAddressBuffer prevent_dce : register(u0, space2);
+
+void textureNumLayers_aac630() {
+ uint3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+ prevent_dce.Store(0u, asuint(res));
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_aac630();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_aac630();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_aac630();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.glsl
new file mode 100644
index 0000000..2853882
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.glsl
@@ -0,0 +1,91 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_aac630() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+vec4 vertex_main() {
+ textureNumLayers_aac630();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_aac630() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+void fragment_main() {
+ textureNumLayers_aac630();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
+ uint inner;
+} prevent_dce;
+
+void textureNumLayers_aac630() {
+ uint res = uint(imageSize(arg_0).z);
+ prevent_dce.inner = res;
+}
+
+void compute_main() {
+ textureNumLayers_aac630();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.msl
new file mode 100644
index 0000000..dca1d16
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_aac630(texture2d_array<float, access::read_write> tint_symbol_1, device uint* const tint_symbol_2) {
+ uint res = tint_symbol_1.get_array_size();
+ *(tint_symbol_2) = res;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_3, device uint* const tint_symbol_4) {
+ textureNumLayers_aac630(tint_symbol_3, tint_symbol_4);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]], device uint* tint_symbol_6 [[buffer(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_5, tint_symbol_6);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_7 [[texture(0)]], device uint* tint_symbol_8 [[buffer(0)]]) {
+ textureNumLayers_aac630(tint_symbol_7, tint_symbol_8);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_9 [[texture(0)]], device uint* tint_symbol_10 [[buffer(0)]]) {
+ textureNumLayers_aac630(tint_symbol_9, tint_symbol_10);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.spvasm
new file mode 100644
index 0000000..520b9bc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.spvasm
@@ -0,0 +1,92 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %prevent_dce_block "prevent_dce_block"
+ OpMemberName %prevent_dce_block 0 "inner"
+ OpName %prevent_dce "prevent_dce"
+ OpName %textureNumLayers_aac630 "textureNumLayers_aac630"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ OpDecorate %prevent_dce_block Block
+ OpMemberDecorate %prevent_dce_block 0 Offset 0
+ OpDecorate %prevent_dce DescriptorSet 2
+ OpDecorate %prevent_dce Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%prevent_dce_block = OpTypeStruct %uint
+%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
+%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
+ %void = OpTypeVoid
+ %16 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %26 = OpConstantNull %uint
+ %uint_0 = OpConstant %uint 0
+%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_aac630 = OpFunction %void None %16
+ %19 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %26
+ %23 = OpLoad %11 %arg_0
+ %21 = OpImageQuerySize %v3uint %23
+ %20 = OpCompositeExtract %uint %21 2
+ OpStore %res %20
+ %29 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
+ %30 = OpLoad %uint %res
+ OpStore %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_aac630
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %16
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %16
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureNumLayers_aac630
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %16
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureNumLayers_aac630
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.wgsl
new file mode 100644
index 0000000..e1fe7a1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/aac630.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureNumLayers_aac630() {
+ var res : u32 = textureNumLayers(arg_0);
+ prevent_dce = res;
+}
+
+@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_aac630();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_aac630();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_aac630();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/bf2f76.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/bf2f76.wgsl.expected.glsl
index 3353dc7..86fd086 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/bf2f76.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/bf2f76.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp readonly iimage2DArray arg_0;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.glsl
index b3921eb..389a0c4 100644
--- a/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.glsl
@@ -34,6 +34,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp usamplerCubeArray arg_0_1;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
@@ -54,8 +55,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.glsl
index 30ededb..eb5c02b 100644
--- a/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/4703d0.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -25,8 +26,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:13: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
-ERROR: 0:13: '' : compilation terminated
+ERROR: 0:14: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
+ERROR: 0:14: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.glsl
index 03097fe..dabcc2a 100644
--- a/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/4dd1bf.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -25,8 +26,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.glsl
index 8610114..7c06197 100644
--- a/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/60bf45.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -25,8 +26,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:13: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
-ERROR: 0:13: '' : compilation terminated
+ERROR: 0:14: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
+ERROR: 0:14: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.glsl
index b840918..68c4c22 100644
--- a/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/7fd8cb.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -25,8 +26,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.glsl
index 0a9d4cc..f1bd516 100644
--- a/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/bc7477.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -25,8 +26,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.glsl
index 6482d2e..d916de2 100644
--- a/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSample/c2f4e8.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -25,8 +26,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.glsl
index 33e69f3..add0a82 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/c6953d.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -26,8 +27,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.glsl
index e7dfcbb..2690313 100644
--- a/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBias/eed7c4.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -26,8 +27,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.glsl
index 816e929..da380cc 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/1912e5.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -26,8 +27,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.glsl
index f9c5192..a070925 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/7b5025.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -26,8 +27,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:14: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
-ERROR: 0:14: '' : compilation terminated
+ERROR: 0:15: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
+ERROR: 0:15: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.glsl
index 11e5cc5..8afb76d 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/a3ca7e.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -26,8 +27,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.glsl
index 56cc9a8..4ac37fe 100644
--- a/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompare/af1051.wgsl.expected.glsl
@@ -2,6 +2,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -26,8 +27,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:14: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
-ERROR: 0:14: '' : compilation terminated
+ERROR: 0:15: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
+ERROR: 0:15: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.glsl
index cba7366..b713623 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.glsl
index fbf1653..d38fbcf 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.glsl
index fca88b5..5dc2749 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:14: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
-ERROR: 0:14: '' : compilation terminated
+ERROR: 0:15: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
+ERROR: 0:15: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.glsl
index 9993c1a..ce61404 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:14: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
-ERROR: 0:14: '' : compilation terminated
+ERROR: 0:15: 'sampler' : TextureOffset does not support sampler2DArrayShadow : ES Profile
+ERROR: 0:15: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.glsl
index a44a11e..2949756 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/bbb58f.wgsl.expected.glsl
@@ -39,6 +39,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -64,8 +65,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.glsl
index 7ca4382..647d1a7 100644
--- a/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleGrad/e383db.wgsl.expected.glsl
@@ -39,6 +39,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -64,8 +65,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.glsl
index bcd5cc7..37dfdf9 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/0bdd9a.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.glsl
index 4bc7925..cabe17b 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeShadow arg_0_arg_1;
@@ -61,9 +62,9 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:13: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:13: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
-ERROR: 0:13: '' : compilation terminated
+ERROR: 0:14: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:14: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
+ERROR: 0:14: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.glsl
index bf56907..ee0d967 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.glsl
@@ -39,6 +39,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -63,9 +64,9 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:14: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:14: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
-ERROR: 0:14: '' : compilation terminated
+ERROR: 0:15: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:15: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
+ERROR: 0:15: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.glsl
index f40681c..f3d4b6c 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/2974eb.wgsl.expected.glsl
@@ -39,6 +39,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -63,9 +64,9 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:14: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:14: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
-ERROR: 0:14: '' : compilation terminated
+ERROR: 0:15: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:15: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
+ERROR: 0:15: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.glsl
index bde98fa..95a81f6 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:14: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:14: '' : compilation terminated
+ERROR: 0:15: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:15: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.glsl
index b0e9e70..583f48b 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36f0d3.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:14: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:14: '' : compilation terminated
+ERROR: 0:15: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:15: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.glsl
index aea072a..cce8120 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/3c3442.wgsl.expected.glsl
@@ -39,6 +39,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -63,9 +64,9 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:14: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:14: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
-ERROR: 0:14: '' : compilation terminated
+ERROR: 0:15: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:15: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
+ERROR: 0:15: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.glsl
index 3e2e75b..0b47eb0 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/615583.wgsl.expected.glsl
@@ -39,6 +39,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -63,9 +64,9 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:14: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:14: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
-ERROR: 0:14: '' : compilation terminated
+ERROR: 0:15: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:15: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
+ERROR: 0:15: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.glsl
index 436a4a3..9f1c903 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/941a53.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.glsl
index 37f512f..3882880 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/a12142.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.glsl
index 3f918be..2ac8ff0 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/aab3b9.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArray arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArray' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.glsl
index 31ce21d..1197f66 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.glsl
index 55ee8f4..3f33ac1 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae92a2.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeShadow arg_0_arg_1;
@@ -61,9 +62,9 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:13: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:13: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
-ERROR: 0:13: '' : compilation terminated
+ERROR: 0:14: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:14: 'textureLod(..., float lod)' : GL_EXT_texture_shadow_lod not supported for this ES version
+ERROR: 0:14: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.glsl
index 1c51bbb..6d7a734 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/cdfe0f.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:14: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:14: '' : compilation terminated
+ERROR: 0:15: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:15: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.glsl
index dcc5eb0..853e1fc 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/e6ce9e.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp sampler2DArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:14: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
-ERROR: 0:14: '' : compilation terminated
+ERROR: 0:15: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
+ERROR: 0:15: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.glsl
index 35cee54..b66e065 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ff11bc.wgsl.expected.glsl
@@ -38,6 +38,7 @@
#version 310 es
precision highp float;
+precision highp int;
uniform highp samplerCubeArrayShadow arg_0_arg_1;
@@ -62,8 +63,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArrayShadow' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'samplerCubeArrayShadow' : Reserved word.
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/064c7f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/064c7f.wgsl.expected.glsl
index e183f33..f539e7b 100644
--- a/test/tint/builtins/gen/var/textureStore/064c7f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/064c7f.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_064c7f() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/0ad124.wgsl b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl
new file mode 100644
index 0000000..0146160
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl
@@ -0,0 +1,61 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_1d<r8unorm, read_write>, coords: i32, value: vec4<f32>)
+fn textureStore_0ad124() {
+ var arg_1 = 1i;
+ var arg_2 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_0ad124();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_0ad124();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_0ad124();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ad59bbe
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_0ad124() {
+ int arg_1 = 1;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_0ad124();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_0ad124();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_0ad124();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ad59bbe
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_0ad124() {
+ int arg_1 = 1;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_0ad124();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_0ad124();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_0ad124();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.glsl
new file mode 100644
index 0000000..7b42407
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.glsl
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_0ad124() {
+ int arg_1 = 1;
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(arg_1, 0), arg_2);
+}
+
+vec4 vertex_main() {
+ textureStore_0ad124();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_0ad124() {
+ int arg_1 = 1;
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(arg_1, 0), arg_2);
+}
+
+void fragment_main() {
+ textureStore_0ad124();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_0ad124() {
+ int arg_1 = 1;
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(arg_1, 0), arg_2);
+}
+
+void compute_main() {
+ textureStore_0ad124();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.msl
new file mode 100644
index 0000000..17e3981
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_0ad124(texture1d<float, access::read_write> tint_symbol_1) {
+ int arg_1 = 1;
+ float4 arg_2 = float4(1.0f);
+ tint_symbol_1.write(arg_2, uint(arg_1)); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read_write> tint_symbol_2) {
+ textureStore_0ad124(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_0ad124(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_0ad124(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.spvasm
new file mode 100644
index 0000000..c5f1090
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_0ad124 "textureStore_0ad124"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+ %22 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %29 = OpTypeFunction %v4float
+%textureStore_0ad124 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %arg_2 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %int_1
+ OpStore %arg_2 %22
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %int %arg_1
+ %28 = OpLoad %v4float %arg_2
+ OpImageWrite %26 %27 %28
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_0ad124
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_0ad124
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureStore_0ad124
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.wgsl
new file mode 100644
index 0000000..9431f5f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/0ad124.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read_write>;
+
+fn textureStore_0ad124() {
+ var arg_1 = 1i;
+ var arg_2 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_0ad124();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_0ad124();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_0ad124();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/0ade9a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/0ade9a.wgsl.expected.glsl
index cf9fa85..5d22e57 100644
--- a/test/tint/builtins/gen/var/textureStore/0ade9a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/0ade9a.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_0ade9a() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/1a264d.wgsl b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl
new file mode 100644
index 0000000..949e473
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl
@@ -0,0 +1,61 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_3d<r8unorm, write>, coords: vec3<i32>, value: vec4<f32>)
+fn textureStore_1a264d() {
+ var arg_1 = vec3<i32>(1i);
+ var arg_2 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_1a264d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_1a264d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_1a264d();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3b55dc0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_1a264d() {
+ int3 arg_1 = (1).xxx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_1a264d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_1a264d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_1a264d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3b55dc0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_1a264d() {
+ int3 arg_1 = (1).xxx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_1a264d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_1a264d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_1a264d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.glsl
new file mode 100644
index 0000000..6fad338
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.glsl
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_1a264d() {
+ ivec3 arg_1 = ivec3(1);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, arg_1, arg_2);
+}
+
+vec4 vertex_main() {
+ textureStore_1a264d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_1a264d() {
+ ivec3 arg_1 = ivec3(1);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, arg_1, arg_2);
+}
+
+void fragment_main() {
+ textureStore_1a264d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_1a264d() {
+ ivec3 arg_1 = ivec3(1);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, arg_1, arg_2);
+}
+
+void compute_main() {
+ textureStore_1a264d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.msl
new file mode 100644
index 0000000..ead97da
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_1a264d(texture3d<float, access::write> tint_symbol_1) {
+ int3 arg_1 = int3(1);
+ float4 arg_2 = float4(1.0f);
+ tint_symbol_1.write(arg_2, uint3(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureStore_1a264d(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_1a264d(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_1a264d(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.spvasm
new file mode 100644
index 0000000..9fe98f2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.spvasm
@@ -0,0 +1,85 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_1a264d "textureStore_1a264d"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %22 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+ %24 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %31 = OpTypeFunction %v4float
+%textureStore_1a264d = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3int Function %22
+ %arg_2 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %24
+ %28 = OpLoad %11 %arg_0
+ %29 = OpLoad %v3int %arg_1
+ %30 = OpLoad %v4float %arg_2
+ OpImageWrite %28 %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_1a264d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_1a264d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureStore_1a264d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.wgsl
new file mode 100644
index 0000000..efcd479
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1a264d.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, write>;
+
+fn textureStore_1a264d() {
+ var arg_1 = vec3<i32>(1i);
+ var arg_2 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_1a264d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_1a264d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_1a264d();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1a6c0b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/1a6c0b.wgsl.expected.glsl
index b2ca8f5..c943ad0 100644
--- a/test/tint/builtins/gen/var/textureStore/1a6c0b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/1a6c0b.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_1a6c0b() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl
new file mode 100644
index 0000000..27813e1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, write>, coords: vec2<i32>, array_index: i32, value: vec4<f32>)
+fn textureStore_1e79f0() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1i;
+ var arg_3 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_1e79f0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_1e79f0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_1e79f0();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..be25469
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_1e79f0() {
+ int2 arg_1 = (1).xx;
+ int arg_2 = 1;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[int3(arg_1, arg_2)] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_1e79f0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_1e79f0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_1e79f0();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..be25469
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_1e79f0() {
+ int2 arg_1 = (1).xx;
+ int arg_2 = 1;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[int3(arg_1, arg_2)] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_1e79f0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_1e79f0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_1e79f0();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.glsl
new file mode 100644
index 0000000..aa57dd2e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.glsl
@@ -0,0 +1,85 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_1e79f0() {
+ ivec2 arg_1 = ivec2(1);
+ int arg_2 = 1;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1, arg_2), arg_3);
+}
+
+vec4 vertex_main() {
+ textureStore_1e79f0();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_1e79f0() {
+ ivec2 arg_1 = ivec2(1);
+ int arg_2 = 1;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1, arg_2), arg_3);
+}
+
+void fragment_main() {
+ textureStore_1e79f0();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_1e79f0() {
+ ivec2 arg_1 = ivec2(1);
+ int arg_2 = 1;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1, arg_2), arg_3);
+}
+
+void compute_main() {
+ textureStore_1e79f0();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.msl
new file mode 100644
index 0000000..8bd5435
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_1e79f0(texture2d_array<float, access::write> tint_symbol_1) {
+ int2 arg_1 = int2(1);
+ int arg_2 = 1;
+ float4 arg_3 = float4(1.0f);
+ tint_symbol_1.write(arg_3, uint2(arg_1), arg_2);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_1e79f0(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_1e79f0(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_1e79f0(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.spvasm
new file mode 100644
index 0000000..04e02b5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.spvasm
@@ -0,0 +1,95 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 52
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_1e79f0 "textureStore_1e79f0"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %arg_3 "arg_3"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %22 = OpConstantNull %v2int
+%_ptr_Function_int = OpTypePointer Function %int
+ %25 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+ %27 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %v3int = OpTypeVector %int 3
+ %39 = OpTypeFunction %v4float
+%textureStore_1e79f0 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %22
+ %arg_2 = OpVariable %_ptr_Function_int Function %25
+ %arg_3 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %int_1
+ OpStore %arg_3 %27
+ %31 = OpLoad %11 %arg_0
+ %33 = OpLoad %v2int %arg_1
+ %34 = OpCompositeExtract %int %33 0
+ %35 = OpCompositeExtract %int %33 1
+ %36 = OpLoad %int %arg_2
+ %37 = OpCompositeConstruct %v3int %34 %35 %36
+ %38 = OpLoad %v4float %arg_3
+ OpImageWrite %31 %37 %38
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %39
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureStore_1e79f0
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %44 = OpLabel
+ %45 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %45
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureStore_1e79f0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureStore_1e79f0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.wgsl
new file mode 100644
index 0000000..a7c2f24
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/1e79f0.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, write>;
+
+fn textureStore_1e79f0() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1i;
+ var arg_3 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_1e79f0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_1e79f0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_1e79f0();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/272f5a.wgsl b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl
new file mode 100644
index 0000000..4507ab2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<i32>, array_index: u32, value: vec4<f32>)
+fn textureStore_272f5a() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1u;
+ var arg_3 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_272f5a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_272f5a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_272f5a();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ceb07fc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_272f5a() {
+ int2 arg_1 = (1).xx;
+ uint arg_2 = 1u;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[int3(arg_1, int(arg_2))] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_272f5a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_272f5a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_272f5a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ceb07fc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_272f5a() {
+ int2 arg_1 = (1).xx;
+ uint arg_2 = 1u;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[int3(arg_1, int(arg_2))] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_272f5a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_272f5a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_272f5a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.glsl
new file mode 100644
index 0000000..0a79c3d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.glsl
@@ -0,0 +1,85 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_272f5a() {
+ ivec2 arg_1 = ivec2(1);
+ uint arg_2 = 1u;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1, int(arg_2)), arg_3);
+}
+
+vec4 vertex_main() {
+ textureStore_272f5a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_272f5a() {
+ ivec2 arg_1 = ivec2(1);
+ uint arg_2 = 1u;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1, int(arg_2)), arg_3);
+}
+
+void fragment_main() {
+ textureStore_272f5a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_272f5a() {
+ ivec2 arg_1 = ivec2(1);
+ uint arg_2 = 1u;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1, int(arg_2)), arg_3);
+}
+
+void compute_main() {
+ textureStore_272f5a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.msl
new file mode 100644
index 0000000..692b48e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_272f5a(texture2d_array<float, access::read_write> tint_symbol_1) {
+ int2 arg_1 = int2(1);
+ uint arg_2 = 1u;
+ float4 arg_3 = float4(1.0f);
+ tint_symbol_1.write(arg_3, uint2(arg_1), arg_2); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_2) {
+ textureStore_272f5a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_272f5a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_272f5a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.spvasm
new file mode 100644
index 0000000..b6c8c42
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.spvasm
@@ -0,0 +1,97 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 55
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_272f5a "textureStore_272f5a"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %arg_3 "arg_3"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %22 = OpConstantNull %v2int
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %27 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+ %29 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %v3int = OpTypeVector %int 3
+ %42 = OpTypeFunction %v4float
+%textureStore_272f5a = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %22
+ %arg_2 = OpVariable %_ptr_Function_uint Function %27
+ %arg_3 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %uint_1
+ OpStore %arg_3 %29
+ %33 = OpLoad %11 %arg_0
+ %35 = OpLoad %v2int %arg_1
+ %36 = OpCompositeExtract %int %35 0
+ %37 = OpCompositeExtract %int %35 1
+ %39 = OpLoad %uint %arg_2
+ %38 = OpBitcast %int %39
+ %40 = OpCompositeConstruct %v3int %36 %37 %38
+ %41 = OpLoad %v4float %arg_3
+ OpImageWrite %33 %40 %41
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %42
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureStore_272f5a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %47 = OpLabel
+ %48 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %48
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureStore_272f5a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %53 = OpLabel
+ %54 = OpFunctionCall %void %textureStore_272f5a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.wgsl
new file mode 100644
index 0000000..a7e4349
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/272f5a.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureStore_272f5a() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1u;
+ var arg_3 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_272f5a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_272f5a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_272f5a();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/2796b4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/2796b4.wgsl.expected.glsl
index 57ef088..dfe6eea 100644
--- a/test/tint/builtins/gen/var/textureStore/2796b4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/2796b4.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
void textureStore_2796b4() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/2d2835.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/2d2835.wgsl.expected.glsl
index 8788aef..6b2daec 100644
--- a/test/tint/builtins/gen/var/textureStore/2d2835.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/2d2835.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_2d2835() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/2e512f.wgsl b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl
new file mode 100644
index 0000000..f1d6799
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl
@@ -0,0 +1,61 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_2d<r8unorm, read_write>, coords: vec2<u32>, value: vec4<f32>)
+fn textureStore_2e512f() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_2e512f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_2e512f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_2e512f();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ff8aa3d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_2e512f() {
+ uint2 arg_1 = (1u).xx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_2e512f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_2e512f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_2e512f();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ff8aa3d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_2e512f() {
+ uint2 arg_1 = (1u).xx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_2e512f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_2e512f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_2e512f();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.glsl
new file mode 100644
index 0000000..98416cd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.glsl
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_2e512f() {
+ uvec2 arg_1 = uvec2(1u);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(arg_1), arg_2);
+}
+
+vec4 vertex_main() {
+ textureStore_2e512f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_2e512f() {
+ uvec2 arg_1 = uvec2(1u);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(arg_1), arg_2);
+}
+
+void fragment_main() {
+ textureStore_2e512f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_2e512f() {
+ uvec2 arg_1 = uvec2(1u);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(arg_1), arg_2);
+}
+
+void compute_main() {
+ textureStore_2e512f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.msl
new file mode 100644
index 0000000..911336a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_2e512f(texture2d<float, access::read_write> tint_symbol_1) {
+ uint2 arg_1 = uint2(1u);
+ float4 arg_2 = float4(1.0f);
+ tint_symbol_1.write(arg_2, uint2(arg_1)); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read_write> tint_symbol_2) {
+ textureStore_2e512f(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_2e512f(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_2e512f(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.spvasm
new file mode 100644
index 0000000..64cfc46
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.spvasm
@@ -0,0 +1,84 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_2e512f "textureStore_2e512f"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %float_1 = OpConstant %float 1
+ %24 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %31 = OpTypeFunction %v4float
+%textureStore_2e512f = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
+ %arg_2 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %24
+ %28 = OpLoad %11 %arg_0
+ %29 = OpLoad %v2uint %arg_1
+ %30 = OpLoad %v4float %arg_2
+ OpImageWrite %28 %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_2e512f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_2e512f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureStore_2e512f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.wgsl
new file mode 100644
index 0000000..e256f7d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/2e512f.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read_write>;
+
+fn textureStore_2e512f() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_2e512f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_2e512f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_2e512f();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/31745b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/31745b.wgsl.expected.glsl
index 8a42240..cf9bd1c 100644
--- a/test/tint/builtins/gen/var/textureStore/31745b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/31745b.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_31745b() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/37eeef.wgsl b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl
new file mode 100644
index 0000000..613a380
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, write>, coords: vec2<i32>, array_index: u32, value: vec4<f32>)
+fn textureStore_37eeef() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1u;
+ var arg_3 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_37eeef();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_37eeef();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_37eeef();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..07f8a4b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_37eeef() {
+ int2 arg_1 = (1).xx;
+ uint arg_2 = 1u;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[int3(arg_1, int(arg_2))] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_37eeef();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_37eeef();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_37eeef();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..07f8a4b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_37eeef() {
+ int2 arg_1 = (1).xx;
+ uint arg_2 = 1u;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[int3(arg_1, int(arg_2))] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_37eeef();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_37eeef();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_37eeef();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.glsl
new file mode 100644
index 0000000..c0ea882
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.glsl
@@ -0,0 +1,85 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_37eeef() {
+ ivec2 arg_1 = ivec2(1);
+ uint arg_2 = 1u;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1, int(arg_2)), arg_3);
+}
+
+vec4 vertex_main() {
+ textureStore_37eeef();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_37eeef() {
+ ivec2 arg_1 = ivec2(1);
+ uint arg_2 = 1u;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1, int(arg_2)), arg_3);
+}
+
+void fragment_main() {
+ textureStore_37eeef();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_37eeef() {
+ ivec2 arg_1 = ivec2(1);
+ uint arg_2 = 1u;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1, int(arg_2)), arg_3);
+}
+
+void compute_main() {
+ textureStore_37eeef();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.msl
new file mode 100644
index 0000000..c27eade
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_37eeef(texture2d_array<float, access::write> tint_symbol_1) {
+ int2 arg_1 = int2(1);
+ uint arg_2 = 1u;
+ float4 arg_3 = float4(1.0f);
+ tint_symbol_1.write(arg_3, uint2(arg_1), arg_2);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_37eeef(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_37eeef(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_37eeef(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.spvasm
new file mode 100644
index 0000000..f6df02f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.spvasm
@@ -0,0 +1,98 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 55
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_37eeef "textureStore_37eeef"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %arg_3 "arg_3"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %22 = OpConstantNull %v2int
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %27 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+ %29 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %v3int = OpTypeVector %int 3
+ %42 = OpTypeFunction %v4float
+%textureStore_37eeef = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %22
+ %arg_2 = OpVariable %_ptr_Function_uint Function %27
+ %arg_3 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %uint_1
+ OpStore %arg_3 %29
+ %33 = OpLoad %11 %arg_0
+ %35 = OpLoad %v2int %arg_1
+ %36 = OpCompositeExtract %int %35 0
+ %37 = OpCompositeExtract %int %35 1
+ %39 = OpLoad %uint %arg_2
+ %38 = OpBitcast %int %39
+ %40 = OpCompositeConstruct %v3int %36 %37 %38
+ %41 = OpLoad %v4float %arg_3
+ OpImageWrite %33 %40 %41
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %42
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureStore_37eeef
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %47 = OpLabel
+ %48 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %48
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureStore_37eeef
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %53 = OpLabel
+ %54 = OpFunctionCall %void %textureStore_37eeef
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.wgsl
new file mode 100644
index 0000000..4dc58f9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/37eeef.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, write>;
+
+fn textureStore_37eeef() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1u;
+ var arg_3 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_37eeef();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_37eeef();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_37eeef();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/3d6f01.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/3d6f01.wgsl.expected.glsl
index 3298cce..73cabfc 100644
--- a/test/tint/builtins/gen/var/textureStore/3d6f01.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/3d6f01.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_3d6f01() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/3e0dc4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/3e0dc4.wgsl.expected.glsl
index 9ea9d8f..20ae07a 100644
--- a/test/tint/builtins/gen/var/textureStore/3e0dc4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/3e0dc4.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_3e0dc4() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/3fb31f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/3fb31f.wgsl.expected.glsl
index 6969389..25bf3ec 100644
--- a/test/tint/builtins/gen/var/textureStore/3fb31f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/3fb31f.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
void textureStore_3fb31f() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/43d1df.wgsl b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl
new file mode 100644
index 0000000..d3eb0a2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<i32>, array_index: i32, value: vec4<f32>)
+fn textureStore_43d1df() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1i;
+ var arg_3 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_43d1df();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_43d1df();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_43d1df();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..89fc4f0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_43d1df() {
+ int2 arg_1 = (1).xx;
+ int arg_2 = 1;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[int3(arg_1, arg_2)] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_43d1df();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_43d1df();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_43d1df();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..89fc4f0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_43d1df() {
+ int2 arg_1 = (1).xx;
+ int arg_2 = 1;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[int3(arg_1, arg_2)] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_43d1df();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_43d1df();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_43d1df();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.glsl
new file mode 100644
index 0000000..514c209
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.glsl
@@ -0,0 +1,85 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_43d1df() {
+ ivec2 arg_1 = ivec2(1);
+ int arg_2 = 1;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1, arg_2), arg_3);
+}
+
+vec4 vertex_main() {
+ textureStore_43d1df();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_43d1df() {
+ ivec2 arg_1 = ivec2(1);
+ int arg_2 = 1;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1, arg_2), arg_3);
+}
+
+void fragment_main() {
+ textureStore_43d1df();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_43d1df() {
+ ivec2 arg_1 = ivec2(1);
+ int arg_2 = 1;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1, arg_2), arg_3);
+}
+
+void compute_main() {
+ textureStore_43d1df();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.msl
new file mode 100644
index 0000000..d7e7995
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_43d1df(texture2d_array<float, access::read_write> tint_symbol_1) {
+ int2 arg_1 = int2(1);
+ int arg_2 = 1;
+ float4 arg_3 = float4(1.0f);
+ tint_symbol_1.write(arg_3, uint2(arg_1), arg_2); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_2) {
+ textureStore_43d1df(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_43d1df(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_43d1df(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.spvasm
new file mode 100644
index 0000000..11911a8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.spvasm
@@ -0,0 +1,94 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 52
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_43d1df "textureStore_43d1df"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %arg_3 "arg_3"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %22 = OpConstantNull %v2int
+%_ptr_Function_int = OpTypePointer Function %int
+ %25 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+ %27 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %v3int = OpTypeVector %int 3
+ %39 = OpTypeFunction %v4float
+%textureStore_43d1df = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %22
+ %arg_2 = OpVariable %_ptr_Function_int Function %25
+ %arg_3 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %int_1
+ OpStore %arg_3 %27
+ %31 = OpLoad %11 %arg_0
+ %33 = OpLoad %v2int %arg_1
+ %34 = OpCompositeExtract %int %33 0
+ %35 = OpCompositeExtract %int %33 1
+ %36 = OpLoad %int %arg_2
+ %37 = OpCompositeConstruct %v3int %34 %35 %36
+ %38 = OpLoad %v4float %arg_3
+ OpImageWrite %31 %37 %38
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %39
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureStore_43d1df
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %44 = OpLabel
+ %45 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %45
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureStore_43d1df
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureStore_43d1df
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.wgsl
new file mode 100644
index 0000000..e70b859
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/43d1df.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureStore_43d1df() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = 1i;
+ var arg_3 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_43d1df();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_43d1df();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_43d1df();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/473ead.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/473ead.wgsl.expected.glsl
index 61bdb66..a1dc019 100644
--- a/test/tint/builtins/gen/var/textureStore/473ead.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/473ead.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
void textureStore_473ead() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/48eae1.wgsl b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl
new file mode 100644
index 0000000..e458052
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl
@@ -0,0 +1,61 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d<r8unorm, write>, coords: vec2<i32>, value: vec4<f32>)
+fn textureStore_48eae1() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_48eae1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_48eae1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_48eae1();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9d86ada
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_48eae1() {
+ int2 arg_1 = (1).xx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_48eae1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_48eae1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_48eae1();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9d86ada
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_48eae1() {
+ int2 arg_1 = (1).xx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_48eae1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_48eae1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_48eae1();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.glsl
new file mode 100644
index 0000000..63df23a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.glsl
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_48eae1() {
+ ivec2 arg_1 = ivec2(1);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, arg_1, arg_2);
+}
+
+vec4 vertex_main() {
+ textureStore_48eae1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_48eae1() {
+ ivec2 arg_1 = ivec2(1);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, arg_1, arg_2);
+}
+
+void fragment_main() {
+ textureStore_48eae1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_48eae1() {
+ ivec2 arg_1 = ivec2(1);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, arg_1, arg_2);
+}
+
+void compute_main() {
+ textureStore_48eae1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.msl
new file mode 100644
index 0000000..5f4aaeb5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_48eae1(texture2d<float, access::write> tint_symbol_1) {
+ int2 arg_1 = int2(1);
+ float4 arg_2 = float4(1.0f);
+ tint_symbol_1.write(arg_2, uint2(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureStore_48eae1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_48eae1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_48eae1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.spvasm
new file mode 100644
index 0000000..92f5805
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.spvasm
@@ -0,0 +1,85 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_48eae1 "textureStore_48eae1"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %22 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+ %24 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %31 = OpTypeFunction %v4float
+%textureStore_48eae1 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %22
+ %arg_2 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %24
+ %28 = OpLoad %11 %arg_0
+ %29 = OpLoad %v2int %arg_1
+ %30 = OpLoad %v4float %arg_2
+ OpImageWrite %28 %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_48eae1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_48eae1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureStore_48eae1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.wgsl
new file mode 100644
index 0000000..916f94f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/48eae1.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, write>;
+
+fn textureStore_48eae1() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_48eae1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_48eae1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_48eae1();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/4c454f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/4c454f.wgsl.expected.glsl
index f5a8159..f19f7fd 100644
--- a/test/tint/builtins/gen/var/textureStore/4c454f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/4c454f.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_4c454f() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/4cce74.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/4cce74.wgsl.expected.glsl
index 77be815..c9b9ecf 100644
--- a/test/tint/builtins/gen/var/textureStore/4cce74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/4cce74.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_4cce74() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/4d359d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/4d359d.wgsl.expected.glsl
index c162198..c3d7443 100644
--- a/test/tint/builtins/gen/var/textureStore/4d359d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/4d359d.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_4d359d() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/4e2b3a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/4e2b3a.wgsl.expected.glsl
index 3ab337a..46604a8 100644
--- a/test/tint/builtins/gen/var/textureStore/4e2b3a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/4e2b3a.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_4e2b3a() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/506a71.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/506a71.wgsl.expected.glsl
index f1b6b31..ead81a6 100644
--- a/test/tint/builtins/gen/var/textureStore/506a71.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/506a71.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_506a71() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/51ec82.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/51ec82.wgsl.expected.glsl
index 3d87d97..1ca4025 100644
--- a/test/tint/builtins/gen/var/textureStore/51ec82.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/51ec82.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_51ec82() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/5425ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/5425ab.wgsl.expected.glsl
index 14a7673..c7bedac 100644
--- a/test/tint/builtins/gen/var/textureStore/5425ab.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/5425ab.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_5425ab() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/574a31.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/574a31.wgsl.expected.glsl
index c33045c..8422273 100644
--- a/test/tint/builtins/gen/var/textureStore/574a31.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/574a31.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_574a31() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/5b17eb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/5b17eb.wgsl.expected.glsl
index 2c1c7ba..7cbf952 100644
--- a/test/tint/builtins/gen/var/textureStore/5b17eb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/5b17eb.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_5b17eb() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/5bc4f3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/5bc4f3.wgsl.expected.glsl
index df07152..6da884c 100644
--- a/test/tint/builtins/gen/var/textureStore/5bc4f3.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/5bc4f3.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_5bc4f3() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/5ee194.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/5ee194.wgsl.expected.glsl
index 7c9633f..5f3aeea 100644
--- a/test/tint/builtins/gen/var/textureStore/5ee194.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/5ee194.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_5ee194() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/602b5a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/602b5a.wgsl.expected.glsl
index b3cb0af..0d769b4 100644
--- a/test/tint/builtins/gen/var/textureStore/602b5a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/602b5a.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_602b5a() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/635584.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/635584.wgsl.expected.glsl
index a654ad7..3ee1887 100644
--- a/test/tint/builtins/gen/var/textureStore/635584.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/635584.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_635584() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/63f34a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/63f34a.wgsl.expected.glsl
index d6c2a75..d95897f 100644
--- a/test/tint/builtins/gen/var/textureStore/63f34a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/63f34a.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_63f34a() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/658a74.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/658a74.wgsl.expected.glsl
index 117b097..4be6928 100644
--- a/test/tint/builtins/gen/var/textureStore/658a74.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/658a74.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_658a74() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl
new file mode 100644
index 0000000..c211d21
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl
@@ -0,0 +1,61 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_2d<r8unorm, read_write>, coords: vec2<i32>, value: vec4<f32>)
+fn textureStore_65ba8b() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_65ba8b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_65ba8b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_65ba8b();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b26c698
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_65ba8b() {
+ int2 arg_1 = (1).xx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_65ba8b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_65ba8b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_65ba8b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b26c698
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_65ba8b() {
+ int2 arg_1 = (1).xx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_65ba8b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_65ba8b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_65ba8b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.glsl
new file mode 100644
index 0000000..0859b27
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.glsl
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_65ba8b() {
+ ivec2 arg_1 = ivec2(1);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, arg_1, arg_2);
+}
+
+vec4 vertex_main() {
+ textureStore_65ba8b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_65ba8b() {
+ ivec2 arg_1 = ivec2(1);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, arg_1, arg_2);
+}
+
+void fragment_main() {
+ textureStore_65ba8b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_65ba8b() {
+ ivec2 arg_1 = ivec2(1);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, arg_1, arg_2);
+}
+
+void compute_main() {
+ textureStore_65ba8b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.msl
new file mode 100644
index 0000000..25b151e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_65ba8b(texture2d<float, access::read_write> tint_symbol_1) {
+ int2 arg_1 = int2(1);
+ float4 arg_2 = float4(1.0f);
+ tint_symbol_1.write(arg_2, uint2(arg_1)); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::read_write> tint_symbol_2) {
+ textureStore_65ba8b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_65ba8b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_65ba8b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.spvasm
new file mode 100644
index 0000000..c1ed28b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.spvasm
@@ -0,0 +1,84 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_65ba8b "textureStore_65ba8b"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v2int = OpTypeVector %int 2
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v2int %int_1 %int_1
+%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %22 = OpConstantNull %v2int
+ %float_1 = OpConstant %float 1
+ %24 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %31 = OpTypeFunction %v4float
+%textureStore_65ba8b = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %22
+ %arg_2 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %24
+ %28 = OpLoad %11 %arg_0
+ %29 = OpLoad %v2int %arg_1
+ %30 = OpLoad %v4float %arg_2
+ OpImageWrite %28 %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_65ba8b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_65ba8b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureStore_65ba8b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.wgsl
new file mode 100644
index 0000000..67a4f05
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/65ba8b.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, read_write>;
+
+fn textureStore_65ba8b() {
+ var arg_1 = vec2<i32>(1i);
+ var arg_2 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_65ba8b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_65ba8b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_65ba8b();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/682fd6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/682fd6.wgsl.expected.glsl
index d29d533..d03d25cb 100644
--- a/test/tint/builtins/gen/var/textureStore/682fd6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/682fd6.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_682fd6() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl
new file mode 100644
index 0000000..6631c7e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<u32>, array_index: i32, value: vec4<f32>)
+fn textureStore_6f0c92() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1i;
+ var arg_3 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_6f0c92();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_6f0c92();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_6f0c92();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5a659de
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_6f0c92() {
+ uint2 arg_1 = (1u).xx;
+ int arg_2 = 1;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[uint3(arg_1, uint(arg_2))] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_6f0c92();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_6f0c92();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6f0c92();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5a659de
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_6f0c92() {
+ uint2 arg_1 = (1u).xx;
+ int arg_2 = 1;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[uint3(arg_1, uint(arg_2))] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_6f0c92();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_6f0c92();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6f0c92();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.glsl
new file mode 100644
index 0000000..91e835a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.glsl
@@ -0,0 +1,85 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_6f0c92() {
+ uvec2 arg_1 = uvec2(1u);
+ int arg_2 = 1;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+}
+
+vec4 vertex_main() {
+ textureStore_6f0c92();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_6f0c92() {
+ uvec2 arg_1 = uvec2(1u);
+ int arg_2 = 1;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+}
+
+void fragment_main() {
+ textureStore_6f0c92();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_6f0c92() {
+ uvec2 arg_1 = uvec2(1u);
+ int arg_2 = 1;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+}
+
+void compute_main() {
+ textureStore_6f0c92();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.msl
new file mode 100644
index 0000000..81265c8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_6f0c92(texture2d_array<float, access::read_write> tint_symbol_1) {
+ uint2 arg_1 = uint2(1u);
+ int arg_2 = 1;
+ float4 arg_3 = float4(1.0f);
+ tint_symbol_1.write(arg_3, uint2(arg_1), arg_2); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_2) {
+ textureStore_6f0c92(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_6f0c92(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_6f0c92(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.spvasm
new file mode 100644
index 0000000..9bf4762
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.spvasm
@@ -0,0 +1,97 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 55
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_6f0c92 "textureStore_6f0c92"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %arg_3 "arg_3"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %27 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+ %29 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %v3uint = OpTypeVector %uint 3
+ %42 = OpTypeFunction %v4float
+%textureStore_6f0c92 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
+ %arg_2 = OpVariable %_ptr_Function_int Function %27
+ %arg_3 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %int_1
+ OpStore %arg_3 %29
+ %33 = OpLoad %11 %arg_0
+ %35 = OpLoad %v2uint %arg_1
+ %36 = OpCompositeExtract %uint %35 0
+ %37 = OpCompositeExtract %uint %35 1
+ %39 = OpLoad %int %arg_2
+ %38 = OpBitcast %uint %39
+ %40 = OpCompositeConstruct %v3uint %36 %37 %38
+ %41 = OpLoad %v4float %arg_3
+ OpImageWrite %33 %40 %41
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %42
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureStore_6f0c92
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %47 = OpLabel
+ %48 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %48
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureStore_6f0c92
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %53 = OpLabel
+ %54 = OpFunctionCall %void %textureStore_6f0c92
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.wgsl
new file mode 100644
index 0000000..b6ef81a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6f0c92.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureStore_6f0c92() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1i;
+ var arg_3 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_6f0c92();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_6f0c92();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_6f0c92();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl
new file mode 100644
index 0000000..f770505
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl
@@ -0,0 +1,61 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_1d<r8unorm, write>, coords: u32, value: vec4<f32>)
+fn textureStore_6fd2b1() {
+ var arg_1 = 1u;
+ var arg_2 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_6fd2b1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_6fd2b1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_6fd2b1();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0b3cd10
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_6fd2b1() {
+ uint arg_1 = 1u;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_6fd2b1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_6fd2b1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6fd2b1();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0b3cd10
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_6fd2b1() {
+ uint arg_1 = 1u;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_6fd2b1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_6fd2b1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_6fd2b1();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.glsl
new file mode 100644
index 0000000..c767840
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.glsl
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_6fd2b1() {
+ uint arg_1 = 1u;
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(uvec2(arg_1, 0u)), arg_2);
+}
+
+vec4 vertex_main() {
+ textureStore_6fd2b1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_6fd2b1() {
+ uint arg_1 = 1u;
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(uvec2(arg_1, 0u)), arg_2);
+}
+
+void fragment_main() {
+ textureStore_6fd2b1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_6fd2b1() {
+ uint arg_1 = 1u;
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(uvec2(arg_1, 0u)), arg_2);
+}
+
+void compute_main() {
+ textureStore_6fd2b1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.msl
new file mode 100644
index 0000000..f6d80df
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_6fd2b1(texture1d<float, access::write> tint_symbol_1) {
+ uint arg_1 = 1u;
+ float4 arg_2 = float4(1.0f);
+ tint_symbol_1.write(arg_2, uint(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureStore_6fd2b1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_6fd2b1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_6fd2b1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.spvasm
new file mode 100644
index 0000000..bd97fa5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.spvasm
@@ -0,0 +1,84 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_6fd2b1 "textureStore_6fd2b1"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+ %22 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %29 = OpTypeFunction %v4float
+%textureStore_6fd2b1 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %arg_2 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %uint_1
+ OpStore %arg_2 %22
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %uint %arg_1
+ %28 = OpLoad %v4float %arg_2
+ OpImageWrite %26 %27 %28
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_6fd2b1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_6fd2b1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureStore_6fd2b1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.wgsl
new file mode 100644
index 0000000..a20c5f2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/6fd2b1.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, write>;
+
+fn textureStore_6fd2b1() {
+ var arg_1 = 1u;
+ var arg_2 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_6fd2b1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_6fd2b1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_6fd2b1();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/726472.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/726472.wgsl.expected.glsl
index 7bc7e29..d4be033 100644
--- a/test/tint/builtins/gen/var/textureStore/726472.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/726472.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_726472() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/72fa64.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/72fa64.wgsl.expected.glsl
index 124e703..fcc98fd 100644
--- a/test/tint/builtins/gen/var/textureStore/72fa64.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/72fa64.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_72fa64() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/74886f.wgsl b/test/tint/builtins/gen/var/textureStore/74886f.wgsl
new file mode 100644
index 0000000..7cd4df3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/74886f.wgsl
@@ -0,0 +1,61 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_1d<r8unorm, write>, coords: i32, value: vec4<f32>)
+fn textureStore_74886f() {
+ var arg_1 = 1i;
+ var arg_2 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_74886f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_74886f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_74886f();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a451af2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_74886f() {
+ int arg_1 = 1;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_74886f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_74886f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_74886f();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a451af2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_74886f() {
+ int arg_1 = 1;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_74886f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_74886f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_74886f();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.glsl
new file mode 100644
index 0000000..0858532
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.glsl
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_74886f() {
+ int arg_1 = 1;
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(arg_1, 0), arg_2);
+}
+
+vec4 vertex_main() {
+ textureStore_74886f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_74886f() {
+ int arg_1 = 1;
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(arg_1, 0), arg_2);
+}
+
+void fragment_main() {
+ textureStore_74886f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_74886f() {
+ int arg_1 = 1;
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(arg_1, 0), arg_2);
+}
+
+void compute_main() {
+ textureStore_74886f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.msl
new file mode 100644
index 0000000..371f45d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_74886f(texture1d<float, access::write> tint_symbol_1) {
+ int arg_1 = 1;
+ float4 arg_2 = float4(1.0f);
+ tint_symbol_1.write(arg_2, uint(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureStore_74886f(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_74886f(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_74886f(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.spvasm
new file mode 100644
index 0000000..a5c917a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.spvasm
@@ -0,0 +1,84 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_74886f "textureStore_74886f"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+ %22 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %29 = OpTypeFunction %v4float
+%textureStore_74886f = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %arg_2 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %int_1
+ OpStore %arg_2 %22
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %int %arg_1
+ %28 = OpLoad %v4float %arg_2
+ OpImageWrite %26 %27 %28
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_74886f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_74886f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureStore_74886f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.wgsl
new file mode 100644
index 0000000..c9ffb8c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/74886f.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, write>;
+
+fn textureStore_74886f() {
+ var arg_1 = 1i;
+ var arg_2 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_74886f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_74886f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_74886f();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/75bbd5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/75bbd5.wgsl.expected.glsl
index 936a46d..3635060 100644
--- a/test/tint/builtins/gen/var/textureStore/75bbd5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/75bbd5.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_75bbd5() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/7792fa.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/7792fa.wgsl.expected.glsl
index 5d8c208..06dc945 100644
--- a/test/tint/builtins/gen/var/textureStore/7792fa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/7792fa.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
void textureStore_7792fa() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/7b8f86.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/7b8f86.wgsl.expected.glsl
index ff9ba3c..9be7e43 100644
--- a/test/tint/builtins/gen/var/textureStore/7b8f86.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/7b8f86.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
void textureStore_7b8f86() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/7bb211.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/7bb211.wgsl.expected.glsl
index 66717db..36e8f1b 100644
--- a/test/tint/builtins/gen/var/textureStore/7bb211.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/7bb211.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_7bb211() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/803a10.wgsl b/test/tint/builtins/gen/var/textureStore/803a10.wgsl
new file mode 100644
index 0000000..131e4d0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/803a10.wgsl
@@ -0,0 +1,61 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_3d<r8unorm, read_write>, coords: vec3<u32>, value: vec4<f32>)
+fn textureStore_803a10() {
+ var arg_1 = vec3<u32>(1u);
+ var arg_2 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_803a10();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_803a10();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_803a10();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8db82d0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_803a10() {
+ uint3 arg_1 = (1u).xxx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_803a10();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_803a10();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_803a10();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8db82d0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_803a10() {
+ uint3 arg_1 = (1u).xxx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_803a10();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_803a10();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_803a10();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.glsl
new file mode 100644
index 0000000..c4d2573
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.glsl
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_803a10() {
+ uvec3 arg_1 = uvec3(1u);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1), arg_2);
+}
+
+vec4 vertex_main() {
+ textureStore_803a10();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_803a10() {
+ uvec3 arg_1 = uvec3(1u);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1), arg_2);
+}
+
+void fragment_main() {
+ textureStore_803a10();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_803a10() {
+ uvec3 arg_1 = uvec3(1u);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1), arg_2);
+}
+
+void compute_main() {
+ textureStore_803a10();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.msl
new file mode 100644
index 0000000..bb33ede
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_803a10(texture3d<float, access::read_write> tint_symbol_1) {
+ uint3 arg_1 = uint3(1u);
+ float4 arg_2 = float4(1.0f);
+ tint_symbol_1.write(arg_2, uint3(arg_1)); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read_write> tint_symbol_2) {
+ textureStore_803a10(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_803a10(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_803a10(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.spvasm
new file mode 100644
index 0000000..bf7eeea
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.spvasm
@@ -0,0 +1,84 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_803a10 "textureStore_803a10"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+ %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %float_1 = OpConstant %float 1
+ %24 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %31 = OpTypeFunction %v4float
+%textureStore_803a10 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3uint Function %22
+ %arg_2 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %24
+ %28 = OpLoad %11 %arg_0
+ %29 = OpLoad %v3uint %arg_1
+ %30 = OpLoad %v4float %arg_2
+ OpImageWrite %28 %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_803a10
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_803a10
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureStore_803a10
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.wgsl
new file mode 100644
index 0000000..fa6fafb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/803a10.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read_write>;
+
+fn textureStore_803a10() {
+ var arg_1 = vec3<u32>(1u);
+ var arg_2 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_803a10();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_803a10();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_803a10();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/80bf1d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/80bf1d.wgsl.expected.glsl
index 765c5cd..329e61a 100644
--- a/test/tint/builtins/gen/var/textureStore/80bf1d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/80bf1d.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_80bf1d() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/820272.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/820272.wgsl.expected.glsl
index ebb4ee6..6b6961a 100644
--- a/test/tint/builtins/gen/var/textureStore/820272.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/820272.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_820272() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/83bcc1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/83bcc1.wgsl.expected.glsl
index 141e394..7e9a848 100644
--- a/test/tint/builtins/gen/var/textureStore/83bcc1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/83bcc1.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_83bcc1() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/84d435.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/84d435.wgsl.expected.glsl
index 25695f8..639f6df 100644
--- a/test/tint/builtins/gen/var/textureStore/84d435.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/84d435.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_84d435() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/872747.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/872747.wgsl.expected.glsl
index c51fdc1..e76a667 100644
--- a/test/tint/builtins/gen/var/textureStore/872747.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/872747.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_872747() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/8a8681.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/8a8681.wgsl.expected.glsl
index 7bb5d67..8538872 100644
--- a/test/tint/builtins/gen/var/textureStore/8a8681.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/8a8681.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_8a8681() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/8cd611.wgsl b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl
new file mode 100644
index 0000000..5a08e30
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl
@@ -0,0 +1,61 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_3d<r8unorm, write>, coords: vec3<u32>, value: vec4<f32>)
+fn textureStore_8cd611() {
+ var arg_1 = vec3<u32>(1u);
+ var arg_2 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_8cd611();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_8cd611();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_8cd611();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..7db281b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_8cd611() {
+ uint3 arg_1 = (1u).xxx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_8cd611();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_8cd611();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_8cd611();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..7db281b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_8cd611() {
+ uint3 arg_1 = (1u).xxx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_8cd611();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_8cd611();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_8cd611();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.glsl
new file mode 100644
index 0000000..b791e3d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.glsl
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_8cd611() {
+ uvec3 arg_1 = uvec3(1u);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1), arg_2);
+}
+
+vec4 vertex_main() {
+ textureStore_8cd611();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_8cd611() {
+ uvec3 arg_1 = uvec3(1u);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1), arg_2);
+}
+
+void fragment_main() {
+ textureStore_8cd611();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_8cd611() {
+ uvec3 arg_1 = uvec3(1u);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec3(arg_1), arg_2);
+}
+
+void compute_main() {
+ textureStore_8cd611();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.msl
new file mode 100644
index 0000000..bcc117f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_8cd611(texture3d<float, access::write> tint_symbol_1) {
+ uint3 arg_1 = uint3(1u);
+ float4 arg_2 = float4(1.0f);
+ tint_symbol_1.write(arg_2, uint3(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureStore_8cd611(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_8cd611(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_8cd611(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.spvasm
new file mode 100644
index 0000000..3e57d82
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.spvasm
@@ -0,0 +1,85 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_8cd611 "textureStore_8cd611"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+ %19 = OpConstantComposite %v3uint %uint_1 %uint_1 %uint_1
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %float_1 = OpConstant %float 1
+ %24 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %31 = OpTypeFunction %v4float
+%textureStore_8cd611 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3uint Function %22
+ %arg_2 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %24
+ %28 = OpLoad %11 %arg_0
+ %29 = OpLoad %v3uint %arg_1
+ %30 = OpLoad %v4float %arg_2
+ OpImageWrite %28 %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_8cd611
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_8cd611
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureStore_8cd611
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.wgsl
new file mode 100644
index 0000000..e22b597
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/8cd611.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, write>;
+
+fn textureStore_8cd611() {
+ var arg_1 = vec3<u32>(1u);
+ var arg_2 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_8cd611();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_8cd611();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_8cd611();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl
new file mode 100644
index 0000000..aa39a9e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl
@@ -0,0 +1,61 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d<r8unorm, write>, coords: vec2<u32>, value: vec4<f32>)
+fn textureStore_9e5bc2() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_9e5bc2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_9e5bc2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_9e5bc2();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1c07eae
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_9e5bc2() {
+ uint2 arg_1 = (1u).xx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_9e5bc2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_9e5bc2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_9e5bc2();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1c07eae
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureStore_9e5bc2() {
+ uint2 arg_1 = (1u).xx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_9e5bc2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_9e5bc2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_9e5bc2();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.glsl
new file mode 100644
index 0000000..91d334a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.glsl
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_9e5bc2() {
+ uvec2 arg_1 = uvec2(1u);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(arg_1), arg_2);
+}
+
+vec4 vertex_main() {
+ textureStore_9e5bc2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_9e5bc2() {
+ uvec2 arg_1 = uvec2(1u);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(arg_1), arg_2);
+}
+
+void fragment_main() {
+ textureStore_9e5bc2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_9e5bc2() {
+ uvec2 arg_1 = uvec2(1u);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(arg_1), arg_2);
+}
+
+void compute_main() {
+ textureStore_9e5bc2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.msl
new file mode 100644
index 0000000..8098299
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_9e5bc2(texture2d<float, access::write> tint_symbol_1) {
+ uint2 arg_1 = uint2(1u);
+ float4 arg_2 = float4(1.0f);
+ tint_symbol_1.write(arg_2, uint2(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureStore_9e5bc2(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_9e5bc2(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_9e5bc2(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.spvasm
new file mode 100644
index 0000000..535ed4a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.spvasm
@@ -0,0 +1,85 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_9e5bc2 "textureStore_9e5bc2"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %float_1 = OpConstant %float 1
+ %24 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %31 = OpTypeFunction %v4float
+%textureStore_9e5bc2 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
+ %arg_2 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %24
+ %28 = OpLoad %11 %arg_0
+ %29 = OpLoad %v2uint %arg_1
+ %30 = OpLoad %v4float %arg_2
+ OpImageWrite %28 %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_9e5bc2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_9e5bc2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureStore_9e5bc2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.wgsl
new file mode 100644
index 0000000..717a13b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/9e5bc2.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r8unorm, write>;
+
+fn textureStore_9e5bc2() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_9e5bc2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_9e5bc2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_9e5bc2();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/9f5318.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/9f5318.wgsl.expected.glsl
index 59659bd..458cd61 100644
--- a/test/tint/builtins/gen/var/textureStore/9f5318.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/9f5318.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_9f5318() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/a702b6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/a702b6.wgsl.expected.glsl
index dd6deb1..0ca4642 100644
--- a/test/tint/builtins/gen/var/textureStore/a702b6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/a702b6.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_a702b6() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl
new file mode 100644
index 0000000..3a53b3f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl
@@ -0,0 +1,61 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_1d<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_1d<r8unorm, read_write>, coords: u32, value: vec4<f32>)
+fn textureStore_a7fc47() {
+ var arg_1 = 1u;
+ var arg_2 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_a7fc47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_a7fc47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_a7fc47();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..815676f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_a7fc47() {
+ uint arg_1 = 1u;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_a7fc47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_a7fc47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_a7fc47();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..815676f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureStore_a7fc47() {
+ uint arg_1 = 1u;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_a7fc47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_a7fc47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_a7fc47();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.glsl
new file mode 100644
index 0000000..b5f3a38
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.glsl
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_a7fc47() {
+ uint arg_1 = 1u;
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(uvec2(arg_1, 0u)), arg_2);
+}
+
+vec4 vertex_main() {
+ textureStore_a7fc47();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_a7fc47() {
+ uint arg_1 = 1u;
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(uvec2(arg_1, 0u)), arg_2);
+}
+
+void fragment_main() {
+ textureStore_a7fc47();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2D arg_0;
+void textureStore_a7fc47() {
+ uint arg_1 = 1u;
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, ivec2(uvec2(arg_1, 0u)), arg_2);
+}
+
+void compute_main() {
+ textureStore_a7fc47();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.msl
new file mode 100644
index 0000000..211f531
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_a7fc47(texture1d<float, access::read_write> tint_symbol_1) {
+ uint arg_1 = 1u;
+ float4 arg_2 = float4(1.0f);
+ tint_symbol_1.write(arg_2, uint(arg_1)); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::read_write> tint_symbol_2) {
+ textureStore_a7fc47(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_a7fc47(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_a7fc47(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.spvasm
new file mode 100644
index 0000000..e3576ea
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_a7fc47 "textureStore_a7fc47"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+ %22 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %29 = OpTypeFunction %v4float
+%textureStore_a7fc47 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %arg_2 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %uint_1
+ OpStore %arg_2 %22
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %uint %arg_1
+ %28 = OpLoad %v4float %arg_2
+ OpImageWrite %26 %27 %28
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_a7fc47
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_a7fc47
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureStore_a7fc47
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.wgsl
new file mode 100644
index 0000000..b0eb039
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/a7fc47.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r8unorm, read_write>;
+
+fn textureStore_a7fc47() {
+ var arg_1 = 1u;
+ var arg_2 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_a7fc47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_a7fc47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_a7fc47();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/a9298c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/a9298c.wgsl.expected.glsl
index f17b263..99c44f6 100644
--- a/test/tint/builtins/gen/var/textureStore/a9298c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/a9298c.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_a9298c() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/ab788e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/ab788e.wgsl.expected.glsl
index a63db74..dcd9fd5 100644
--- a/test/tint/builtins/gen/var/textureStore/ab788e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/ab788e.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2D arg_0;
void textureStore_ab788e() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/ac67aa.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/ac67aa.wgsl.expected.glsl
index 620e3d8..0d72d0b 100644
--- a/test/tint/builtins/gen/var/textureStore/ac67aa.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/ac67aa.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
void textureStore_ac67aa() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl
new file mode 100644
index 0000000..4a96fab
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, read_write>, coords: vec2<u32>, array_index: u32, value: vec4<f32>)
+fn textureStore_ae6a2a() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1u;
+ var arg_3 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_ae6a2a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_ae6a2a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_ae6a2a();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9973199
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_ae6a2a() {
+ uint2 arg_1 = (1u).xx;
+ uint arg_2 = 1u;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[uint3(arg_1, arg_2)] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_ae6a2a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_ae6a2a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_ae6a2a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9973199
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_ae6a2a() {
+ uint2 arg_1 = (1u).xx;
+ uint arg_2 = 1u;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[uint3(arg_1, arg_2)] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_ae6a2a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_ae6a2a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_ae6a2a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.glsl
new file mode 100644
index 0000000..0a6183c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.glsl
@@ -0,0 +1,85 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_ae6a2a() {
+ uvec2 arg_1 = uvec2(1u);
+ uint arg_2 = 1u;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(uvec3(arg_1, arg_2)), arg_3);
+}
+
+vec4 vertex_main() {
+ textureStore_ae6a2a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_ae6a2a() {
+ uvec2 arg_1 = uvec2(1u);
+ uint arg_2 = 1u;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(uvec3(arg_1, arg_2)), arg_3);
+}
+
+void fragment_main() {
+ textureStore_ae6a2a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_ae6a2a() {
+ uvec2 arg_1 = uvec2(1u);
+ uint arg_2 = 1u;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(uvec3(arg_1, arg_2)), arg_3);
+}
+
+void compute_main() {
+ textureStore_ae6a2a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.msl
new file mode 100644
index 0000000..5a4d511
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_ae6a2a(texture2d_array<float, access::read_write> tint_symbol_1) {
+ uint2 arg_1 = uint2(1u);
+ uint arg_2 = 1u;
+ float4 arg_3 = float4(1.0f);
+ tint_symbol_1.write(arg_3, uint2(arg_1), arg_2); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::read_write> tint_symbol_2) {
+ textureStore_ae6a2a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_ae6a2a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_ae6a2a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.spvasm
new file mode 100644
index 0000000..bafeeef
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.spvasm
@@ -0,0 +1,94 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 52
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_ae6a2a "textureStore_ae6a2a"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %arg_3 "arg_3"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+ %27 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %v3uint = OpTypeVector %uint 3
+ %39 = OpTypeFunction %v4float
+%textureStore_ae6a2a = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
+ %arg_2 = OpVariable %_ptr_Function_uint Function %25
+ %arg_3 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %uint_1
+ OpStore %arg_3 %27
+ %31 = OpLoad %11 %arg_0
+ %33 = OpLoad %v2uint %arg_1
+ %34 = OpCompositeExtract %uint %33 0
+ %35 = OpCompositeExtract %uint %33 1
+ %36 = OpLoad %uint %arg_2
+ %37 = OpCompositeConstruct %v3uint %34 %35 %36
+ %38 = OpLoad %v4float %arg_3
+ OpImageWrite %31 %37 %38
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %39
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureStore_ae6a2a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %44 = OpLabel
+ %45 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %45
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureStore_ae6a2a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureStore_ae6a2a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.wgsl
new file mode 100644
index 0000000..6b20afb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ae6a2a.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, read_write>;
+
+fn textureStore_ae6a2a() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1u;
+ var arg_3 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_ae6a2a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_ae6a2a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_ae6a2a();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/b71c13.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/b71c13.wgsl.expected.glsl
index 4b1ba5c..b87bba4 100644
--- a/test/tint/builtins/gen/var/textureStore/b71c13.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/b71c13.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_b71c13() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/b77161.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/b77161.wgsl.expected.glsl
index 4986ff9..daebd52 100644
--- a/test/tint/builtins/gen/var/textureStore/b77161.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/b77161.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2D arg_0;
void textureStore_b77161() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/b91b86.wgsl b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl
new file mode 100644
index 0000000..5e6685f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, write>, coords: vec2<u32>, array_index: i32, value: vec4<f32>)
+fn textureStore_b91b86() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1i;
+ var arg_3 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_b91b86();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_b91b86();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_b91b86();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a2cacf3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_b91b86() {
+ uint2 arg_1 = (1u).xx;
+ int arg_2 = 1;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[uint3(arg_1, uint(arg_2))] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_b91b86();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_b91b86();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_b91b86();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a2cacf3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_b91b86() {
+ uint2 arg_1 = (1u).xx;
+ int arg_2 = 1;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[uint3(arg_1, uint(arg_2))] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_b91b86();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_b91b86();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_b91b86();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.glsl
new file mode 100644
index 0000000..fcdeb07
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.glsl
@@ -0,0 +1,85 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_b91b86() {
+ uvec2 arg_1 = uvec2(1u);
+ int arg_2 = 1;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+}
+
+vec4 vertex_main() {
+ textureStore_b91b86();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_b91b86() {
+ uvec2 arg_1 = uvec2(1u);
+ int arg_2 = 1;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+}
+
+void fragment_main() {
+ textureStore_b91b86();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_b91b86() {
+ uvec2 arg_1 = uvec2(1u);
+ int arg_2 = 1;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(uvec3(arg_1, uint(arg_2))), arg_3);
+}
+
+void compute_main() {
+ textureStore_b91b86();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.msl
new file mode 100644
index 0000000..62e66f1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_b91b86(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 arg_1 = uint2(1u);
+ int arg_2 = 1;
+ float4 arg_3 = float4(1.0f);
+ tint_symbol_1.write(arg_3, uint2(arg_1), arg_2);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_b91b86(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_b91b86(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_b91b86(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.spvasm
new file mode 100644
index 0000000..829e135
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.spvasm
@@ -0,0 +1,98 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 55
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_b91b86 "textureStore_b91b86"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %arg_3 "arg_3"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %27 = OpConstantNull %int
+ %float_1 = OpConstant %float 1
+ %29 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %v3uint = OpTypeVector %uint 3
+ %42 = OpTypeFunction %v4float
+%textureStore_b91b86 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
+ %arg_2 = OpVariable %_ptr_Function_int Function %27
+ %arg_3 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %int_1
+ OpStore %arg_3 %29
+ %33 = OpLoad %11 %arg_0
+ %35 = OpLoad %v2uint %arg_1
+ %36 = OpCompositeExtract %uint %35 0
+ %37 = OpCompositeExtract %uint %35 1
+ %39 = OpLoad %int %arg_2
+ %38 = OpBitcast %uint %39
+ %40 = OpCompositeConstruct %v3uint %36 %37 %38
+ %41 = OpLoad %v4float %arg_3
+ OpImageWrite %33 %40 %41
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %42
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureStore_b91b86
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %47 = OpLabel
+ %48 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %48
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureStore_b91b86
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %53 = OpLabel
+ %54 = OpFunctionCall %void %textureStore_b91b86
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.wgsl
new file mode 100644
index 0000000..a813fdb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/b91b86.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, write>;
+
+fn textureStore_b91b86() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1i;
+ var arg_3 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_b91b86();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_b91b86();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_b91b86();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/b9c81a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/b9c81a.wgsl.expected.glsl
index ffe8525..a71b0c7 100644
--- a/test/tint/builtins/gen/var/textureStore/b9c81a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/b9c81a.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage3D arg_0;
void textureStore_b9c81a() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/bd6602.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/bd6602.wgsl.expected.glsl
index cd55c67..1362b3a 100644
--- a/test/tint/builtins/gen/var/textureStore/bd6602.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/bd6602.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_bd6602() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/c33478.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/c33478.wgsl.expected.glsl
index 0a3cf44..7314732 100644
--- a/test/tint/builtins/gen/var/textureStore/c33478.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/c33478.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
void textureStore_c33478() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/c863be.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/c863be.wgsl.expected.glsl
index aa392de..90d2286 100644
--- a/test/tint/builtins/gen/var/textureStore/c863be.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/c863be.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_c863be() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/d19db4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/d19db4.wgsl.expected.glsl
index c0a2866..8c7ca7c 100644
--- a/test/tint/builtins/gen/var/textureStore/d19db4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/d19db4.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
void textureStore_d19db4() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/d73b5c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/d73b5c.wgsl.expected.glsl
index 1dd9797..086b00a 100644
--- a/test/tint/builtins/gen/var/textureStore/d73b5c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/d73b5c.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_d73b5c() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/d82b0a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/d82b0a.wgsl.expected.glsl
index 64606cf..9c985fe 100644
--- a/test/tint/builtins/gen/var/textureStore/d82b0a.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/d82b0a.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage3D arg_0;
void textureStore_d82b0a() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/dde364.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/dde364.wgsl.expected.glsl
index f26a692..5c097df 100644
--- a/test/tint/builtins/gen/var/textureStore/dde364.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/dde364.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_dde364() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/dfa9a1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/dfa9a1.wgsl.expected.glsl
index c9c8ed2..acf78d1 100644
--- a/test/tint/builtins/gen/var/textureStore/dfa9a1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/dfa9a1.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image2DArray arg_0;
void textureStore_dfa9a1() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/dffb13.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/dffb13.wgsl.expected.glsl
index 8661af8..2905def 100644
--- a/test/tint/builtins/gen/var/textureStore/dffb13.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/dffb13.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
void textureStore_dffb13() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/e077e7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/e077e7.wgsl.expected.glsl
index 4c90b90..2ed4836 100644
--- a/test/tint/builtins/gen/var/textureStore/e077e7.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/e077e7.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2D arg_0;
void textureStore_e077e7() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/ea30d2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/ea30d2.wgsl.expected.glsl
index 84bea7d..cac7071 100644
--- a/test/tint/builtins/gen/var/textureStore/ea30d2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/ea30d2.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_ea30d2() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/ed6198.wgsl b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl
new file mode 100644
index 0000000..c7b821c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl
@@ -0,0 +1,61 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_3d<r8unorm, read_write>;
+
+// fn textureStore(texture: texture_storage_3d<r8unorm, read_write>, coords: vec3<i32>, value: vec4<f32>)
+fn textureStore_ed6198() {
+ var arg_1 = vec3<i32>(1i);
+ var arg_2 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_ed6198();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_ed6198();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_ed6198();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..372776f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_ed6198() {
+ int3 arg_1 = (1).xxx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_ed6198();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_ed6198();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_ed6198();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..372776f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureStore_ed6198() {
+ int3 arg_1 = (1).xxx;
+ float4 arg_2 = (1.0f).xxxx;
+ arg_0[arg_1] = arg_2;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_ed6198();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_ed6198();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_ed6198();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.glsl
new file mode 100644
index 0000000..7b3beb7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.glsl
@@ -0,0 +1,82 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_ed6198() {
+ ivec3 arg_1 = ivec3(1);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, arg_1, arg_2);
+}
+
+vec4 vertex_main() {
+ textureStore_ed6198();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_ed6198() {
+ ivec3 arg_1 = ivec3(1);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, arg_1, arg_2);
+}
+
+void fragment_main() {
+ textureStore_ed6198();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image3D arg_0;
+void textureStore_ed6198() {
+ ivec3 arg_1 = ivec3(1);
+ vec4 arg_2 = vec4(1.0f);
+ imageStore(arg_0, arg_1, arg_2);
+}
+
+void compute_main() {
+ textureStore_ed6198();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.msl
new file mode 100644
index 0000000..108e46c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.msl
@@ -0,0 +1,35 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_ed6198(texture3d<float, access::read_write> tint_symbol_1) {
+ int3 arg_1 = int3(1);
+ float4 arg_2 = float4(1.0f);
+ tint_symbol_1.write(arg_2, uint3(arg_1)); tint_symbol_1.fence();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::read_write> tint_symbol_2) {
+ textureStore_ed6198(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::read_write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::read_write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_ed6198(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::read_write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_ed6198(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.spvasm
new file mode 100644
index 0000000..e9527c9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.spvasm
@@ -0,0 +1,84 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_ed6198 "textureStore_ed6198"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %v3int = OpTypeVector %int 3
+ %int_1 = OpConstant %int 1
+ %19 = OpConstantComposite %v3int %int_1 %int_1 %int_1
+%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %22 = OpConstantNull %v3int
+ %float_1 = OpConstant %float 1
+ %24 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %31 = OpTypeFunction %v4float
+%textureStore_ed6198 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3int Function %22
+ %arg_2 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %24
+ %28 = OpLoad %11 %arg_0
+ %29 = OpLoad %v3int %arg_1
+ %30 = OpLoad %v4float %arg_2
+ OpImageWrite %28 %29 %30
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_ed6198
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_ed6198
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureStore_ed6198
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.wgsl
new file mode 100644
index 0000000..f38729b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/ed6198.wgsl.expected.wgsl
@@ -0,0 +1,25 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r8unorm, read_write>;
+
+fn textureStore_ed6198() {
+ var arg_1 = vec3<i32>(1i);
+ var arg_2 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_ed6198();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_ed6198();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_ed6198();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/ee6acc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/ee6acc.wgsl.expected.glsl
index 6cdcb52..6b424cf 100644
--- a/test/tint/builtins/gen/var/textureStore/ee6acc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/ee6acc.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
void textureStore_ee6acc() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl
new file mode 100644
index 0000000..311b077
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl
@@ -0,0 +1,62 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by 'tools/src/cmd/gen' using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// To regenerate run: './tools/run gen'
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+enable chromium_internal_graphite;
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r8unorm, write>;
+
+// fn textureStore(texture: texture_storage_2d_array<r8unorm, write>, coords: vec2<u32>, array_index: u32, value: vec4<f32>)
+fn textureStore_f7b0ab() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1u;
+ var arg_3 = vec4<f32>(1.f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_f7b0ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_f7b0ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_f7b0ab();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8490de7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_f7b0ab() {
+ uint2 arg_1 = (1u).xx;
+ uint arg_2 = 1u;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[uint3(arg_1, arg_2)] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_f7b0ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_f7b0ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_f7b0ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8490de7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureStore_f7b0ab() {
+ uint2 arg_1 = (1u).xx;
+ uint arg_2 = 1u;
+ float4 arg_3 = (1.0f).xxxx;
+ arg_0[uint3(arg_1, arg_2)] = arg_3;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureStore_f7b0ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureStore_f7b0ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureStore_f7b0ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.glsl
new file mode 100644
index 0000000..1a34016
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.glsl
@@ -0,0 +1,85 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_f7b0ab() {
+ uvec2 arg_1 = uvec2(1u);
+ uint arg_2 = 1u;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(uvec3(arg_1, arg_2)), arg_3);
+}
+
+vec4 vertex_main() {
+ textureStore_f7b0ab();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision highp float;
+precision highp int;
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_f7b0ab() {
+ uvec2 arg_1 = uvec2(1u);
+ uint arg_2 = 1u;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(uvec3(arg_1, arg_2)), arg_3);
+}
+
+void fragment_main() {
+ textureStore_f7b0ab();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r8) uniform highp writeonly image2DArray arg_0;
+void textureStore_f7b0ab() {
+ uvec2 arg_1 = uvec2(1u);
+ uint arg_2 = 1u;
+ vec4 arg_3 = vec4(1.0f);
+ imageStore(arg_0, ivec3(uvec3(arg_1, arg_2)), arg_3);
+}
+
+void compute_main() {
+ textureStore_f7b0ab();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+error: Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.msl b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.msl
new file mode 100644
index 0000000..e8aa3b0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.msl
@@ -0,0 +1,36 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureStore_f7b0ab(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 arg_1 = uint2(1u);
+ uint arg_2 = 1u;
+ float4 arg_3 = float4(1.0f);
+ tint_symbol_1.write(arg_3, uint2(arg_1), arg_2);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureStore_f7b0ab(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureStore_f7b0ab(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureStore_f7b0ab(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..47ceb4d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.spvasm
@@ -0,0 +1,95 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 52
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureStore_f7b0ab "textureStore_f7b0ab"
+ OpName %arg_1 "arg_1"
+ OpName %arg_2 "arg_2"
+ OpName %arg_3 "arg_3"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+ %19 = OpConstantComposite %v2uint %uint_1 %uint_1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %float_1 = OpConstant %float 1
+ %27 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %v3uint = OpTypeVector %uint 3
+ %39 = OpTypeFunction %v4float
+%textureStore_f7b0ab = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %22
+ %arg_2 = OpVariable %_ptr_Function_uint Function %25
+ %arg_3 = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %arg_1 %19
+ OpStore %arg_2 %uint_1
+ OpStore %arg_3 %27
+ %31 = OpLoad %11 %arg_0
+ %33 = OpLoad %v2uint %arg_1
+ %34 = OpCompositeExtract %uint %33 0
+ %35 = OpCompositeExtract %uint %33 1
+ %36 = OpLoad %uint %arg_2
+ %37 = OpCompositeConstruct %v3uint %34 %35 %36
+ %38 = OpLoad %v4float %arg_3
+ OpImageWrite %31 %37 %38
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %39
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureStore_f7b0ab
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %44 = OpLabel
+ %45 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %45
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureStore_f7b0ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %textureStore_f7b0ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..e0d9c70
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureStore/f7b0ab.wgsl.expected.wgsl
@@ -0,0 +1,26 @@
+enable chromium_internal_graphite;
+
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r8unorm, write>;
+
+fn textureStore_f7b0ab() {
+ var arg_1 = vec2<u32>(1u);
+ var arg_2 = 1u;
+ var arg_3 = vec4<f32>(1.0f);
+ textureStore(arg_0, arg_1, arg_2, arg_3);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureStore_f7b0ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureStore_f7b0ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureStore_f7b0ab();
+}
diff --git a/test/tint/builtins/gen/var/textureStore/f9be83.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/f9be83.wgsl.expected.glsl
index 0b47304..bb87800 100644
--- a/test/tint/builtins/gen/var/textureStore/f9be83.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/f9be83.wgsl.expected.glsl
@@ -32,6 +32,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
void textureStore_f9be83() {
@@ -50,8 +51,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/gen/var/textureStore/fcbe66.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureStore/fcbe66.wgsl.expected.glsl
index 5992f40..f79817f 100644
--- a/test/tint/builtins/gen/var/textureStore/fcbe66.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureStore/fcbe66.wgsl.expected.glsl
@@ -31,6 +31,7 @@
#version 310 es
precision highp float;
+precision highp int;
layout(rg32f) uniform highp writeonly image3D arg_0;
void textureStore_fcbe66() {
@@ -48,8 +49,8 @@
return;
}
error: Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
+ERROR: 0:5: 'image load-store format' : not supported with this profile: es
+ERROR: 0:5: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/tools/src/cmd/gen/templates/templates.go b/tools/src/cmd/gen/templates/templates.go
index 783b4ed..d8191c8 100644
--- a/tools/src/cmd/gen/templates/templates.go
+++ b/tools/src/cmd/gen/templates/templates.go
@@ -311,7 +311,7 @@
"IsAbstract": gen.IsAbstract,
"IsDeclarable": gen.IsDeclarable,
"IsHostShareable": gen.IsHostShareable,
- "OverloadUsesF16": gen.OverloadUsesF16,
+ "OverloadUsesType": gen.OverloadUsesType,
"OverloadUsesReadWriteStorageTexture": gen.OverloadUsesReadWriteStorageTexture,
"IsFirstIn": isFirstIn,
"IsLastIn": isLastIn,
diff --git a/tools/src/tint/intrinsic/gen/gen.go b/tools/src/tint/intrinsic/gen/gen.go
index 79ff6c9..a50d1c0 100644
--- a/tools/src/tint/intrinsic/gen/gen.go
+++ b/tools/src/tint/intrinsic/gen/gen.go
@@ -563,18 +563,35 @@
return IsDeclarable(fqn) && DeepestElementType(fqn).Target.GetName() != "bool"
}
-// OverloadUsesF16 returns true if the overload uses the f16 type anywhere in the signature.
-func OverloadUsesF16(overload sem.Overload) bool {
+// OverloadUsesType returns true if the overload uses the given type anywhere in the signature.
+func OverloadUsesType(overload sem.Overload, ty string) bool {
+ pending := []sem.FullyQualifiedName{}
for _, param := range overload.Parameters {
- if DeepestElementType(param.Type).Target.GetName() == "f16" {
- return true
- }
+ pending = append(pending, param.Type)
}
if ret := overload.ReturnType; ret != nil {
- if DeepestElementType(*overload.ReturnType).Target.GetName() == "f16" {
+ pending = append(pending, *ret)
+ }
+
+ for len(pending) > 0 {
+ fqn := pending[len(pending)-1]
+ pending = pending[:len(pending)-1]
+
+ if fqn.Target.GetName() == ty {
return true
}
+ for _, arg := range fqn.TemplateArguments {
+ switch arg := arg.(type) {
+ case sem.FullyQualifiedName:
+ pending = append(pending, arg)
+ case sem.Named:
+ if fqn.Target.GetName() == ty {
+ return true
+ }
+ }
+ }
}
+
return false
}