[hlsl] Enable passing DISABLED tests.
A few of the tests are now passing based on various transforms, enable.
Bug: 42251045
Change-Id: Id5bcb557b09475b8a7e52d34907914e4df75b6c3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/195416
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/lang/hlsl/writer/binary_test.cc b/src/tint/lang/hlsl/writer/binary_test.cc
index 4642586..fefce70 100644
--- a/src/tint/lang/hlsl/writer/binary_test.cc
+++ b/src/tint/lang/hlsl/writer/binary_test.cc
@@ -81,8 +81,7 @@
BinaryData{"(left | right)", core::BinaryOp::kOr},
BinaryData{"(left ^ right)", core::BinaryOp::kXor}));
-// TODO(dsinclair): Needs binary polyfill
-TEST_F(HlslWriterTest, DISABLED_BinaryU32Div) {
+TEST_F(HlslWriterTest, BinaryU32Div) {
auto* func = b.Function("foo", ty.void_(), core::ir::Function::PipelineStage::kCompute);
func->SetWorkgroupSize(1, 1, 1);
b.Append(func->Block(), [&] {
@@ -95,15 +94,15 @@
ASSERT_TRUE(Generate()) << err_ << output_.hlsl;
EXPECT_EQ(output_.hlsl, R"(
-uint tint_div(uint lhs, uint rhs) {
- return (lhs / ((rhs == 0u) ? 1u : rhs));
+uint tint_div_u32(uint lhs, uint rhs) {
+ return (lhs / (((rhs == 0u)) ? (1u) : (rhs)));
}
[numthreads(1, 1, 1)]
void foo() {
uint left = 1u;
uint right = 2u;
- uint val = tint_div(left, right);
+ uint val = tint_div_u32(left, right);
}
)");
@@ -136,8 +135,7 @@
)");
}
-// TODO(dsinclair): Needs binary polyfill
-TEST_F(HlslWriterTest, DISABLED_BinaryU32ShiftLeft) {
+TEST_F(HlslWriterTest, BinaryU32ShiftLeft) {
auto* func = b.Function("foo", ty.void_(), core::ir::Function::PipelineStage::kCompute);
func->SetWorkgroupSize(1, 1, 1);
b.Append(func->Block(), [&] {
@@ -160,8 +158,7 @@
)");
}
-// TODO(dsinclair): Needs binary polyfill
-TEST_F(HlslWriterTest, DISABLED_BinaryU32ShiftRight) {
+TEST_F(HlslWriterTest, BinaryU32ShiftRight) {
auto* func = b.Function("foo", ty.void_(), core::ir::Function::PipelineStage::kCompute);
func->SetWorkgroupSize(1, 1, 1);
b.Append(func->Block(), [&] {
diff --git a/src/tint/lang/hlsl/writer/constant_test.cc b/src/tint/lang/hlsl/writer/constant_test.cc
index 4d3530d..de3d61b 100644
--- a/src/tint/lang/hlsl/writer/constant_test.cc
+++ b/src/tint/lang/hlsl/writer/constant_test.cc
@@ -635,7 +635,7 @@
)");
}
-TEST_F(HlslWriterTest, DISABLED_ConstantTypeStructStatic) {
+TEST_F(HlslWriterTest, ConstantTypeStructStatic) {
Vector members{
ty.Get<core::type::StructMember>(b.ir.symbols.New("a"), ty.i32(), 0u, 0u, 4u, 4u,
core::type::StructMemberAttributes{}),