You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: framebindings.go
    path of file: ./repos/gapid/gapis/api/gvr
    
    the code of the file until where you have to start completion: // Copyright (C) 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASI
    
func (r *FrameBindingsResolvable) Resolve(ctx context.Context) (interface{}, error) {
	ctx = capture.Put(ctx, r.Capture)

	cmds, err := resolve.Cmds(ctx, r.Capture)
	if err != nil {
		return nil, err
	}

	s, err := capture.NewState(ctx)
	if err != nil {
		return nil, err
	}

	out := &frameBindings{
		submitBuffer: map[api.CmdID]gles.FramebufferId{},
	}
	frameToBuffer := map[GvrFrameᵖ]gles.FramebufferId{}

	err = api.ForeachCmd(ctx, cmds, true, func(ctx context.Context, id api.CmdID, cmd api.Cmd) error {
		switch cmd := cmd.(type) {
		case *Gvr_frame_submit:
			// Annoyingly gvr_frame_submit takes a pointer to the frame pointer,
			// just so it can be nullified before returning. To avoid another
			// state mutation just to get the pointer, cache them here.
			cmd.extras.Observations().ApplyReads(s.Memory.ApplicationPool())
			frame, err := cmd.Frame().Read(ctx, cmd, s, nil)
			if err != nil {
				return err
			}
			out.submitBuffer[id] = frameToBuffer[frame]
		case *Gvr_frame_get_framebuffer_object:
			frameToBuffer[GvrFrameᵖ(cmd.Frame())] = gles.FramebufferId(cmd.Result())
		case *gles.GlBindFramebuffer:
			if callerID := cmd.Caller(); callerID != api.CmdNoID {
				switch caller := cmds[callerID].(type) {
				case *Gvr_frame_bind_buffer:
					if caller.Index() == 0 { // Only consider the 0'th frame index.
						frameToBuffer[caller.Frame()] = cmd.Framebuffer()
					}
				}
			}
		}
		if err := cmd.Mutate(ctx, id, s, nil, nil); err != nil {
			return fmt.Errorf("Fail to mutate cmd %v: %v", cmd, err)
		}
		return nil
	})

	if err != nil {
		return nil, err
	}

	return out, nil
}