exeldro / obs-shaderfilter

OBS Studio filter for applying an arbitrary shader to a source.
GNU General Public License v2.0
377 stars 39 forks source link

Linux filters only behave when actually sampling the image in an expected manner? #32

Open micsthepick opened 8 months ago

micsthepick commented 8 months ago
float4 mainImage(VertData v_in) : TARGET
{
    return float4(1.0, 1.0, 1.0, 1.0);
}

the above shader is a MCVE for a filter that doesn't work on linux, and below is a MCVE for a filter that does:

float4 mainImage(VertData v_in) : TARGET
{
    return float4(image.Sample(textureSampler, v_in.uv).xyz, 1);
}

I'd expect both to work fine?

exeldro commented 8 months ago

When it is not working, what does it show? Is there an error in the OBS log file?

micsthepick commented 8 months ago
21:00:00.202: glGetAttribLocation: Could not find attribute '_input_attrib1'
21:00:00.202: device_draw (GL) failed

EDIT: as for what it shows: a transparent source the same size.

steveftoth commented 6 months ago

seeing this with the built in ascii.shader as well.

steveftoth commented 6 months ago

Update, since I know nothing about the shader language, I tried your change above in the ascii.shader and that seems to fix it on linux. @micsthepick

steveftoth commented 6 months ago

Also wanted to add my environment

uname -a
Linux coleco 6.6.10-76060610-generic #202401051437~1704728131~22.04~24d69e2 SMP PREEMPT_DYNAMIC Mon J x86_64 x86_64 x86_64 GNU/Linux

nvidia-smi
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.29.06              Driver Version: 545.29.06    CUDA Version: 12.3     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 4090        Off | 00000000:01:00.0  On |                  Off |
|  0%   45C    P2              66W / 450W |   2575MiB / 24564MiB |     12%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
micsthepick commented 6 months ago

this is my smi output:

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.29.06              Driver Version: 545.29.06    CUDA Version: 12.3     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 3090        Off | 00000000:06:00.0  On |                  N/A |
| 53%   48C    P5              97W / 350W |    875MiB / 24576MiB |      8%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
makidoll commented 6 months ago

I'm having the same issue with the same error. I can't seem to use variables like v_in.pos.