UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
D3D11StateCachePrivate.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3// Implementation of Device Context State Caching to improve draw
4// thread performance by removing redundant device context calls.
5
6#pragma once
7
8#include "RHIDefinitions.h"
10
11//-----------------------------------------------------------------------------
12// Configuration
13//-----------------------------------------------------------------------------
14
15// If set, enables the D3D11 state caching system.
16#define D3D11_ALLOW_STATE_CACHE 1
17
18// If set, includes a runtime toggle console command for debugging D3D11 state caching.
19// ("TOGGLESTATECACHE")
20#define D3D11_STATE_CACHE_RUNTIME_TOGGLE 0
21
22// If set, includes a cache state verification check.
23// After each state set call, the cached state is compared against the actual state of the ID3D11DeviceContext.
24// This is *very slow* and should only be enabled to debug the state caching system.
25#ifndef D3D11_STATE_CACHE_DEBUG
26#define D3D11_STATE_CACHE_DEBUG 0
27#endif
28
29//-----------------------------------------------------------------------------
30//
31//-----------------------------------------------------------------------------
32
33// Keep set state functions inline to reduce call overhead
34#define D3D11_STATE_CACHE_INLINE FORCEINLINE
35//#define DO_CHECK 1
36//#define D3D11_STATE_CACHE_DEBUG 1
37
38
39#if D3D11_ALLOW_STATE_CACHE && D3D11_STATE_CACHE_DEBUG && DO_CHECK
40 #define D3D11_STATE_CACHE_VERIFY(...) VerifyCacheState()
41 #define D3D11_STATE_CACHE_VERIFY_PRE(...) VerifyCacheStatePre()
42 #define D3D11_STATE_CACHE_VERIFY_POST(...) VerifyCacheStatePost()
43#else
44 #define D3D11_STATE_CACHE_VERIFY(...)
45 #define D3D11_STATE_CACHE_VERIFY_PRE(...)
46 #define D3D11_STATE_CACHE_VERIFY_POST(...)
47#endif
48
49#if D3D11_ALLOW_STATE_CACHE && D3D11_STATE_CACHE_RUNTIME_TOGGLE
50extern bool GD3D11SkipStateCaching;
51#else
52static const bool GD3D11SkipStateCaching = false;
53#endif
54
55//-----------------------------------------------------------------------------
56// FD3D11StateCache Class Definition
57//-----------------------------------------------------------------------------
59{
60public:
61 bool bDepthBoundsEnabled = false;
62 float DepthBoundsMin = 0.0f;
63 float DepthBoundsMax = 1.0f;
64
65protected:
67
68#if D3D11_ALLOW_STATE_CACHE
69 // Shader Resource Views Cache
71
72 // Rasterizer State Cache
74
75 // Depth Stencil State Cache
78
79 // Shader Cache
84
85 // Blend State Cache
89
90 // Viewport
93
94
95 // Vertex Buffer State
102
103 // Index Buffer State
107
108 // Primitive Topology State
110
111 // Input Layout State
113
115
116 // Sampler State
118
119 // Constant Buffer State
126
128
129#endif
130
131 template <EShaderFrequency ShaderFrequency>
133 {
134 // Set the SRV we have been given (or null).
135 CA_SUPPRESS(6326);
136 switch (ShaderFrequency)
137 {
138 case SF_Vertex: Direct3DDeviceIMContext->VSSetShaderResources(ResourceIndex, 1, &SRV); break;
139 case SF_Geometry: Direct3DDeviceIMContext->GSSetShaderResources(ResourceIndex, 1, &SRV); break;
140 case SF_Pixel: Direct3DDeviceIMContext->PSSetShaderResources(ResourceIndex, 1, &SRV); break;
141 case SF_Compute: Direct3DDeviceIMContext->CSSetShaderResources(ResourceIndex, 1, &SRV); break;
142 }
143 }
144
145 template <EShaderFrequency ShaderFrequency>
147 {
148 CA_SUPPRESS(6326);
149 switch (ShaderFrequency)
150 {
151 case SF_Vertex: Direct3DDeviceIMContext->VSSetSamplers(SamplerIndex, 1, &SamplerState); break;
152 case SF_Geometry: Direct3DDeviceIMContext->GSSetSamplers(SamplerIndex, 1, &SamplerState); break;
153 case SF_Pixel: Direct3DDeviceIMContext->PSSetSamplers(SamplerIndex, 1, &SamplerState); break;
154 case SF_Compute: Direct3DDeviceIMContext->CSSetSamplers(SamplerIndex, 1, &SamplerState); break;
155 }
156 }
157
158 template <EShaderFrequency ShaderFrequency>
160 {
161 CA_SUPPRESS(6326);
162 switch (ShaderFrequency)
163 {
164 case SF_Vertex: Direct3DDeviceIMContext->VSSetConstantBuffers(SlotIndex, 1, &ConstantBuffer); break;
165 case SF_Geometry: Direct3DDeviceIMContext->GSSetConstantBuffers(SlotIndex, 1, &ConstantBuffer); break;
166 case SF_Pixel: Direct3DDeviceIMContext->PSSetConstantBuffers(SlotIndex, 1, &ConstantBuffer); break;
167 case SF_Compute: Direct3DDeviceIMContext->CSSetConstantBuffers(SlotIndex, 1, &ConstantBuffer); break;
168 }
169 }
170
188
189 template <EShaderFrequency ShaderFrequency>
191 {
192#if D3D11_ALLOW_STATE_CACHE
194 check(ResourceIndex < ARRAYSIZE(CurrentShaderResourceViews[ShaderFrequency]));
195 if ((CurrentShaderResourceViews[ShaderFrequency][ResourceIndex] != SRV) || GD3D11SkipStateCaching)
196 {
197 if(SRV)
198 {
199 SRV->AddRef();
200 }
201 if(CurrentShaderResourceViews[ShaderFrequency][ResourceIndex])
202 {
203 CurrentShaderResourceViews[ShaderFrequency][ResourceIndex]->Release();
204 }
205 CurrentShaderResourceViews[ShaderFrequency][ResourceIndex] = SRV;
207 }
209#else // !D3D11_ALLOW_STATE_CACHE
211#endif
212 }
213
215 {
216#if D3D11_ALLOW_STATE_CACHE
218 check(StreamIndex < ARRAYSIZE(CurrentVertexBuffers));
220 if ((Slot.VertexBuffer != VertexBuffer || Slot.Offset != Offset || Slot.Stride != Stride) || GD3D11SkipStateCaching)
221 {
223 Slot.Offset = Offset;
224 Slot.Stride = Stride;
225 Direct3DDeviceIMContext->IASetVertexBuffers(StreamIndex, 1, &VertexBuffer, &Stride, &Offset);
226 }
228#else
229 Direct3DDeviceIMContext->IASetVertexBuffers(StreamIndex, 1, &VertexBuffer, &Stride, &Offset);
230#endif
231 }
232
233 template <EShaderFrequency ShaderFrequency>
249
250public:
251 template <EShaderFrequency ShaderFrequency>
253 {
254#if D3D11_ALLOW_STATE_CACHE
256#endif
258 CA_SUPPRESS(6326);
259 switch (ShaderFrequency)
260 {
265 }
266 }
267
268 template <EShaderFrequency ShaderFrequency>
273
275 {
276#if D3D11_ALLOW_STATE_CACHE
278 if ((CurrentNumberOfViewports != 1 || FMemory::Memcmp(&CurrentViewport[0],&Viewport, sizeof(D3D11_VIEWPORT))) || GD3D11SkipStateCaching)
279 {
280 FMemory::Memcpy(&CurrentViewport[0], &Viewport, sizeof(D3D11_VIEWPORT));
282 Direct3DDeviceIMContext->RSSetViewports(1,&Viewport);
283 }
285#else // !D3D11_ALLOW_STATE_CACHE
286 Direct3DDeviceIMContext->RSSetViewports(1,&Viewport);
287#endif // D3D11_ALLOW_STATE_CACHE
288 }
289
291 {
292#if D3D11_ALLOW_STATE_CACHE
294 if ((CurrentNumberOfViewports != Count || FMemory::Memcmp(&CurrentViewport[0], Viewports, sizeof(D3D11_VIEWPORT) * Count)) || GD3D11SkipStateCaching)
295 {
296 FMemory::Memcpy(&CurrentViewport[0], Viewports, sizeof(D3D11_VIEWPORT) * Count);
298 Direct3DDeviceIMContext->RSSetViewports(Count, Viewports);
299 }
301#else // !D3D11_ALLOW_STATE_CACHE
302 Direct3DDeviceIMContext->RSSetViewports(Count, Viewports);
303#endif // D3D11_ALLOW_STATE_CACHE
304 }
305
307 {
308#if D3D11_ALLOW_STATE_CACHE
309 check(Viewport);
311#else // !D3D11_ALLOW_STATE_CACHE
312 uint32 one = 1;
313 Direct3DDeviceIMContext->RSGetViewports(&one,Viewport);
314#endif // D3D11_ALLOW_STATE_CACHE
315 }
316
318 {
319#if D3D11_ALLOW_STATE_CACHE
320 check (*Count);
321 if (Viewports) //NULL is legal if you just want count
322 {
323 //as per d3d spec
326 if (CopyCount > 0)
327 {
328 FMemory::Memcpy(Viewports, &CurrentViewport[0], sizeof(D3D11_VIEWPORT) * CopyCount);
329 }
330 //remaining viewports in supplied array must be set to zero
332 {
334 }
335 }
337
338#else // !D3D11_ALLOW_STATE_CACHE
339 Direct3DDeviceIMContext->RSGetViewports(Count, Viewports);
340#endif // D3D11_ALLOW_STATE_CACHE
341 }
342
343 template <EShaderFrequency ShaderFrequency>
348
349 template <EShaderFrequency ShaderFrequency>
351 {
352#if D3D11_ALLOW_STATE_CACHE
354 FD3D11ConstantBufferState& Current = CurrentConstantBuffers[ShaderFrequency][SlotIndex];
355 if ((Current.Buffer != ConstantBuffer || Current.FirstConstant != 0 || Current.NumConstants != D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT) || GD3D11SkipStateCaching)
356 {
358 Current.FirstConstant = 0;
361 }
363#else
365#endif
366 }
367
369 {
370#if D3D11_ALLOW_STATE_CACHE
372 if ((CurrentRasterizerState != State) || GD3D11SkipStateCaching)
373 {
375 Direct3DDeviceIMContext->RSSetState(State);
376 }
378#else
379 Direct3DDeviceIMContext->RSSetState(State);
380#endif
381 }
382
383 D3D11_STATE_CACHE_INLINE void SetBlendState(ID3D11BlendState* State, const float BlendFactor[4], uint32 SampleMask)
384 {
385#if D3D11_ALLOW_STATE_CACHE
387 if ((CurrentBlendState != State || CurrentBlendSampleMask != SampleMask || FMemory::Memcmp(CurrentBlendFactor, BlendFactor, sizeof(CurrentBlendFactor))) || GD3D11SkipStateCaching)
388 {
389 CurrentBlendState = State;
390 CurrentBlendSampleMask = SampleMask;
392 Direct3DDeviceIMContext->OMSetBlendState(State, BlendFactor, SampleMask);
393 }
395#else
396 Direct3DDeviceIMContext->OMSetBlendState(State, BlendFactor, SampleMask);
397#endif
398 }
399
400 D3D11_STATE_CACHE_INLINE void SetBlendFactor(const float BlendFactor[4], uint32 SampleMask)
401 {
402#if D3D11_ALLOW_STATE_CACHE
404 if ((CurrentBlendSampleMask != SampleMask || FMemory::Memcmp(CurrentBlendFactor, BlendFactor, sizeof(CurrentBlendFactor))) || GD3D11SkipStateCaching)
405 {
406 CurrentBlendSampleMask = SampleMask;
408 Direct3DDeviceIMContext->OMSetBlendState(CurrentBlendState, BlendFactor, SampleMask);
409 }
411#else
412 Direct3DDeviceIMContext->OMSetBlendState(CurrentBlendState, BlendFactor, SampleMask);
413#endif
414 }
415
417 {
418#if D3D11_ALLOW_STATE_CACHE
420 if ((CurrentDepthStencilState != State || CurrentReferenceStencil != RefStencil) || GD3D11SkipStateCaching)
421 {
424 Direct3DDeviceIMContext->OMSetDepthStencilState(State, RefStencil);
425 }
427#else
428 Direct3DDeviceIMContext->OMSetDepthStencilState(State, RefStencil);
429#endif
430 }
431
433 {
434#if D3D11_ALLOW_STATE_CACHE
436 if (CurrentReferenceStencil != RefStencil || GD3D11SkipStateCaching)
437 {
440 }
442#else
444#endif
445 }
446
448 {
449#if D3D11_ALLOW_STATE_CACHE
451 if ((CurrentVertexShader != Shader) || GD3D11SkipStateCaching)
452 {
454 Direct3DDeviceIMContext->VSSetShader(Shader, nullptr, 0);
455 }
457#else
458 Direct3DDeviceIMContext->VSSetShader(Shader, nullptr, 0);
459#endif
460 }
461
463 {
464#if D3D11_ALLOW_STATE_CACHE
467 {
468 CurrentVertexShader->AddRef();
469 }
470#else
471 Direct3DDeviceIMContext->VSGetShader(VertexShader, nullptr, nullptr);
472#endif
473 }
474
476 {
477#if D3D11_ALLOW_STATE_CACHE
479 if ((CurrentGeometryShader != Shader) || GD3D11SkipStateCaching)
480 {
482 Direct3DDeviceIMContext->GSSetShader(Shader, nullptr, 0);
483 }
485#else
486 Direct3DDeviceIMContext->GSSetShader(Shader, nullptr, 0);
487#endif
488 }
489
491 {
492#if D3D11_ALLOW_STATE_CACHE
493 *GeometryShader = CurrentGeometryShader;
495 {
496 CurrentGeometryShader->AddRef();
497 }
498#else
499 Direct3DDeviceIMContext->GSGetShader(GeometryShader, nullptr, nullptr);
500#endif
501 }
502
504 {
505#if D3D11_ALLOW_STATE_CACHE
507 if ((CurrentPixelShader != Shader) || GD3D11SkipStateCaching)
508 {
510 Direct3DDeviceIMContext->PSSetShader(Shader, nullptr, 0);
511 }
513#else
514 Direct3DDeviceIMContext->PSSetShader(Shader, nullptr, 0);
515#endif
516 }
517
519 {
520#if D3D11_ALLOW_STATE_CACHE
523 {
524 CurrentPixelShader->AddRef();
525 }
526#else
527 Direct3DDeviceIMContext->PSGetShader(PixelShader, nullptr, nullptr);
528#endif
529 }
530
532 {
533#if D3D11_ALLOW_STATE_CACHE
535 if ((CurrentComputeShader != Shader) || GD3D11SkipStateCaching)
536 {
538 Direct3DDeviceIMContext->CSSetShader(Shader, nullptr, 0);
539 }
541#else
542 Direct3DDeviceIMContext->CSSetShader(Shader, nullptr, 0);
543#endif
544 }
545
547 {
548#if D3D11_ALLOW_STATE_CACHE
551 {
552 CurrentComputeShader->AddRef();
553 }
554#else
555 Direct3DDeviceIMContext->CSGetShader(ComputeShader, nullptr, nullptr);
556#endif
557 }
558
563
565 {
566#if D3D11_ALLOW_STATE_CACHE
568 if ((CurrentInputLayout != InputLayout) || GD3D11SkipStateCaching)
569 {
570 CurrentInputLayout = InputLayout;
571 Direct3DDeviceIMContext->IASetInputLayout(InputLayout);
572 }
574#else
575 Direct3DDeviceIMContext->IASetInputLayout(InputLayout);
576#endif
577 }
578
580 {
581 ensure(Stride == StreamStrides[StreamIndex]);
582 InternalSetStreamSource(VertexBuffer, StreamIndex, Stride, Offset);
583 }
584
589
590public:
591
596
598 {
599#if D3D11_ALLOW_STATE_CACHE
601 if ((CurrentPrimitiveTopology != PrimitiveTopology) || GD3D11SkipStateCaching)
602 {
604 Direct3DDeviceIMContext->IASetPrimitiveTopology(PrimitiveTopology);
605 }
607#else
608 Direct3DDeviceIMContext->IASetPrimitiveTopology(PrimitiveTopology);
609#endif
610 }
611
617
619 {
621
622#if D3D11_ALLOW_STATE_CACHE
624#endif
625 }
626
628 {
629 }
630
637
643 virtual void ClearState();
644
645#if D3D11_ALLOW_STATE_CACHE && D3D11_STATE_CACHE_DEBUG
646protected:
647 // Debug helper methods to verify cached state integrity.
648 template <EShaderFrequency ShaderFrequency>
649 void VerifySamplerStates();
650
651 template <EShaderFrequency ShaderFrequency>
653
654 template <EShaderFrequency ShaderFrequency>
656
657 void VerifyCacheStatePre();
659 void VerifyCacheState();
660#endif
661};
#define check(expr)
Definition AssertionMacros.h:314
#define ensure( InExpression)
Definition AssertionMacros.h:464
#define CA_SUPPRESS(WarningNumber)
Definition CoreMiscDefines.h:125
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define D3D11_STATE_CACHE_VERIFY(...)
Definition D3D11StateCachePrivate.h:44
#define D3D11_STATE_CACHE_INLINE
Definition D3D11StateCachePrivate.h:34
#define D3D11_STATE_CACHE_VERIFY_POST(...)
Definition D3D11StateCachePrivate.h:46
#define D3D11_STATE_CACHE_VERIFY_PRE(...)
Definition D3D11StateCachePrivate.h:45
@ SF_Compute
Definition RHIDefinitions.h:208
@ SF_Vertex
Definition RHIDefinitions.h:203
@ SF_Geometry
Definition RHIDefinitions.h:207
@ SF_Pixel
Definition RHIDefinitions.h:206
@ SF_NumStandardFrequencies
Definition RHIDefinitions.h:222
@ MaxVertexElementCount
Definition RHIDefinitions.h:276
uint32 Offset
Definition VulkanMemory.cpp:4033
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition D3D11StateCachePrivate.h:59
D3D11_STATE_CACHE_INLINE void SetSamplerState(ID3D11SamplerState *SamplerState, uint32 SamplerIndex)
Definition D3D11StateCachePrivate.h:344
virtual void ClearState()
Definition D3D11StateCache.cpp:263
D3D11_STATE_CACHE_INLINE void SetRasterizerState(ID3D11RasterizerState *State)
Definition D3D11StateCachePrivate.h:368
D3D11_STATE_CACHE_INLINE void SetPixelShader(ID3D11PixelShader *Shader)
Definition D3D11StateCachePrivate.h:503
D3D11_STATE_CACHE_INLINE void SetComputeShader(ID3D11ComputeShader *Shader)
Definition D3D11StateCachePrivate.h:531
D3D11_STATE_CACHE_INLINE void GetPixelShader(ID3D11PixelShader **PixelShader)
Definition D3D11StateCachePrivate.h:518
uint32 CurrentIndexOffset
Definition D3D11StateCachePrivate.h:106
float DepthBoundsMax
Definition D3D11StateCachePrivate.h:63
D3D11_STATE_CACHE_INLINE void InternalSetSamplerState(uint32 SamplerIndex, ID3D11SamplerState *&SamplerState)
Definition D3D11StateCachePrivate.h:146
D3D11_STATE_CACHE_INLINE void SetStencilRef(uint32 RefStencil)
Definition D3D11StateCachePrivate.h:432
D3D11_STATE_CACHE_INLINE void SetVertexShader(ID3D11VertexShader *Shader)
Definition D3D11StateCachePrivate.h:447
D3D11_STATE_CACHE_INLINE void InternalSetSamplerState(ID3D11SamplerState *SamplerState, uint32 SamplerIndex)
Definition D3D11StateCachePrivate.h:234
uint16 StreamStrides[MaxVertexElementCount]
Definition D3D11StateCachePrivate.h:114
ID3D11DeviceContext * Direct3DDeviceIMContext
Definition D3D11StateCachePrivate.h:66
ID3D11RasterizerState * CurrentRasterizerState
Definition D3D11StateCachePrivate.h:73
float CurrentBlendFactor[4]
Definition D3D11StateCachePrivate.h:86
D3D11_STATE_CACHE_INLINE void SetInputLayout(ID3D11InputLayout *InputLayout)
Definition D3D11StateCachePrivate.h:564
D3D11_STATE_CACHE_INLINE void GetViewport(D3D11_VIEWPORT *Viewport)
Definition D3D11StateCachePrivate.h:306
D3D11_STATE_CACHE_INLINE void SetStreamSource(ID3D11Buffer *VertexBuffer, uint32 StreamIndex, uint32 Stride, uint32 Offset)
Definition D3D11StateCachePrivate.h:579
D3D11_STATE_CACHE_INLINE void GetVertexShader(ID3D11VertexShader **VertexShader)
Definition D3D11StateCachePrivate.h:462
ID3D11PixelShader * CurrentPixelShader
Definition D3D11StateCachePrivate.h:82
bool bAlwaysSetIndexBuffers
Definition D3D11StateCachePrivate.h:127
D3D11_STATE_CACHE_INLINE void SetStreamStrides(const uint16 *InStreamStrides)
Definition D3D11StateCachePrivate.h:559
D3D11_STATE_CACHE_INLINE void SetStreamSource(ID3D11Buffer *VertexBuffer, uint32 StreamIndex, uint32 Offset)
Definition D3D11StateCachePrivate.h:585
uint32 CurrentReferenceStencil
Definition D3D11StateCachePrivate.h:76
uint32 CurrentBlendSampleMask
Definition D3D11StateCachePrivate.h:87
D3D11_STATE_CACHE_INLINE void InternalSetShaderResourceView(uint32 ResourceIndex, ID3D11ShaderResourceView *&SRV)
Definition D3D11StateCachePrivate.h:132
D3D11_STATE_CACHE_INLINE void SetViewport(D3D11_VIEWPORT Viewport)
Definition D3D11StateCachePrivate.h:274
D3D11_STATE_CACHE_INLINE void GetGeometryShader(ID3D11GeometryShader **GeometryShader)
Definition D3D11StateCachePrivate.h:490
virtual D3D11_STATE_CACHE_INLINE void SetContext(ID3D11DeviceContext *InDeviceContext)
Definition D3D11StateCachePrivate.h:631
ID3D11ComputeShader * CurrentComputeShader
Definition D3D11StateCachePrivate.h:83
D3D11_STATE_CACHE_INLINE void GetViewports(uint32 *Count, D3D11_VIEWPORT *Viewports)
Definition D3D11StateCachePrivate.h:317
D3D11_VIEWPORT CurrentViewport[D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE]
Definition D3D11StateCachePrivate.h:92
ID3D11GeometryShader * CurrentGeometryShader
Definition D3D11StateCachePrivate.h:81
virtual ~FD3D11StateCacheBase()
Definition D3D11StateCachePrivate.h:627
ID3D11DepthStencilState * CurrentDepthStencilState
Definition D3D11StateCachePrivate.h:77
ID3D11ShaderResourceView * CurrentShaderResourceViews[SF_NumStandardFrequencies][D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT]
Definition D3D11StateCachePrivate.h:70
float DepthBoundsMin
Definition D3D11StateCachePrivate.h:62
D3D11_STATE_CACHE_INLINE void GetComputeShader(ID3D11ComputeShader **ComputeShader)
Definition D3D11StateCachePrivate.h:546
bool bDepthBoundsEnabled
Definition D3D11StateCachePrivate.h:61
struct FD3D11StateCacheBase::FD3D11ConstantBufferState CurrentConstantBuffers[SF_NumStandardFrequencies][D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT]
D3D11_STATE_CACHE_INLINE void SetBlendState(ID3D11BlendState *State, const float BlendFactor[4], uint32 SampleMask)
Definition D3D11StateCachePrivate.h:383
ID3D11SamplerState * CurrentSamplerStates[SF_NumStandardFrequencies][D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT]
Definition D3D11StateCachePrivate.h:117
D3D11_STATE_CACHE_INLINE void SetViewports(uint32 Count, D3D11_VIEWPORT *Viewports)
Definition D3D11StateCachePrivate.h:290
D3D11_STATE_CACHE_INLINE void SetIndexBuffer(ID3D11Buffer *IndexBuffer, DXGI_FORMAT Format, uint32 Offset)
Definition D3D11StateCachePrivate.h:592
D3D11_STATE_CACHE_INLINE void SetConstantBuffer(ID3D11Buffer *ConstantBuffer, uint32 SlotIndex)
Definition D3D11StateCachePrivate.h:350
DXGI_FORMAT CurrentIndexFormat
Definition D3D11StateCachePrivate.h:105
D3D11_STATE_CACHE_INLINE void SetShaderResourceView(ID3D11ShaderResourceView *SRV, uint32 ResourceIndex)
Definition D3D11StateCachePrivate.h:269
D3D11_STATE_CACHE_INLINE void SetDepthStencilState(ID3D11DepthStencilState *State, uint32 RefStencil)
Definition D3D11StateCachePrivate.h:416
D3D11_STATE_CACHE_INLINE void SetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY PrimitiveTopology)
Definition D3D11StateCachePrivate.h:597
D3D11_STATE_CACHE_INLINE void InternalSetStreamSource(ID3D11Buffer *VertexBuffer, uint32 StreamIndex, uint32 Stride, uint32 Offset)
Definition D3D11StateCachePrivate.h:214
D3D11_STATE_CACHE_INLINE void InternalSetShaderResourceView(ID3D11ShaderResourceView *&SRV, uint32 ResourceIndex)
Definition D3D11StateCachePrivate.h:190
ID3D11BlendState * CurrentBlendState
Definition D3D11StateCachePrivate.h:88
ID3D11VertexShader * CurrentVertexShader
Definition D3D11StateCachePrivate.h:80
D3D11_STATE_CACHE_INLINE void InternalSetSetConstantBuffer(uint32 SlotIndex, ID3D11Buffer *&ConstantBuffer)
Definition D3D11StateCachePrivate.h:159
ID3D11InputLayout * CurrentInputLayout
Definition D3D11StateCachePrivate.h:112
D3D11_PRIMITIVE_TOPOLOGY CurrentPrimitiveTopology
Definition D3D11StateCachePrivate.h:109
D3D11_STATE_CACHE_INLINE void InternalSetIndexBuffer(ID3D11Buffer *IndexBuffer, DXGI_FORMAT Format, uint32 Offset)
Definition D3D11StateCachePrivate.h:171
struct FD3D11StateCacheBase::FD3D11VertexBufferState CurrentVertexBuffers[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT]
ID3D11Buffer * CurrentIndexBuffer
Definition D3D11StateCachePrivate.h:104
D3D11_STATE_CACHE_INLINE void SetGeometryShader(ID3D11GeometryShader *Shader)
Definition D3D11StateCachePrivate.h:475
uint32 CurrentNumberOfViewports
Definition D3D11StateCachePrivate.h:91
void Init(ID3D11DeviceContext *InDeviceContext, bool bInAlwaysSetIndexBuffers=false)
Definition D3D11StateCachePrivate.h:618
D3D11_STATE_CACHE_INLINE void ClearConstantBuffers()
Definition D3D11StateCachePrivate.h:252
D3D11_STATE_CACHE_INLINE void SetBlendFactor(const float BlendFactor[4], uint32 SampleMask)
Definition D3D11StateCachePrivate.h:400
FD3D11StateCacheBase()
Definition D3D11StateCachePrivate.h:612
Definition D3D11StateCachePrivate.h:121
ID3D11Buffer * Buffer
Definition D3D11StateCachePrivate.h:122
uint32 NumConstants
Definition D3D11StateCachePrivate.h:124
uint32 FirstConstant
Definition D3D11StateCachePrivate.h:123
Definition D3D11StateCachePrivate.h:97
uint32 Stride
Definition D3D11StateCachePrivate.h:99
uint32 Offset
Definition D3D11StateCachePrivate.h:100
ID3D11Buffer * VertexBuffer
Definition D3D11StateCachePrivate.h:98
static UE_FORCEINLINE_HINT void * Memzero(void *Dest, SIZE_T Count)
Definition UnrealMemory.h:131
static UE_FORCEINLINE_HINT int32 Memcmp(const void *Buf1, const void *Buf2, SIZE_T Count)
Definition UnrealMemory.h:114
static UE_FORCEINLINE_HINT void * Memcpy(void *Dest, const void *Src, SIZE_T Count)
Definition UnrealMemory.h:160
static UE_FORCEINLINE_HINT void * Memset(void *Dest, uint8 Char, SIZE_T Count)
Definition UnrealMemory.h:119