| 155 | } |
| 156 | |
| 157 | Resource::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 | |
| 176 | void Resource::setGlobalState(State newState) const |
| 177 | { |
no test coverage detected