MCPcopy Create free account
hub / github.com/NVIDIA-RTX/NVRHI / clearTextureUInt

Method clearTextureUInt

src/validation/validation-commandlist.cpp:276–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274 }
275
276 void CommandListWrapper::clearTextureUInt(ITexture* t, TextureSubresourceSet subresources, uint32_t clearColor)
277 {
278 if (!requireOpenState())
279 return;
280
281 if (!requireType(CommandQueue::Compute, "clearTextureUInt"))
282 return;
283
284 const TextureDesc& textureDesc = t->getDesc();
285
286 const FormatInfo& formatInfo = getFormatInfo(textureDesc.format);
287 if (formatInfo.hasDepth || formatInfo.hasStencil)
288 {
289 std::stringstream ss;
290 ss << "Texture " << utils::DebugNameToString(textureDesc.debugName) << " cannot be cleared with "
291 "clearTextureUInt because it's a depth-stencil texture. Use clearDepthStencilTexture instead.";
292 error(ss.str());
293 return;
294 }
295
296 if (formatInfo.kind != FormatKind::Integer)
297 {
298 std::stringstream ss;
299 ss << "Texture " << utils::DebugNameToString(textureDesc.debugName) << " cannot be cleared with "
300 "clearTextureUInt because it's not an integer texture. Use clearTextureFloat instead.";
301 error(ss.str());
302 return;
303 }
304
305 if (!textureDesc.isRenderTarget && !textureDesc.isUAV)
306 {
307 std::stringstream ss;
308 ss << "Texture " << utils::DebugNameToString(textureDesc.debugName) << " cannot be cleared with "
309 "clearTextureUInt because it was created with both isRenderTarget = false and isUAV = false.";
310 error(ss.str());
311 return;
312 }
313
314 m_CommandList->clearTextureUInt(t, subresources, clearColor);
315 }
316
317 void CommandListWrapper::copyTexture(ITexture* dest, const TextureSlice& destSlice, ITexture* src, const TextureSlice& srcSlice)
318 {

Callers

nothing calls this directly

Calls 2

DebugNameToStringFunction · 0.85
getDescMethod · 0.45

Tested by

no test coverage detected