MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / Update

Method Update

GTE/Graphics/GL46/GL46TextureArray.cpp:87–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87bool GL46TextureArray::Update()
88{
89 auto texture = GetTexture();
90 auto const numItems = texture->GetNumItems();
91
92 if (CanAutoGenerateMipmaps())
93 {
94 // Only update the level 0 texture and then generate the remaining
95 // mipmaps from it.
96 for (uint32_t item = 0; item < numItems; ++item)
97 {
98 if (!Update(item, 0))
99 {
100 return false;
101 }
102 }
103 GenerateMipmaps();
104 }
105 else
106 {
107 // Automatic generation of mipmaps is not enabled, so all mipmap
108 // levels must be copied to the GPU.
109 auto const numLevels = texture->GetNumLevels();
110 for (uint32_t item = 0; item < numItems; ++item)
111 {
112 for (uint32_t level = 0; level < numLevels; ++level)
113 {
114 if (!Update(item, level))
115 {
116 return false;
117 }
118 }
119 }
120 }
121
122 return true;
123}
124
125bool GL46TextureArray::CopyCpuToGpu()
126{

Callers

nothing calls this directly

Calls 3

GetNumItemsMethod · 0.80
GetNumLevelsMethod · 0.80
GetUsageMethod · 0.45

Tested by

no test coverage detected