chromium/third_party/dawn/src/tint/lang/hlsl/writer/raise/builtin_polyfill_test.cc

// Copyright 2023 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/hlsl/writer/raise/builtin_polyfill.h"

#include <string>

#include "gtest/gtest.h"
#include "src/tint/lang/core/fluent_types.h"
#include "src/tint/lang/core/ir/transform/helper_test.h"
#include "src/tint/lang/core/number.h"
#include "src/tint/lang/core/type/builtin_structs.h"
#include "src/tint/lang/core/type/depth_multisampled_texture.h"
#include "src/tint/lang/core/type/depth_texture.h"
#include "src/tint/lang/core/type/multisampled_texture.h"
#include "src/tint/lang/core/type/sampled_texture.h"
#include "src/tint/lang/core/type/storage_texture.h"

usingnamespacetint::core::fluent_types;     // NOLINT
usingnamespacetint::core::number_suffixes;  // NOLINT

namespace tint::hlsl::writer::raise {
namespace {

HlslWriter_BuiltinPolyfillTest;

TEST_F(HlslWriter_BuiltinPolyfillTest, BitcastIdentity) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Asuint) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Asint) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Asfloat) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, AsfloatVec) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, BitcastFromF16) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, BitcastToF16) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, BitcastFromVec2F16) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, BitcastToVec4F16) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Sign) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, SignVec) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureNumLevels) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureNumLayers) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureNumSamples) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureDimensions_1d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureDimensions_2d_WithoutLod) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureDimensions_2d_WithI32Lod) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureDimensions_3d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureLoad_1DF32) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureLoad_2DLevelI32) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureLoad_3DLevelU32) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureLoad_Multisampled2DI32) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureLoad_Depth2DLevelF32) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureLoad_Depth2DArrayLevelF32) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureLoad_DepthMultisampledF32) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureStore1D) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureStore3D) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureStoreArray) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureGatherCompare_Depth2d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureGatherCompare_Depth2dOffset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureGatherCompare_DepthCubeArray) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureGatherCompare_Depth2dArrayOffset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureGather_Alpha) {}
TEST_F(HlslWriter_BuiltinPolyfillTest, TextureGather_RedOffset) {}
TEST_F(HlslWriter_BuiltinPolyfillTest, TextureGather_GreenArray) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureGather_BlueArrayOffset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureGather_Depth) {}
TEST_F(HlslWriter_BuiltinPolyfillTest, TextureGather_DepthOffset) {}
TEST_F(HlslWriter_BuiltinPolyfillTest, TextureGather_DepthArray) {}
TEST_F(HlslWriter_BuiltinPolyfillTest, TextureGather_DepthArrayOffset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_1d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_2d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_2d_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_2d_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_2d_Array_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_3d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_3d_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_Cube) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_Cube_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_Depth2d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_Depth2d_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_Depth2d_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_Depth2d_Array_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSample_DepthCube_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleBias_2d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleBias_2d_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleBias_2d_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleBias_2d_Array_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleBias_3d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleBias_3d_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleBias_Cube) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleBias_Cube_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleCompare_2d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleCompare_2d_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleCompare_2d_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleCompare_2d_Array_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleCompare_Cube) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleCompare_Cube_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleCompareLevel_2d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleCompareLevel_2d_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleCompareLevel_2d_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleCompareLevel_2d_Array_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleCompareLevel_Cube) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleCompareLevel_Cube_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleGrad_2d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleGrad_2d_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleGrad_2d_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleGrad_2d_Array_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleGrad_3d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleGrad_3d_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleGrad_Cube) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleGrad_Cube_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleLevel_2d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleLevel_2d_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleLevel_2d_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleLevel_2d_Array_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleLevel_3d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleLevel_3d_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleLevel_Cube) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleLevel_Cube_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleLevel_Depth2d) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleLevel_Depth2d_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleLevel_Depth2d_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleLevel_Depth2d_Array_Offset) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, TextureSampleLevel_DepthCube_Array) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, QuantizeToF16) {}

struct AtomicData {};
[[maybe_unused]] std::ostream& operator<<(std::ostream& out, const AtomicData& data) {}
HlslBuiltinPolyfillWorkgroupAtomic;
TEST_P(HlslBuiltinPolyfillWorkgroupAtomic, Access) {}

INSTANTIATE_TEST_SUITE_P();

TEST_F(HlslWriter_BuiltinPolyfillTest, BuiltinWorkgroupAtomicStore) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, BuiltinWorkgroupAtomicLoad) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, BuiltinWorkgroupAtomicSub) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, BuiltinWorkgroupAtomicCompareExchangeWeak) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Pack2x16Float) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Unpack2x16Float) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Pack2x16Snorm) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Unpack2x16snorm) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Pack2x16unorm) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Unpack2x16unorm) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Pack4x8Snorm) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Unpack4x8Snorm) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Pack4x8Unorm) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Unpack4x8Unorm) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Pack4xI8) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Unpack4xI8) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Pack4xU8) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Unpack4xU8) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Dot4U8Packed) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Dot4I8Packed) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Pack4xI8Clamp) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Asinh) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Acosh) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, Atanh) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, CountOneBits) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, ReverseBits) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, SubgroupAndLiteralVec) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, SubgroupShuffleXor) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, SubgroupShuffleUp) {}

TEST_F(HlslWriter_BuiltinPolyfillTest, SubgroupShuffleDown) {}

}  // namespace
}  // namespace tint::hlsl::writer::raise