chromium/third_party/dawn/src/tint/lang/hlsl/writer/builtin_test.cc

// 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/fluent_types.h"
#include "src/tint/lang/core/ir/function.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/sampler.h"
#include "src/tint/lang/core/type/sampler_kind.h"
#include "src/tint/lang/core/type/storage_texture.h"
#include "src/tint/lang/core/type/texture_dimension.h"
#include "src/tint/lang/hlsl/writer/helper_test.h"

#include "gtest/gtest.h"

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

namespace tint::hlsl::writer {
namespace {

TEST_F(HlslWriterTest, BuiltinSelectScalar) {}

TEST_F(HlslWriterTest, BuiltinSelectVector) {}

TEST_F(HlslWriterTest, BuiltinTrunc) {}

TEST_F(HlslWriterTest, BuiltinTruncVec) {}

TEST_F(HlslWriterTest, BuiltinTruncF16) {}

TEST_F(HlslWriterTest, BuiltinStorageAtomicStore) {}

TEST_F(HlslWriterTest, BuiltinStorageAtomicStoreDirect) {}

TEST_F(HlslWriterTest, BuiltinStorageAtomicLoad) {}

TEST_F(HlslWriterTest, BuiltinStorageAtomicLoadDirect) {}

TEST_F(HlslWriterTest, BuiltinStorageAtomicSub) {}

TEST_F(HlslWriterTest, BuiltinStorageAtomicSubDirect) {}

TEST_F(HlslWriterTest, BuiltinStorageAtomicCompareExchangeWeak) {}

TEST_F(HlslWriterTest, BuiltinStorageAtomicCompareExchangeWeakDirect) {}

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

HlslBuiltinAtomic;
TEST_P(HlslBuiltinAtomic, IndirectAccess) {}

TEST_P(HlslBuiltinAtomic, DirectAccess) {}

INSTANTIATE_TEST_SUITE_P();

TEST_F(HlslWriterTest, BuiltinWorkgroupAtomicStore) {}

TEST_F(HlslWriterTest, BuiltinWorkgroupAtomicLoad) {}

TEST_F(HlslWriterTest, BuiltinWorkgroupAtomicSub) {}

TEST_F(HlslWriterTest, BuiltinWorkgroupAtomicCompareExchangeWeak) {}

HlslBuiltinWorkgroupAtomic;
TEST_P(HlslBuiltinWorkgroupAtomic, Access) {}

INSTANTIATE_TEST_SUITE_P();

TEST_F(HlslWriterTest, BuiltinSignScalar) {}

TEST_F(HlslWriterTest, BuiltinSignVector) {}

TEST_F(HlslWriterTest, BuiltinStorageBarrier) {}

TEST_F(HlslWriterTest, BuiltinTextureBarrier) {}

TEST_F(HlslWriterTest, BuiltinWorkgroupBarrier) {}

TEST_F(HlslWriterTest, BuiltinTextureNumLevels1D) {}

TEST_F(HlslWriterTest, BuiltinTextureNumLevels2D) {}

TEST_F(HlslWriterTest, BuiltinTextureNumLevels3D) {}

TEST_F(HlslWriterTest, BuiltinTextureDimension1D) {}

TEST_F(HlslWriterTest, BuiltinTextureDimension2D) {}

TEST_F(HlslWriterTest, BuiltinTextureDimension2dLOD) {}

TEST_F(HlslWriterTest, BuiltinTextureDimension3D) {}

TEST_F(HlslWriterTest, BuiltinTextureLayers2dArray) {}

TEST_F(HlslWriterTest, BuiltinTextureNumLayersCubeArray) {}

TEST_F(HlslWriterTest, BuiltinTextureNumSamples) {}

TEST_F(HlslWriterTest, BuiltinTextureLoad_1DF32) {}

TEST_F(HlslWriterTest, BuiltinTextureLoad_2DLevelI32) {}

TEST_F(HlslWriterTest, BuiltinTextureLoad_3DLevelU32) {}

TEST_F(HlslWriterTest, BuiltinTextureLoad_Multisampled2DI32) {}

TEST_F(HlslWriterTest, BuiltinTextureLoad_Depth2DLevelF32) {}

TEST_F(HlslWriterTest, BuiltinTextureLoad_Depth2DArrayLevelF32) {}

TEST_F(HlslWriterTest, BuiltinTextureLoad_DepthMultisampledF32) {}

TEST_F(HlslWriterTest, BuiltinTextureStore1D) {}

TEST_F(HlslWriterTest, BuiltinTextureStore3D) {}

TEST_F(HlslWriterTest, BuiltinTextureStoreArray) {}

TEST_F(HlslWriterTest, BuiltinTextureGatherCompare_Depth2d) {}

TEST_F(HlslWriterTest, BuiltinTextureGatherCompare_Depth2dOffset) {}

TEST_F(HlslWriterTest, BuiltinTextureGatherCompare_DepthCubeArray) {}

TEST_F(HlslWriterTest, BuiltinTextureGatherCompare_Depth2dArrayOffset) {}

TEST_F(HlslWriterTest, BuiltinTextureGather_Alpha) {}
TEST_F(HlslWriterTest, BuiltinTextureGather_RedOffset) {}
TEST_F(HlslWriterTest, BuiltinTextureGather_GreenArray) {}

TEST_F(HlslWriterTest, BuiltinTextureGather_BlueArrayOffset) {}

TEST_F(HlslWriterTest, BuiltinTextureGather_Depth) {}
TEST_F(HlslWriterTest, BuiltinTextureGather_DepthOffset) {}
TEST_F(HlslWriterTest, BuiltinTextureGather_DepthArray) {}
TEST_F(HlslWriterTest, BuiltinTextureGather_DepthArrayOffset) {}

TEST_F(HlslWriterTest, BuiltinQuantizeToF16) {}

TEST_F(HlslWriterTest, BuiltinPack2x16Float) {}

TEST_F(HlslWriterTest, BuiltinUnpack2x16Float) {}

TEST_F(HlslWriterTest, BuiltinPack2x16Snorm) {}

TEST_F(HlslWriterTest, BuiltinUnpack2x16Snorm) {}

TEST_F(HlslWriterTest, BuiltinPack2x16Unorm) {}

TEST_F(HlslWriterTest, BuiltinUnpack2x16Unorm) {}

TEST_F(HlslWriterTest, BuiltinPack4x8Snorm) {}

TEST_F(HlslWriterTest, BuiltinUnpack4x8Snorm) {}

TEST_F(HlslWriterTest, BuiltinPack4x8Unorm) {}

TEST_F(HlslWriterTest, BuiltinUnpack4x8Unorm) {}

TEST_F(HlslWriterTest, BuiltinPack4xI8CorePolyfill) {}

TEST_F(HlslWriterTest, BuiltinUnpack4xI8CorePolyfill) {}

TEST_F(HlslWriterTest, BuiltinPack4xI8) {}

TEST_F(HlslWriterTest, BuiltinUnpack4xI8) {}

TEST_F(HlslWriterTest, BuiltinPack4xU8CorePolyfill) {}

TEST_F(HlslWriterTest, BuiltinUnpack4xU8CorePolyfill) {}

TEST_F(HlslWriterTest, BuiltinPack4xU8) {}

TEST_F(HlslWriterTest, BuiltinUnpack4xU8) {}

TEST_F(HlslWriterTest, BuiltinDot4U8PackedPolyfill) {}

TEST_F(HlslWriterTest, BuiltinDot4U8Packed) {}

TEST_F(HlslWriterTest, BuiltinPack4xU8ClampPolyfill) {}

TEST_F(HlslWriterTest, BuiltinPack4xI8ClampPolyfill) {}

TEST_F(HlslWriterTest, BuiltinPack4xI8Clamp) {}

TEST_F(HlslWriterTest, BuiltinDot4I8PackedPolyfill) {}

TEST_F(HlslWriterTest, BuiltinDot4I8Packed) {}

TEST_F(HlslWriterTest, BuiltinAsinh) {}

TEST_F(HlslWriterTest, BuiltinAcosh) {}

TEST_F(HlslWriterTest, BuiltinAtanh) {}

TEST_F(HlslWriterTest, BuiltinSubgroupBallot) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_1d) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_2d) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_2d_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_2d_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_2d_Array_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_3d) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_3d_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_Cube) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_Cube_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleBias_2d) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleBias_2d_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleBias_2d_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleBias_2d_Array_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleBias_3d) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleBias_3d_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleBias_Cube) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleBias_Cube_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleCompare_2d) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleCompare_2d_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleCompare_2d_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleCompare_2d_Array_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleCompare_Cube) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleCompare_Cube_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleCompareLevel_2d) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleCompareLevel_2d_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleCompareLevel_2d_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleCompareLevel_2d_Array_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleCompareLevel_Cube) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleCompareLevel_Cube_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleGrad_2d) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleGrad_2d_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleGrad_2d_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleGrad_2d_Array_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleGrad_3d) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleGrad_3d_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleGrad_Cube) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleGrad_Cube_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_Depth2d) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_Depth2d_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_Depth2d_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_Depth2d_Array_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSample_DepthCube_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleLevel_2d) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleLevel_2d_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleLevel_2d_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleLevel_2d_Array_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleLevel_3d) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleLevel_3d_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleLevel_Cube) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleLevel_Cube_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleLevel_Depth2d) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleLevel_Depth2d_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleLevel_Depth2d_Array) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleLevel_Depth2d_Array_Offset) {}

TEST_F(HlslWriterTest, BuiltinTextureSampleLevel_DepthCube_Array) {}

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