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

Method getSubresourceState

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

Source from the content-addressed store, hash-verified

155}
156
157Resource::State Resource::getSubresourceState(uint32_t arraySlice, uint32_t mipLevel) const
158{
159 const Texture* pTexture = dynamic_cast<const Texture*>(this);
160 if (pTexture)
161 {
162 uint32_t subResource = pTexture->getSubresourceIndex(arraySlice, mipLevel);
163 return (mState.isGlobal) ? mState.global : mState.perSubresource[subResource];
164 }
165 else
166 {
167 logWarning(
168 "Calling Resource::getSubresourceState() on an object that is not a texture. This call is invalid, use "
169 "Resource::getGlobalState() instead"
170 );
171 FALCOR_ASSERT(mState.isGlobal);
172 return mState.global;
173 }
174}
175
176void Resource::setGlobalState(State newState) const
177{

Callers 2

subresourceBarriersMethod · 0.80
apiSubresourceBarrierMethod · 0.80

Calls 1

logWarningFunction · 0.50

Tested by

no test coverage detected