MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / FrameBegin

Method FrameBegin

Source/Engine/GraphicsDevice/WebGPU/GPUContextWebGPU.cpp:69–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void GPUContextWebGPU::FrameBegin()
70{
71 // Base
72 GPUContext::FrameBegin();
73
74 // Setup
75 _usedQuerySets = 0;
76 _renderPassDirty = false;
77 _pipelineDirty = false;
78 _bindGroupDirty = false;
79 _viewportDirty = false;
80 _scissorRectDirty = false;
81 _indexBufferDirty = false;
82 _vertexBufferDirty = false;
83 _indexBuffer32Bit = false;
84 _blendFactorDirty = false;
85 _blendFactorSet = false;
86 _renderTargetCount = 0;
87 _vertexBufferCount = 0;
88 _stencilRef = 0;
89 _blendFactor = Float4::One;
90 _viewport = Viewport(Float2::Zero);
91 _scissorRect = Rectangle::Empty;
92 _renderPass = nullptr;
93 _depthStencil = nullptr;
94 _pipelineState = nullptr;
95 Platform::MemoryClear(&_pipelineKey, sizeof(_pipelineKey));
96 Platform::MemoryClear(&_indexBuffer, sizeof(_indexBuffer));
97 Platform::MemoryClear(&_vertexBuffers, sizeof(_vertexBuffers));
98 Platform::MemoryClear(&_renderTargets, sizeof(_renderTargets));
99 Platform::MemoryClear(&_constantBuffers, sizeof(_constantBuffers));
100 Platform::MemoryClear(&_shaderResources, sizeof(_shaderResources));
101 Platform::MemoryClear(&_storageResources, sizeof(_storageResources));
102 _pendingClears.Clear();
103
104 // Create command encoder
105 WGPUCommandEncoderDescriptor encoderDesc = WGPU_COMMAND_ENCODER_DESCRIPTOR_INIT;
106 Encoder = wgpuDeviceCreateCommandEncoder(_device->Device, &encoderDesc);
107 ASSERT(Encoder);
108
109 // Bind static samplers
110 for (int32 i = 0; i < ARRAY_COUNT(_device->DefaultSamplers); i++)
111 _samplers[i] = _device->DefaultSamplers[i];
112}
113
114void GPUContextWebGPU::FrameEnd()
115{

Callers

nothing calls this directly

Calls 3

MemoryClearFunction · 0.85
ViewportClass · 0.50
ClearMethod · 0.45

Tested by

no test coverage detected