version 440
layout(location = 1) in vec2 texCoord;
layout(location = 1) in vec2 fragCoord;
layout(location = 1) out vec4 fragColor;
layout(std140, binding = 1) uniform buf {
mat4 qt_Matrix;
float qt_Opacity;
vec4 color;
vec3 iResolution;layout(location = 1) in vec2 texCoord; layout(location = 1) in vec2 fragCoord; layout(location = 1) out vec4 fragColor;
layout(std140, binding = 1) uniform buf { mat4 qt_Matrix; float qt_Opacity; vec4 color; vec3 iResolution; vec2 rectSize; float radius; float blur; };
float roundedBox(vec2 centerPos, vec2 size, float radii) { return length(max(abs(centerPos) - size + radii, 0.0)) - radii; }
void main() { float box = roundedBox(fragCoord - iResolution.xy * 0.5, rectSize, radius); float a = 1.0 - smoothstep(0.0, blur, box); fragColor = color * qt_Opacity * a * a; }Import Statement: import QtQuick.EffectsMultiEffect { anchors.fill: item source: item shadowEnabled: true shadowColor: "#9B9B9B" shadowBlur: 1.0 shadowHorizontalOffset: 8 shadowVerticalOffset: 8 }cython caller.pyx $ gcc -g -Wall -I/usr/include/python3.12 -c caller.c $ gcc -g -Wall -I/usr/include/python3.12 -c main.c $ gcc -g -Wall -I/usr/include/python3.12 -o main *.o -lpython3.12 $ ./main Segmentation fault (core dumped) Here is a backtrace:from helloworld import hw
cdef public void call_hw(): hw() And here is the contents of my main.c file:
#include <Python.h> #include "caller.h"
int main() { Py_Initialize(); call_hw(); Py_Finalize(); }
vec2 rectSize;
float radius;
float blur;
};
float roundedBox(vec2 centerPos, vec2 size, float radii) {
return length(max(abs(centerPos) - size + radii, 0.0)) - radii;
}
void main()
{
float box = roundedBox(fragCoord - iResolution.xy * 0.5, rectSize, radius);
float a = 1.0 - smoothstep(0.0, blur, box);
fragColor = color * qt_Opacity * a * a;
}Import Statement: import QtQuick.EffectsMultiEffect {
anchors.fill: item
source: item
shadowEnabled: true
shadowColor: "#9B9B9B"
shadowBlur: 1.0
shadowHorizontalOffset: 8
shadowVerticalOffset: 8
}cython caller.pyx
$ gcc -g -Wall -I/usr/include/python3.12 -c caller.c
$ gcc -g -Wall -I/usr/include/python3.12 -c main.c
$ gcc -g -Wall -I/usr/include/python3.12 -o main *.o -lpython3.12
$ ./main
Segmentation fault (core dumped)
Here is a backtrace:from helloworld import hw
cdef public void call_hw():
hw()
And here is the contents of my main.c file:
#include <Python.h>
#include "caller.h"
int
main()
{
Py_Initialize();
call_hw();
Py_Finalize();
}