Skip to content

Commit

Permalink
gles compat: Replace GL_BACK to GL_FRONT for glDrawBuffers()
Browse files Browse the repository at this point in the history
We only render single-buffered at the moment.
  • Loading branch information
ben-clayton committed Mar 16, 2018
1 parent f00b839 commit b18cafa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions gapis/api/gles/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,21 @@ func compat(ctx context.Context, device *device.Instance, onError onCompatError)
}
return

case *GlDrawBuffers:
// Currently the default framebuffer for replay is single-buffered
// and so we need to transform any usage of GL_BACK to GL_FRONT.
cmd.Extras().Observations().ApplyReads(s.Memory.ApplicationPool())
bufs := cmd.Bufs.Slice(0, uint64(cmd.N), s.MemoryLayout).MustRead(ctx, cmd, s, nil)
for i, buf := range bufs {
if buf == GLenum_GL_BACK {
bufs[i] = GLenum_GL_FRONT
}
}
tmp := s.AllocDataOrPanic(ctx, bufs)
out.MutateAndWrite(ctx, id, cb.GlDrawBuffers(cmd.N, tmp.Ptr()).AddRead(tmp.Data()))
tmp.Free()
return

case *GlDrawArrays:
if target.vertexArrayObjects == required {
if clientVAsBound(c, clientVAs) {
Expand Down

0 comments on commit b18cafa

Please sign in to comment.