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

Method CopyCpuToGpu

GTE/Graphics/GL46/GL46TextureSingle.cpp:111–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111bool GL46TextureSingle::CopyCpuToGpu()
112{
113 auto texture = GetTexture();
114
115 if (CanAutoGenerateMipmaps())
116 {
117 // Only update the level 0 texture and then generate the remaining
118 // mipmaps from it.
119 if (!CopyCpuToGpu(0))
120 {
121 return false;
122 }
123 GenerateMipmaps();
124 }
125 else
126 {
127 // Automatic generation of mipmaps is not enabled, so all mipmap
128 // levels must be copied to the GPU.
129 auto const numLevels = texture->GetNumLevels();
130 for (uint32_t level = 0; level < numLevels; ++level)
131 {
132 if (!CopyCpuToGpu(level))
133 {
134 return false;
135 }
136 }
137 }
138
139 return true;
140}
141
142bool GL46TextureSingle::CopyGpuToCpu()
143{

Callers

nothing calls this directly

Calls 1

GetNumLevelsMethod · 0.80

Tested by

no test coverage detected