Skip to content

Commit

Permalink
gles: Pull back texture data after glGenerateMipmap
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-clayton committed Nov 2, 2017
1 parent 5a1fca3 commit 715de40
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion gapis/api/gles/api/textures_and_samplers.api
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,19 @@ cmd void glGenerateMipmap(GLenum target) {
glErrorInvalidEnum(target)
}
}
// TODO

texture := GetBoundTextureOrErrorInvalidEnum(target)
if texture != null {
for _, levelIndex, level in texture.Levels {
for _, layerIndex, layer in level.Layers {
if layer.Data == null {
layer.Data = ReadGPUTextureData(texture, levelIndex, layerIndex)
} else {
copy(layer.Data, ReadGPUTextureData(texture, levelIndex, layerIndex))
}
}
}
}
}

sub void GetSamplerParameterv!T(SamplerId sampler, GLenum pname, T* params) {
Expand Down

0 comments on commit 715de40

Please sign in to comment.