MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / subresourceBarriers

Method subresourceBarriers

Source/Falcor/Core/API/CopyContext.cpp:181–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181bool CopyContext::subresourceBarriers(const Texture* pTexture, Resource::State newState, const ResourceViewInfo* pViewInfo)
182{
183 ResourceViewInfo fullResource;
184 bool setGlobal = false;
185 if (pViewInfo == nullptr)
186 {
187 fullResource.arraySize = pTexture->getArraySize();
188 fullResource.firstArraySlice = 0;
189 fullResource.mipCount = pTexture->getMipCount();
190 fullResource.mostDetailedMip = 0;
191 setGlobal = true;
192 pViewInfo = &fullResource;
193 }
194
195 bool entireViewTransitioned = true;
196
197 for (uint32_t a = pViewInfo->firstArraySlice; a < pViewInfo->firstArraySlice + pViewInfo->arraySize; a++)
198 {
199 for (uint32_t m = pViewInfo->mostDetailedMip; m < pViewInfo->mipCount + pViewInfo->mostDetailedMip; m++)
200 {
201 Resource::State oldState = pTexture->getSubresourceState(a, m);
202 if (oldState != newState)
203 {
204 apiSubresourceBarrier(pTexture, newState, oldState, a, m);
205 if (setGlobal == false)
206 pTexture->setSubresourceState(a, m, newState);
207 mCommandsPending = true;
208 }
209 else
210 entireViewTransitioned = false;
211 }
212 }
213 if (setGlobal)
214 pTexture->setGlobalState(newState);
215 return entireViewTransitioned;
216}
217
218void CopyContext::updateTextureData(const Texture* pTexture, const void* pData)
219{

Callers

nothing calls this directly

Calls 3

getSubresourceStateMethod · 0.80
setSubresourceStateMethod · 0.80
setGlobalStateMethod · 0.80

Tested by

no test coverage detected