SwiftUI Charts - MTLTextureDescriptor has width (9649) greater than the maximum allowed size of 8192

Hi,

SwiftUI Charts IOS 16.1

I get crash in the Simulator (tried iPhone or iPad). See console message below. The strange thing is that if I ran the same app on my iPhone 12, no crash.

Thank you

2023-01-11 13:58:57.306324+1100 MyMoney[52429:14665675] Metal API Validation Enabled

2023-01-11 13:58:57.451214+1100 MyMoney[52429:14665675] [error] RBLayer: unable to create texture: BGRA8Unorm, [19057, 938]

2023-01-11 13:58:57.451426+1100 MyMoney[52429:14665675] [error] RBLayer: unable to create texture: BGRA8Unorm, [19057, 938]

2023-01-11 13:58:57.470351+1100 MyMoney[52429:14665675] -[MTLTextureDescriptorInternal validateWithDevice:], line 1344: error 'Texture Descriptor Validation

MTLTextureDescriptor has width (9649) greater than the maximum allowed size of 8192.

'

-[MTLTextureDescriptorInternal validateWithDevice:]:1344: failed assertion `Texture Descriptor Validation

MTLTextureDescriptor has width (9649) greater than the maximum allowed size of 8192.

Can you show the code, and the data that you are passing to Chart()? One reason can be: if the data range is very large and the chartXScale is very small, for example, if you are passing data to Chart() for 3 years which has a chartXScale range of only one day, then you might get this error. To fix this, filter your data first and only pass data for the days around your chartXScale(), then you shouldn't get this error.

SwiftUI Charts - MTLTextureDescriptor has width (9649) greater than the maximum allowed size of 8192
 
 
Q