In the GLSL shader, I want to create a function that looks something like this:
void MyFunction(out float results[9]) { float value0 = 3.1546; float value1 = 42; // whatever value /* ... long, complicated code ... */ results[0] = value0; results[1] = value1; results[2] = value2; ... }
Is it possible to use and compile such a function signature in GLSL?If not, are there any alternatives?
Yes, this is legal GLSL code.
This does not mean that it will compile, but it is a legal code. In this case, it is probably better to simply return the array (which you can also do), and not pass it as an output parameter.
Source: https://habr.com/ru/post/945556/More articles:Is this a httplib2 error - pythonHow to determine if there is a debugger attached in C ++? - c ++How to set button visibility in a custom ListView? - androidCursorAdapter allows you to auto-update images - androidcheckbox in list does not work properly - androidHow to limit queries launched by quartz scheduler - javaASP.NET MVC and HTML5 - html5Detecting model state changes in a controller using Entity Framework - asp.net-mvcAdd div over centered image? - javascriptIs there a Java annotation for errors? - javaAll Articles