| 203 | } |
| 204 | |
| 205 | void CommandListWrapper::clearTextureFloat(ITexture* t, TextureSubresourceSet subresources, const Color& clearColor) |
| 206 | { |
| 207 | if (!requireOpenState()) |
| 208 | return; |
| 209 | |
| 210 | if (!requireType(CommandQueue::Compute, "clearTextureFloat")) |
| 211 | return; |
| 212 | |
| 213 | const TextureDesc& textureDesc = t->getDesc(); |
| 214 | |
| 215 | const FormatInfo& formatInfo = getFormatInfo(textureDesc.format); |
| 216 | if (formatInfo.hasDepth || formatInfo.hasStencil) |
| 217 | { |
| 218 | std::stringstream ss; |
| 219 | ss << "Texture " << utils::DebugNameToString(textureDesc.debugName) << " cannot be cleared with " |
| 220 | "clearTextureFloat because it's a depth-stencil texture. Use clearDepthStencilTexture instead."; |
| 221 | error(ss.str()); |
| 222 | return; |
| 223 | } |
| 224 | |
| 225 | if (formatInfo.kind == FormatKind::Integer) |
| 226 | { |
| 227 | std::stringstream ss; |
| 228 | ss << "Texture " << utils::DebugNameToString(textureDesc.debugName) << " cannot be cleared with " |
| 229 | "clearTextureFloat because it's an integer texture. Use clearTextureUInt instead."; |
| 230 | error(ss.str()); |
| 231 | return; |
| 232 | } |
| 233 | |
| 234 | if (!textureDesc.isRenderTarget && !textureDesc.isUAV) |
| 235 | { |
| 236 | std::stringstream ss; |
| 237 | ss << "Texture " << utils::DebugNameToString(textureDesc.debugName) << " cannot be cleared with " |
| 238 | "clearTextureFloat because it was created with both isRenderTarget = false and isUAV = false."; |
| 239 | error(ss.str()); |
| 240 | return; |
| 241 | } |
| 242 | |
| 243 | m_CommandList->clearTextureFloat(t, subresources, clearColor); |
| 244 | } |
| 245 | |
| 246 | void CommandListWrapper::clearDepthStencilTexture(ITexture* t, TextureSubresourceSet subresources, bool clearDepth, float depth, bool clearStencil, uint8_t stencil) |
| 247 | { |
nothing calls this directly
no test coverage detected