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

Method setSubresourceState

Source/Falcor/Core/API/Resource.cpp:182–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void Resource::setSubresourceState(uint32_t arraySlice, uint32_t mipLevel, State newState) const
183{
184 const Texture* pTexture = dynamic_cast<const Texture*>(this);
185 if (pTexture == nullptr)
186 {
187 logWarning("Calling Resource::setSubresourceState() on an object that is not a texture. This is invalid. Ignoring call");
188 return;
189 }
190
191 // If we are transitioning from a global to local state, initialize the subresource array
192 if (mState.isGlobal)
193 {
194 std::fill(mState.perSubresource.begin(), mState.perSubresource.end(), mState.global);
195 }
196 mState.isGlobal = false;
197 mState.perSubresource[pTexture->getSubresourceIndex(arraySlice, mipLevel)] = newState;
198}
199
200SharedResourceApiHandle Resource::getSharedApiHandle() const
201{

Callers 1

subresourceBarriersMethod · 0.80

Calls 3

logWarningFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected