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

Method SetProbeData

Source/Engine/Level/Actors/EnvironmentProbe.cpp:89–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void EnvironmentProbe::SetProbeData(GPUContext* context, GPUTexture* data)
90{
91 // Remove probe asset (if used)
92 _isUsingCustomProbe = false;
93 _probe = nullptr;
94
95 // Allocate probe texture manually
96 if (!_probeTexture)
97 {
98 _probeTexture = GPUTexture::New();
99#if !BUILD_RELEASE
100 _probeTexture->SetName(GetNamePath());
101#endif
102 }
103 if (_probeTexture->Width() != data->Width() || _probeTexture->Format() != data->Format())
104 {
105 auto desc = data->GetDescription();
106 desc.Usage = GPUResourceUsage::Default;
107 desc.Flags = GPUTextureFlags::ShaderResource;
108 if (_probeTexture->Init(desc))
109 return;
110 _probeTexture->SetResidentMipLevels(_probeTexture->MipLevels());
111 }
112
113 // Copy probe texture data
114 context->CopyResource(_probeTexture, data);
115}
116
117void EnvironmentProbe::SetProbeData(TextureData& data)
118{

Callers

nothing calls this directly

Calls 15

GetSceneFunction · 0.85
GetIDFunction · 0.85
DeleteFunction · 0.85
FormatMethod · 0.80
SetResidentMipLevelsMethod · 0.80
GetDataFolderPathMethod · 0.80
GetIDMethod · 0.80
IsVirtualMethod · 0.80
FromTextureDataMethod · 0.80
NewFunction · 0.50
CreateFunction · 0.50
SetNameMethod · 0.45

Tested by

no test coverage detected