git.s-ol.nu ~forks/DiligentCore / 9b0a5dd
Few more updates to ShaderResourceCacheD3D11 assiduous 6 months ago
2 changed file(s) with 87 addition(s) and 140 deletion(s). Raw diff Collapse all Expand all
3131
3232 #include <array>
3333 #include <memory>
34 #include <utility>
3435
3536 #include "MemoryAllocator.h"
3637 #include "ShaderResourceCacheCommon.hpp"
179180 __forceinline void SetCB(BindPointsD3D11 BindPoints, RefCntAutoPtr<BufferD3D11Impl> pBuffD3D11Impl)
180181 {
181182 auto* pd3d11Buff = pBuffD3D11Impl ? pBuffD3D11Impl->BufferD3D11Impl::GetD3D11Buffer() : nullptr;
182 SetD3D11ResourceInternal<CachedCB>(BindPoints, std::move(pBuffD3D11Impl), pd3d11Buff);
183 SetD3D11ResourceInternal(BindPoints, std::move(pBuffD3D11Impl), pd3d11Buff);
183184 }
184185
185186 __forceinline void SetTexSRV(BindPointsD3D11 BindPoints, RefCntAutoPtr<TextureViewD3D11Impl> pTexView)
186187 {
187188 auto* pd3d11SRV = pTexView ? static_cast<ID3D11ShaderResourceView*>(pTexView->TextureViewD3D11Impl::GetD3D11View()) : nullptr;
188 SetD3D11ResourceInternal<CachedResource>(BindPoints, std::move(pTexView), pd3d11SRV);
189 SetD3D11ResourceInternal(BindPoints, std::move(pTexView), pd3d11SRV);
189190 }
190191
191192 __forceinline void SetBufSRV(BindPointsD3D11 BindPoints, RefCntAutoPtr<BufferViewD3D11Impl> pBuffView)
192193 {
193194 auto* pd3d11SRV = pBuffView ? static_cast<ID3D11ShaderResourceView*>(pBuffView->BufferViewD3D11Impl::GetD3D11View()) : nullptr;
194 SetD3D11ResourceInternal<CachedResource>(BindPoints, std::move(pBuffView), pd3d11SRV);
195 SetD3D11ResourceInternal(BindPoints, std::move(pBuffView), pd3d11SRV);
195196 }
196197
197198 __forceinline void SetTexUAV(BindPointsD3D11 BindPoints, RefCntAutoPtr<TextureViewD3D11Impl> pTexView)
198199 {
199200 auto* pd3d11UAV = pTexView ? static_cast<ID3D11UnorderedAccessView*>(pTexView->TextureViewD3D11Impl::GetD3D11View()) : nullptr;
200 SetD3D11ResourceInternal<CachedResource>(BindPoints, std::move(pTexView), pd3d11UAV);
201 SetD3D11ResourceInternal(BindPoints, std::move(pTexView), pd3d11UAV);
201202 }
202203
203204 __forceinline void SetBufUAV(BindPointsD3D11 BindPoints, RefCntAutoPtr<BufferViewD3D11Impl> pBuffView)
204205 {
205206 auto* pd3d11UAV = pBuffView ? static_cast<ID3D11UnorderedAccessView*>(pBuffView->BufferViewD3D11Impl::GetD3D11View()) : nullptr;
206 SetD3D11ResourceInternal<CachedResource>(BindPoints, std::move(pBuffView), pd3d11UAV);
207 SetD3D11ResourceInternal(BindPoints, std::move(pBuffView), pd3d11UAV);
207208 }
208209
209210 __forceinline void SetSampler(BindPointsD3D11 BindPoints, SamplerD3D11Impl* pSampler)
210211 {
211212 auto* pd3d11Sampler = pSampler ? pSampler->SamplerD3D11Impl::GetD3D11SamplerState() : nullptr;
212 SetD3D11ResourceInternal<CachedSampler>(BindPoints, pSampler, pd3d11Sampler);
213 SetD3D11ResourceInternal(BindPoints, pSampler, pd3d11Sampler);
213214 }
214215
215216
218219 {
219220 const Uint32 ShaderInd = PlatformMisc::GetLSB(BindPoints.GetActiveBits());
220221 VERIFY(BindPoints[ShaderInd] < GetResourceCount<D3D11ResourceType>(ShaderInd), "Resource slot is out of range");
221 CachedResourceTraits<D3D11ResourceType>::CachedResourceType const* CachedResources;
222 D3D11ResourceType* const* pd3d11Resources;
223 GetConstResourceArrays(ShaderInd, CachedResources, pd3d11Resources);
224 return CachedResources[BindPoints[ShaderInd]];
222 const auto ResArrays = GetConstResourceArrays<D3D11ResourceType>(ShaderInd);
223 return ResArrays.first[BindPoints[ShaderInd]];
225224 }
226225
227226 template <typename D3D11ResourceType>
233232 const Uint32 ShaderInd = PlatformMisc::GetLSB(ActiveBits);
234233 ActiveBits &= ~(1u << ShaderInd);
235234
236 CachedResourceTraits<D3D11ResourceType>::CachedResourceType const* pSrcCachedResources;
237 D3D11ResourceType* const* pd3d11SrcResources;
238 SrcCache.GetConstResourceArrays(ShaderInd, pSrcCachedResources, pd3d11SrcResources);
239
240 CachedResourceTraits<D3D11ResourceType>::CachedResourceType* pDstCachedResources;
241 D3D11ResourceType** pd3d11DstResources;
242 GetResourceArrays(ShaderInd, pDstCachedResources, pd3d11DstResources);
235 auto SrcResArrays = SrcCache.GetConstResourceArrays<D3D11ResourceType>(ShaderInd);
236 auto DstResArrays = GetResourceArrays<D3D11ResourceType>(ShaderInd);
243237
244238 const Uint32 CacheOffset = BindPoints[ShaderInd];
245239 VERIFY(CacheOffset < GetResourceCount<D3D11ResourceType>(ShaderInd), "Index is out of range");
246 if (!pSrcCachedResources[CacheOffset])
240 if (!SrcResArrays.first[CacheOffset])
247241 IsBound = false;
248242
249 pDstCachedResources[CacheOffset] = pSrcCachedResources[CacheOffset];
250 pd3d11DstResources[CacheOffset] = pd3d11SrcResources[CacheOffset];
243 DstResArrays.first[CacheOffset] = SrcResArrays.first[CacheOffset];
244 DstResArrays.second[CacheOffset] = SrcResArrays.second[CacheOffset];
251245 }
252246 return IsBound;
253247 }
262256 ActiveBits &= ~(1u << ShaderInd);
263257 const Uint32 CacheOffset = BindPoints[ShaderInd];
264258
265 CachedResourceTraits<D3D11ResourceType>::CachedResourceType const* CachedResources;
266 D3D11ResourceType* const* pd3d11Resources;
267 GetConstResourceArrays(ShaderInd, CachedResources, pd3d11Resources);
268 if (CacheOffset < GetResourceCount<D3D11ResourceType>(ShaderInd) && CachedResources[CacheOffset])
259 const auto ResArrays = GetConstResourceArrays<D3D11ResourceType>(ShaderInd);
260 if (CacheOffset < GetResourceCount<D3D11ResourceType>(ShaderInd) && ResArrays.first[CacheOffset])
269261 {
270262 continue;
271263 }
288280 template <typename D3D11ResourceType>
289281 __forceinline Uint32 GetResourceCount(Uint32 ShaderInd) const;
290282
291 template <typename D3D11ResourceType>
292 __forceinline void GetResourceArrays(
293 Uint32 ShaderInd,
294 typename CachedResourceTraits<D3D11ResourceType>::CachedResourceType*& pResources,
295 D3D11ResourceType**& pd3d11Resources) const
296 {
297 static_assert(alignof(CachedResourceTraits<D3D11ResourceType>::CachedResourceType) == alignof(D3D11ResourceType*), "Alignment mismatch, pointer to D3D11 resource may not be properly aligned");
298
299 pResources = reinterpret_cast<CachedResourceTraits<D3D11ResourceType>::CachedResourceType*>(m_pResourceData.get() + GetResourceDataOffset<D3D11ResourceType>(ShaderInd));
300 pd3d11Resources = reinterpret_cast<D3D11ResourceType**>(pResources + GetResourceCount<D3D11ResourceType>(ShaderInd));
301 }
302
303
304 template <typename D3D11ResourceType>
305 __forceinline void GetConstResourceArrays(
306 Uint32 ShaderInd,
307 typename CachedResourceTraits<D3D11ResourceType>::CachedResourceType const*& pResources,
308 D3D11ResourceType* const*& pd3d11Resources) const
309 {
310 static_assert(alignof(CachedResourceTraits<D3D11ResourceType>::CachedResourceType) == alignof(D3D11ResourceType*), "Alignment mismatch, pointer to D3D11 resource may not be properly aligned");
311
312 pResources = reinterpret_cast<CachedResourceTraits<D3D11ResourceType>::CachedResourceType const*>(m_pResourceData.get() + GetResourceDataOffset<D3D11ResourceType>(ShaderInd));
313 pd3d11Resources = reinterpret_cast<D3D11ResourceType* const*>(pResources + GetResourceCount<D3D11ResourceType>(ShaderInd));
314 }
315
316283 bool IsInitialized() const { return m_IsInitialized; }
317284
318285 ResourceCacheContentType GetContentType() const { return m_ContentType; }
351318 template <typename D3D11ResourceTpye>
352319 __forceinline Uint32 GetResourceDataOffset(Uint32 ShaderInd) const;
353320
354 template <typename TCachedResourceType, typename TSrcResourceType, typename TD3D11ResourceType>
321 template <typename D3D11ResourceType>
322 __forceinline std::pair<typename CachedResourceTraits<D3D11ResourceType>::CachedResourceType*, D3D11ResourceType**>
323 GetResourceArrays(Uint32 ShaderInd) const
324 {
325 static_assert(alignof(CachedResourceTraits<D3D11ResourceType>::CachedResourceType) == alignof(D3D11ResourceType*), "Alignment mismatch, pointer to D3D11 resource may not be properly aligned");
326
327 using CachedResourceType = CachedResourceTraits<D3D11ResourceType>::CachedResourceType;
328 const auto DataOffset = GetResourceDataOffset<D3D11ResourceType>(ShaderInd);
329 const auto ResCount = GetResourceCount<D3D11ResourceType>(ShaderInd);
330 auto* const pResources = reinterpret_cast<CachedResourceType*>(m_pResourceData.get() + DataOffset);
331 auto* const pd3d11Resources = reinterpret_cast<D3D11ResourceType**>(pResources + ResCount);
332 return std::make_pair(pResources, pd3d11Resources);
333 }
334
335 template <typename D3D11ResourceType>
336 __forceinline std::pair<const typename CachedResourceTraits<D3D11ResourceType>::CachedResourceType*, D3D11ResourceType* const*>
337 GetConstResourceArrays(Uint32 ShaderInd) const
338 {
339 const auto ResArrays = GetResourceArrays<D3D11ResourceType>(ShaderInd);
340 return std::make_pair(ResArrays.first, ResArrays.second);
341 }
342
343 template <typename TSrcResourceType, typename TD3D11ResourceType>
355344 __forceinline void SetD3D11ResourceInternal(BindPointsD3D11 BindPoints, TSrcResourceType pResource, TD3D11ResourceType* pd3d11Resource)
356345 {
357346 VERIFY(pResource != nullptr && pd3d11Resource != nullptr || pResource == nullptr && pd3d11Resource == nullptr,
365354 const Uint32 ResCount = GetResourceCount<TD3D11ResourceType>(ShaderInd);
366355 VERIFY(CacheOffset < ResCount, "Index is out of range");
367356
368 TCachedResourceType* Resources;
369 TD3D11ResourceType** d3d11ResArr;
370 GetResourceArrays(ShaderInd, Resources, d3d11ResArr);
371 Resources[CacheOffset].Set(pResource);
372 d3d11ResArr[CacheOffset] = pd3d11Resource;
357 auto ResArrays = GetResourceArrays<TD3D11ResourceType>(ShaderInd);
358 ResArrays.first[CacheOffset].Set(pResource);
359 ResArrays.second[CacheOffset] = pd3d11Resource;
373360 }
374361 }
375362
497484 D3D11ResourceType* CommittedD3D11Resources[],
498485 Uint8& Binding) const
499486 {
500 CachedResourceTraits<D3D11ResourceType>::CachedResourceType const* CachedResources;
501 D3D11ResourceType* const* pd3d11Resources;
502 GetConstResourceArrays(ShaderInd, CachedResources, pd3d11Resources);
487 const auto ResCount = GetResourceCount<D3D11ResourceType>(ShaderInd);
488 const auto ResArrays = GetConstResourceArrays<D3D11ResourceType>(ShaderInd);
503489
504490 MinMaxSlot Slots;
505
506 const auto ResCount = GetResourceCount<D3D11ResourceType>(ShaderInd);
507491 for (Uint32 res = 0; res < ResCount; ++res)
508492 {
509493 const Uint32 Slot = Binding++;
510 if (CommittedD3D11Resources[Slot] != pd3d11Resources[res])
494 if (CommittedD3D11Resources[Slot] != ResArrays.second[res])
511495 Slots.Add(Slot);
512496
513 VERIFY_EXPR(pd3d11Resources[res] != nullptr);
514 CommittedD3D11Resources[Slot] = pd3d11Resources[res];
497 VERIFY_EXPR(ResArrays.second[res] != nullptr);
498 CommittedD3D11Resources[Slot] = ResArrays.second[res];
515499 }
516500
517501 return Slots;
524508 ID3D11Resource* CommittedD3D11Resources[],
525509 Uint8& Binding) const
526510 {
527 CachedResourceTraits<D3D11ResourceViewType>::CachedResourceType const* CachedResources;
528 D3D11ResourceViewType* const* pd3d11Views;
529 GetConstResourceArrays(ShaderInd, CachedResources, pd3d11Views);
511 const auto ResCount = GetResourceCount<D3D11ResourceViewType>(ShaderInd);
512 const auto ResArrays = GetConstResourceArrays<D3D11ResourceViewType>(ShaderInd);
530513
531514 MinMaxSlot Slots;
532
533 const auto ResCount = GetResourceCount<D3D11ResourceViewType>(ShaderInd);
534515 for (Uint32 res = 0; res < ResCount; ++res)
535516 {
536517 const Uint32 Slot = Binding++;
537 if (CommittedD3D11Views[Slot] != pd3d11Views[res])
518 if (CommittedD3D11Views[Slot] != ResArrays.second[res])
538519 Slots.Add(Slot);
539520
540 VERIFY_EXPR(pd3d11Views[res] != nullptr);
541 CommittedD3D11Resources[Slot] = CachedResources[res].pd3d11Resource;
542 CommittedD3D11Views[Slot] = pd3d11Views[res];
521 VERIFY_EXPR(ResArrays.second[res] != nullptr);
522 CommittedD3D11Resources[Slot] = ResArrays.first[res].pd3d11Resource;
523 CommittedD3D11Views[Slot] = ResArrays.second[res];
543524 }
544525
545526 return Slots;
111111 const auto CBCount = GetCBCount(ShaderInd);
112112 if (CBCount != 0)
113113 {
114 CachedCB* CBs = nullptr;
115 ID3D11Buffer** d3d11CBs = nullptr;
116 GetResourceArrays(ShaderInd, CBs, d3d11CBs);
114 auto CBArrays = GetResourceArrays<ID3D11Buffer>(ShaderInd);
117115 for (Uint32 cb = 0; cb < CBCount; ++cb)
118 new (CBs + cb) CachedCB{};
116 new (CBArrays.first + cb) CachedCB{};
119117 }
120118
121119 const auto SRVCount = GetSRVCount(ShaderInd);
122120 if (SRVCount != 0)
123121 {
124 CachedResource* SRVResources = nullptr;
125 ID3D11ShaderResourceView** d3d11SRVs = nullptr;
126 GetResourceArrays(ShaderInd, SRVResources, d3d11SRVs);
122 auto SRVArrays = GetResourceArrays<ID3D11ShaderResourceView>(ShaderInd);
127123 for (Uint32 srv = 0; srv < SRVCount; ++srv)
128 new (SRVResources + srv) CachedResource{};
124 new (SRVArrays.first + srv) CachedResource{};
129125 }
130126
131127 const auto SamplerCount = GetSamplerCount(ShaderInd);
132128 if (SamplerCount != 0)
133129 {
134 CachedSampler* Samplers = nullptr;
135 ID3D11SamplerState** d3d11Samplers = nullptr;
136 GetResourceArrays(ShaderInd, Samplers, d3d11Samplers);
130 auto SamArrays = GetResourceArrays<ID3D11SamplerState>(ShaderInd);
137131 for (Uint32 sam = 0; sam < SamplerCount; ++sam)
138 new (Samplers + sam) CachedSampler{};
132 new (SamArrays.first + sam) CachedSampler{};
139133 }
140134
141135 const auto UAVCount = GetUAVCount(ShaderInd);
142136 if (UAVCount != 0)
143137 {
144 CachedResource* UAVResources = nullptr;
145 ID3D11UnorderedAccessView** d3d11UAVs = nullptr;
146 GetResourceArrays(ShaderInd, UAVResources, d3d11UAVs);
138 auto UAVArrays = GetResourceArrays<ID3D11UnorderedAccessView>(ShaderInd);
147139 for (Uint32 uav = 0; uav < UAVCount; ++uav)
148 new (UAVResources + uav) CachedResource{};
140 new (UAVArrays.first + uav) CachedResource{};
149141 }
150142 }
151143
162154 const auto CBCount = GetCBCount(ShaderInd);
163155 if (CBCount != 0)
164156 {
165 CachedCB* CBs = nullptr;
166 ID3D11Buffer** d3d11CBs = nullptr;
167 GetResourceArrays(ShaderInd, CBs, d3d11CBs);
157 auto CBArrays = GetResourceArrays<ID3D11Buffer>(ShaderInd);
168158 for (size_t cb = 0; cb < CBCount; ++cb)
169 CBs[cb].~CachedCB();
159 CBArrays.first[cb].~CachedCB();
170160 }
171161
172162 const auto SRVCount = GetSRVCount(ShaderInd);
173163 if (SRVCount != 0)
174164 {
175 CachedResource* SRVResources = nullptr;
176 ID3D11ShaderResourceView** d3d11SRVs = nullptr;
177 GetResourceArrays(ShaderInd, SRVResources, d3d11SRVs);
165 auto SRVArrays = GetResourceArrays<ID3D11ShaderResourceView>(ShaderInd);
178166 for (size_t srv = 0; srv < SRVCount; ++srv)
179 SRVResources[srv].~CachedResource();
167 SRVArrays.first[srv].~CachedResource();
180168 }
181169
182170 const auto SamplerCount = GetSamplerCount(ShaderInd);
183171 if (SamplerCount != 0)
184172 {
185 CachedSampler* Samplers = nullptr;
186 ID3D11SamplerState** d3d11Samplers = nullptr;
187 GetResourceArrays(ShaderInd, Samplers, d3d11Samplers);
173 auto SamArrays = GetResourceArrays<ID3D11SamplerState>(ShaderInd);
188174 for (size_t sam = 0; sam < SamplerCount; ++sam)
189 Samplers[sam].~CachedSampler();
175 SamArrays.first[sam].~CachedSampler();
190176 }
191177
192178 const auto UAVCount = GetUAVCount(ShaderInd);
193179 if (UAVCount != 0)
194180 {
195 CachedResource* UAVResources = nullptr;
196 ID3D11UnorderedAccessView** d3d11UAVs = nullptr;
197 GetResourceArrays(ShaderInd, UAVResources, d3d11UAVs);
181 auto UAVArrays = GetResourceArrays<ID3D11UnorderedAccessView>(ShaderInd);
198182 for (size_t uav = 0; uav < UAVCount; ++uav)
199 UAVResources[uav].~CachedResource();
183 UAVArrays.first[uav].~CachedResource();
200184 }
201185 }
202186 m_Offsets = {};
261245
262246 for (Uint32 ShaderInd = 0; ShaderInd < NumShaderTypes; ++ShaderInd)
263247 {
264 CachedCB* CBs = nullptr;
265 ID3D11Buffer** d3d11CBs = nullptr;
266 CachedResource* SRVResources = nullptr;
267 ID3D11ShaderResourceView** d3d11SRVs = nullptr;
268 CachedSampler* Samplers = nullptr;
269 ID3D11SamplerState** d3d11Samplers = nullptr;
270 CachedResource* UAVResources = nullptr;
271 ID3D11UnorderedAccessView** d3d11UAVs = nullptr;
272
273 GetResourceArrays(ShaderInd, CBs, d3d11CBs);
274 GetResourceArrays(ShaderInd, SRVResources, d3d11SRVs);
275 GetResourceArrays(ShaderInd, Samplers, d3d11Samplers);
276 GetResourceArrays(ShaderInd, UAVResources, d3d11UAVs);
248 const auto CBArrays = GetResourceArrays<ID3D11Buffer>(ShaderInd);
249 const auto SRVArrays = GetResourceArrays<ID3D11ShaderResourceView>(ShaderInd);
250 const auto SamArrays = GetResourceArrays<ID3D11SamplerState>(ShaderInd);
251 const auto UAVArrays = GetResourceArrays<ID3D11UnorderedAccessView>(ShaderInd);
277252
278253 auto CBCount = GetCBCount(ShaderInd);
279254 for (size_t cb = 0; cb < CBCount; ++cb)
280255 {
281 auto& pBuff = CBs[cb].pBuff;
282 auto* pd3d11Buff = d3d11CBs[cb];
256 auto& pBuff = CBArrays.first[cb].pBuff;
257 auto* pd3d11Buff = CBArrays.second[cb];
283258 VERIFY(pBuff == nullptr && pd3d11Buff == nullptr || pBuff != nullptr && pd3d11Buff != nullptr, "CB resource and d3d11 buffer must be set/unset atomically");
284259 if (pBuff != nullptr && pd3d11Buff != nullptr)
285260 {
290265 auto SRVCount = GetSRVCount(ShaderInd);
291266 for (size_t srv = 0; srv < SRVCount; ++srv)
292267 {
293 auto& Res = SRVResources[srv];
294 auto* pd3d11SRV = d3d11SRVs[srv];
268 auto& Res = SRVArrays.first[srv];
269 auto* pd3d11SRV = SRVArrays.second[srv];
295270 DvpVerifyResource(Res, pd3d11SRV, "SRV");
296271 }
297272
298273 auto UAVCount = GetUAVCount(ShaderInd);
299274 for (size_t uav = 0; uav < UAVCount; ++uav)
300275 {
301 auto& Res = UAVResources[uav];
302 auto* pd3d11UAV = d3d11UAVs[uav];
276 auto& Res = UAVArrays.first[uav];
277 auto* pd3d11UAV = UAVArrays.second[uav];
303278 DvpVerifyResource(Res, pd3d11UAV, "UAV");
304279 }
305280
306281 auto SamplerCount = GetSamplerCount(ShaderInd);
307282 for (size_t sam = 0; sam < SamplerCount; ++sam)
308283 {
309 auto& pSampler = Samplers[sam].pSampler;
310 auto* pd3d11Sampler = d3d11Samplers[sam];
284 auto& pSampler = SamArrays.first[sam].pSampler;
285 auto* pd3d11Sampler = SamArrays.second[sam];
311286 VERIFY(pSampler == nullptr && pd3d11Sampler == nullptr || pSampler != nullptr && pd3d11Sampler != nullptr, "CB resource and d3d11 buffer must be set/unset atomically");
312287 if (pSampler != nullptr && pd3d11Sampler != nullptr)
313288 {
338313 if (CBCount == 0)
339314 continue;
340315
341 CachedCB* CBs;
342 ID3D11Buffer** d3d11CBs;
343 GetResourceArrays(ShaderInd, CBs, d3d11CBs);
344
316 auto CBArrays = GetResourceArrays<ID3D11Buffer>(ShaderInd);
345317 for (Uint32 i = 0; i < CBCount; ++i)
346318 {
347 if (auto* pBuffer = CBs[i].pBuff.RawPtr<BufferD3D11Impl>())
319 if (auto* pBuffer = CBArrays.first[i].pBuff.RawPtr<BufferD3D11Impl>())
348320 {
349321 if (pBuffer->IsInKnownState() && !pBuffer->CheckState(RESOURCE_STATE_CONSTANT_BUFFER))
350322 {
373345 if (SRVCount == 0)
374346 continue;
375347
376 CachedResource* SRVResources;
377 ID3D11ShaderResourceView** d3d11SRVs;
378 GetResourceArrays(ShaderInd, SRVResources, d3d11SRVs);
379
348 auto SRVArrays = GetResourceArrays<ID3D11ShaderResourceView>(ShaderInd);
380349 for (Uint32 i = 0; i < SRVCount; ++i)
381350 {
382 auto& SRVRes = SRVResources[i];
351 auto& SRVRes = SRVArrays.first[i];
383352 if (auto* pTexture = SRVRes.pTexture)
384353 {
385354 if (pTexture->IsInKnownState() && !pTexture->CheckAnyState(RESOURCE_STATE_SHADER_RESOURCE | RESOURCE_STATE_INPUT_ATTACHMENT))
430399 if (UAVCount == 0)
431400 continue;
432401
433 CachedResource* UAVResources;
434 ID3D11UnorderedAccessView** d3d11UAVs;
435 GetResourceArrays(ShaderInd, UAVResources, d3d11UAVs);
436
402 auto UAVArrays = GetResourceArrays<ID3D11UnorderedAccessView>(ShaderInd);
437403 for (Uint32 i = 0; i < UAVCount; ++i)
438404 {
439 auto& UAVRes = UAVResources[i];
405 auto& UAVRes = UAVArrays.first[i];
440406 if (auto* pTexture = UAVRes.pTexture)
441407 {
442408 if (pTexture->IsInKnownState() && !pTexture->CheckState(RESOURCE_STATE_UNORDERED_ACCESS))