cancel
Showing results for 
Search instead for 
Did you mean: 

NemaGFX v1.3.0 M7 (STM32H7RS) - Some limitations being worked on?

Jack3
Senior III

Hello STM32 enthusiasts,

While testing NemaGFX v1.3.0 for the STM32H7RS (M7), I discovered some differences compared to NemaGFX v3.5.0 for the STM32U5x9 (M33).

1. nema_clear(color); Doesn't work, I had to come up with some solution:

  nema_matrix3x3_t m;
  NEMA_VG_PAINT_HANDLE paint;
  uint32_t color = nema_rgba(0xFF, 0xFF, 0x00, 0xFF);

  /* Fill the screen with a color */
#if defined(STM32H7S7xx)
  /* Use this on STM32H7RS */
  paint = nema_vg_paint_create();
  nema_vg_paint_clear(paint);
  nema_mat3x3_load_identity(m);

  nema_vg_set_fill_rule(NEMA_VG_FILL_NON_ZERO);
  nema_vg_paint_set_paint_color(paint, color);
  nema_vg_draw_rect(0, 0, DISPLAY_SIZE_W, DISPLAY_SIZE_H, m, paint);

  nema_vg_paint_destroy(paint);
#else
  /* Does not work on STM32H7RS */
  nema_clear(color);
#endif



2. nema_bind_src_tex / nema_blit Does not work with the NEMA_AL88 format, but luckily it does work with the NEMA_ARGB8888 format.

//  Format = NEMA_AL88 /* Doesn't render any output using AL88 bitmaps */
  Format = NEMA_ARGB8888 /* Works fine using ARGB8888 bitmaps */

  nema_set_const_color(nema_rgba(0xFF, 0xFF, 0x00, 0xFF));
  nema_set_blend_blit(nema_blending_mode(NEMA_BF_SRCALPHA, NEMA_BF_INVSRCALPHA, NEMA_BLOP_MODULATE_RGB | NEMA_BLOP_MODULATE_A));
  nema_bind_src_tex(Data, Width, Height, Format, Stride, NEMA_FILTER_BL);
  nema_blit(x, y)

 

3. Not all types of gradients work, like NEMA_VG_PAINT_GRAD_RADIAL and possible more.

  float x = 400;
  float y = 240;
  float w = 100;
  float h = w;
  float w2 = w / 2;
  float h2 = h / 2;

  nema_vg_paint_set_type(paint, NEMA_VG_PAINT_GRAD_RADIAL);
  nema_vg_paint_set_grad_radial(paint, gradient, x + w2, y + h2, w2, 0);

Will these issues be fixed in a later release of NemaGFX?
Or is the GPU2D in the M7 simply not capable of this?
Or am I probably doing it wrong? (Most probably, though!)

Sincerely, Jack.

1 REPLY 1
JBJOE.1
ST Employee

Hi @Jack3 

I think I can help. Let me try to answer:

1.
To me nema_clear() works fine, and the examples in the NeoChromSDK suggests the same. The minimal code would be something like this: 

nema_cmdlist_t cl;
cl = nema_cl_create_sized(8192);
img_obj_t *fbo = get_current_framebuffer();
nema_cl_bind_circular(&cl);
nema_set_clip(0, 0, RESX, RESY);
nema_bind_dst_tex((uintptr_t)fbo->bo.base_phys, RESX, RESY, NEMA_RGB565, -1);
nema_clear(nema_rgba(0, 0, 0, 0xff));

2.
The color format NEMA_AL88 is only supported by STM32U5G9. Unfortunately there is not a good overview to find this information. The next release of the NeoChromSDK will have a full table over the supported colorformats. 
For the STM32H7RS the list is:
NEMA_RGBX8888
NEMA_RGBA8888
NEMA_XRGB8888
NEMA_ARGB8888
NEMA_ABGR8888
NEMA_BGRA8888
NEMA_BGRX8888
NEMA_RGBA5650
NEMA_RGBA5551
NEMA_RGBA4444
NEMA_RGBA0008
NEMA_RGBA3320

3.
Radial gradient is only supported by the STM32U5G9. The limitation lies in the hardware so it is not something that can be added with an update of the library.  
You should get an error if you try to draw the Radial gradient, on a platform that does not support it. The error code is:

NEMA_VG_ERR_NO_RADIAL_ENABLED

Regards, 
Jakob
Jakob BJOERN
Senior Software Engineer | STM32 Graphics