Opened 4 years ago

Last modified 21 months ago

#453 new enhancement

support of typed array for records/arrays

Reported by: vadim.godunko Owned by:
Priority: major Milestone: 19.0
Component: Matreshka - a2js Version:
Keywords: Cc:

Description (last modified by vadim.godunko)

Data structures for WebGL should preserve raw memory structure to be able to be send to GL server. This requires support from A2JS. For example:

   type Point is record
      X : OpenGL.GLfloat;
      Y : OpenGL.GLfloat;
      Z : OpenGL.GLfloat;
      A : OpenGL.GLubyte;
      B : OpenGL.GLubyte;
      C : OpenGL.GLubyte;
   end record;

   type Point_Array is array (Positive range <>) of Point;

or

   type Point is record
      Coords : OpenGL.GLfloat_Vector_3;
      Id     : OpenGL.GLubyte_Vector_3;
   end record;

   type Point_Array is array (Positive range <>) of Point;

Set of possible types of members are limited:

  • Interfaces.Integer_8 (and derived)
  • Interfaces.Unsigned_8 (and derived)
  • Interfaces.Integer_16 (and derived)
  • Interfaces.Unsigned_16 (and derived)
  • Interfaces.Integer_32 (and derived)
  • Interfaces.IEEE_Float_32 (and derived)
  • vectors and matrices of above types (note, matrices should have convention Fortran to be mapped properly)

Change History (9)

comment:1 by vadim.godunko, 4 years ago

Description: modified (diff)

comment:2 by Maxim Reznik, 4 years ago

In 5550:

Add support for ArrayBuffers. Refs #453

comment:3 by Maxim Reznik, 4 years ago

In 5552:

Fix typo in pragma JavaScript_Typed_Array name.

Refs #453

comment:4 by vadim.godunko, 4 years ago

In 5557:

Use correct view for unsigned byte arrays.

Refs #453.

comment:5 by Maxim Reznik, 4 years ago

In 5618:

Revert [5599]. Refs #453

Represent TypedArray record as Object instead of TypedArray.
So we can return to original type representation.

comment:6 by Maxim Reznik, 4 years ago

In 5619:

Create type in a subprogram as 'var TypeName='

Refs #453

comment:7 by Maxim Reznik, 4 years ago

In 5620:

Add _cast function to convert record aggregate

to corresponding record type. This applies prototype to record
aggregates. Refs #453

comment:8 by vadim.godunko, 21 months ago

Milestone: 0.8.018.0

Milestone renamed

comment:9 by vadim.godunko, 21 months ago

Milestone: 18.019.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.