Previous topicNext topic

IMG_SIZE on buffers

Questions, comments, feedback, etc.
Post Reply
Sadler
Posts: 1380
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

IMG_SIZE on buffers

Post by Sadler »

IMG_SIZE() works fine on declared image inputs but fails on multi-pass buffers. Many ISF shaders that call IMG_SIZE all load — but any shader that asks for the size of a pass target fails to compile with:

error C1008: undefined variable "_BufferA_imgRect"

I would expect a pass target to generate the same uniforms as an image input, since IMG_SIZE is part of the ISF spec (albeit slightly ambiguously) and doesn't distinguish between them. Those shaders that fail in Magic with this error, load and run in the Vidvox ISF Editor. The various LLMs often use IMG_SIZE for buffer passes and since buffers can be different from the input image size or the RENDERSIZE, it can be useful.
Magic
Site Admin
Posts: 3735
Joined: Wed Apr 09, 2014 9:28 pm

Re: IMG_SIZE on buffers

Post by Magic »

Can you post an example that works in the ISF editor but not in Magic?
Sadler
Posts: 1380
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: IMG_SIZE on buffers

Post by Sadler »

Here's my harness that tests IMG_SIZE of a buffer. In test #3 (the buffer test) it fails in Magic with "0(53) : error C1503: undefined variable "_bufTest_imgRect" but runs in the ISF editor (shows colour). On many cases I can replace IMG_SIZE with RENDERSIZE but not all.
img-size-buffers.fs
(1.66 KiB) Downloaded 4 times
Magic
Site Admin
Posts: 3735
Joined: Wed Apr 09, 2014 9:28 pm

Re: IMG_SIZE on buffers

Post by Magic »

Ok. We'll fix this for the next build.
Magic
Site Admin
Posts: 3735
Joined: Wed Apr 09, 2014 9:28 pm

Re: IMG_SIZE on buffers

Post by Magic »

Ok. We'll fix this for the next build.
Post Reply