| 118 | } |
| 119 | |
| 120 | ref<Texture> createTexture2D( |
| 121 | ref<Device> pDevice, |
| 122 | uint32_t w, |
| 123 | uint32_t h, |
| 124 | ResourceFormat format, |
| 125 | uint32_t sampleCount, |
| 126 | uint32_t arraySize, |
| 127 | uint32_t mipLevels, |
| 128 | ResourceBindFlags flags |
| 129 | ) |
| 130 | { |
| 131 | if (format == ResourceFormat::Unknown) |
| 132 | { |
| 133 | FALCOR_THROW("Can't create Texture2D with an unknown resource format."); |
| 134 | } |
| 135 | |
| 136 | if (sampleCount > 1) |
| 137 | { |
| 138 | return pDevice->createTexture2DMS(w, h, format, sampleCount, arraySize, flags); |
| 139 | } |
| 140 | else |
| 141 | { |
| 142 | return pDevice->createTexture2D(w, h, format, arraySize, mipLevels, nullptr, flags); |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | ResourceBindFlags getBindFlags(bool isDepth, bool allowUav) |
| 147 | { |
no test coverage detected