| //////////////////////////////////////////////////////////////////////////////// |
| // Do not modify! |
| // Generated by codergen -go=payload_code.go |
| //////////////////////////////////////////////////////////////////////////////// |
| |
| package vm |
| |
| import ( |
| "android.googlesource.com/platform/tools/gpu/binary" |
| ) |
| |
| func init() { |
| //struct vm.Payload { StackSize:uint32, VolatileMemorySize:uint32, Constants:Data, Resources:[]ResourceInfo, Opcodes:Data } |
| binary.Register(binary.ID{0xa9, 0x21, 0x9f, 0x4a, 0x14, 0x2f, 0x7a, 0x81, 0xcc, 0xf6, 0xcc, 0x7a, 0xc8, 0x2e, 0xb5, 0x68, 0x1e, 0x36, 0xb2, 0xba}, &Payload{}) |
| //struct vm.ResourceInfo { Id:string, Size:uint32 } |
| binary.Register(binary.ID{0x05, 0xe3, 0x01, 0x48, 0x58, 0x28, 0x2e, 0x05, 0x50, 0x33, 0x6c, 0xf8, 0xf9, 0xb1, 0xe1, 0x3b, 0x70, 0xde, 0xae, 0xbe}, &ResourceInfo{}) |
| |
| } |
| |
| func (o Payload) Encode(e *binary.Encoder) error { |
| |
| if err := e.Uint32(o.StackSize); err != nil { |
| return err |
| } |
| if err := e.Uint32(o.VolatileMemorySize); err != nil { |
| return err |
| } |
| if err := o.Constants.Encode(e); err != nil { |
| return err |
| } |
| if err := e.Int32(int32(len(o.Resources))); err != nil { |
| return err |
| } |
| for i := range o.Resources { |
| |
| if err := o.Resources[i].Encode(e); err != nil { |
| return err |
| } |
| } |
| if err := o.Opcodes.Encode(e); err != nil { |
| return err |
| } |
| return nil |
| } |
| |
| func (o *Payload) Decode(d *binary.Decoder) error { |
| |
| if obj, err := d.Uint32(); err != nil { |
| return err |
| } else { |
| o.StackSize = uint32(obj) |
| } |
| if obj, err := d.Uint32(); err != nil { |
| return err |
| } else { |
| o.VolatileMemorySize = uint32(obj) |
| } |
| if err := o.Constants.Decode(d); err != nil { |
| return err |
| } |
| if count, err := d.Int32(); err != nil { |
| return err |
| } else { |
| o.Resources = make([]ResourceInfo, count) |
| for i := range o.Resources { |
| |
| if err := o.Resources[i].Decode(d); err != nil { |
| return err |
| } |
| } |
| } |
| if err := o.Opcodes.Decode(d); err != nil { |
| return err |
| } |
| return nil |
| } |
| |
| func (o ResourceInfo) Encode(e *binary.Encoder) error { |
| |
| if err := e.String(o.Id); err != nil { |
| return err |
| } |
| if err := e.Uint32(o.Size); err != nil { |
| return err |
| } |
| return nil |
| } |
| |
| func (o *ResourceInfo) Decode(d *binary.Decoder) error { |
| |
| if obj, err := d.String(); err != nil { |
| return err |
| } else { |
| o.Id = string(obj) |
| } |
| if obj, err := d.Uint32(); err != nil { |
| return err |
| } else { |
| o.Size = uint32(obj) |
| } |
| return nil |
| } |