| 85 | } |
| 86 | |
| 87 | bool 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 | |
| 125 | bool GL46TextureArray::CopyCpuToGpu() |
| 126 | { |
nothing calls this directly
no test coverage detected