LLVM 24.0.0git
HLSLResource.cpp
Go to the documentation of this file.
1//===- HLSLResource.cpp - HLSL Resource helper objects --------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file This file contains helper objects for working with HLSL Resources.
10///
11//===----------------------------------------------------------------------===//
12
15
16using namespace llvm;
17using namespace llvm::hlsl;
18
20 // TODO: Handle unorm, snorm, and packed.
21 Ty = Ty->getScalarType();
22
23 if (Ty->isIntegerTy()) {
24 switch (Ty->getIntegerBitWidth()) {
25 case 16:
27 case 32:
29 case 64:
31 case 1:
32 default:
34 }
35 } else if (Ty->isFloatTy()) {
37 } else if (Ty->isDoubleTy()) {
39 } else if (Ty->isHalfTy()) {
41 }
42
44}
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:46
ElementType
The element type of an SRV or UAV resource.
Definition DXILABI.h:68
LLVM_ABI dxil::ElementType getDXILElementType(Type *Ty, bool IsSigned)
Converts a scalar or vector LLVM type to its DXIL element type.
This is an optimization pass for GlobalISel generic memory operations.