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

Method CopyCpuToGpu

GTE/Graphics/GL46/GL46TextureArray.cpp:125–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125bool GL46TextureArray::CopyCpuToGpu()
126{
127 auto texture = GetTexture();
128 auto const numItems = texture->GetNumItems();
129
130 if (CanAutoGenerateMipmaps())
131 {
132 // Only update the level 0 texture and then generate the remaining
133 // mipmaps from it.
134 for (uint32_t item = 0; item < numItems; ++item)
135 {
136 if (!CopyCpuToGpu(item, 0))
137 {
138 return false;
139 }
140 }
141 GenerateMipmaps();
142 }
143 else
144 {
145 // Automatic generation of mipmaps is not enabled, so all mipmap
146 // levels must be copied to the GPU.
147 auto const numLevels = texture->GetNumLevels();
148 for (uint32_t item = 0; item < numItems; ++item)
149 {
150 for (uint32_t level = 0; level < numLevels; ++level)
151 {
152 if (!CopyCpuToGpu(item, level))
153 {
154 return false;
155 }
156 }
157 }
158 }
159
160 return true;
161}
162
163bool GL46TextureArray::CopyGpuToCpu()
164{

Callers

nothing calls this directly

Calls 2

GetNumItemsMethod · 0.80
GetNumLevelsMethod · 0.80

Tested by

no test coverage detected