love_Canvases undeclared identifier, cannot get shader to compile

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
bombquake
Prole
Posts: 5
Joined: Sat Sep 02, 2023 2:00 am
Contact:

love_Canvases undeclared identifier, cannot get shader to compile

Post by bombquake »

Hello
I'm writing shader code that writes to multiple canvses, but keep getting

Code: Select all

Version 11.4.0 - Mysterious Mysteries
Error: Error validating pixel shader code:
Line 211: ERROR: 'love_Canvases' : undeclared identifier 
Line 211: ERROR: 'love_Canvases' :  left of '[' is not of type array, matrix, or vector  
Line 211: ERROR: '' : missing #endif 
Line 211: ERROR: '' : compilation terminated 
ERROR: 4 compilation errors.  No code generated.
stack traceback:
	[love "boot.lua"]:345: in function <[love "boot.lua"]:341>
	[C]: in function 'newShader'
	render.lua:34: in function 'loadShaders'
	main.lua:13: in function 'load'
	[love "callbacks.lua"]:136: in function <[love "callbacks.lua"]:135>
	[C]: in function 'xpcall'
	[love "boot.lua"]:361: in function <[love "boot.lua"]:348>
	[C]: in function 'xpcall'
Here's the file, shader.glsl

For the sake of testing I wrote a love file that also uses love_Canvases and it compiles just fine main.lua; I cannot figure out what I'm doing different in my shader code that's making it fail.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: love_Canvases undeclared identifier, cannot get shader to compile

Post by slime »

love 11's shader entry point parsing is pretty basic and doesn't know that your "vec4 effect" declaration won't be compiled, so it uses that. love 12 parses comments so it won't have that problem with your code.
User avatar
bombquake
Prole
Posts: 5
Joined: Sat Sep 02, 2023 2:00 am
Contact:

Re: love_Canvases undeclared identifier, cannot get shader to compile

Post by bombquake »

Removing the comment fixed it tysm!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 13 guests