| 179 | } |
| 180 | |
| 181 | bool 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 | |
| 218 | void CopyContext::updateTextureData(const Texture* pTexture, const void* pData) |
| 219 | { |
nothing calls this directly
no test coverage detected