BradLarson / GPUImage3

GPUImage 3 is a BSD-licensed Swift framework for GPU-accelerated video and image processing using Metal.
BSD 3-Clause "New" or "Revised" License
2.68k stars 331 forks source link

Crash when running vignette #74

Closed useobjc closed 4 months ago

useobjc commented 4 years ago

Reproduce step:

  1. Run FilterShowcase example
  2. Select Vignette filter

Then, app will crash with next exception:

validateFunctionArguments:3485: failed assertion `Fragment Function(vignetteFragment): 
argument uniform[0] from buffer(1) with offset(0) and length(40) has space for 40 bytes, but argument has a length(48).'
tianye2856 commented 3 years ago

I have the same problem.

agorskih commented 3 years ago

Hi. There is some problem with sending VignetteUniform to the Vignette shader. To quick fix and run sample you can change Vignette.metal file.

typedef struct {
    float3 vignetteCenter;
    float3 vignetteColor;
    float vignetteStart;
    float vignetteEnd;
    float2 junk_padding; # <-- Add this line
} VignetteUniform;
BradLarson commented 4 months ago

This should be fixed as of #91