I noticed my Grade glsl shader would fail to load on RetroArch in GoogleTV, and as I found out many other shaders fail as well.
After some hours of painstakingly debugging these are some finds:
-
Non–square matrices not supported
-
mat3 YIQtoRGB = mat3(
Themat3(
portion must be just right to the=
-
Types should be respected for
pow()
, so for vec3,pow(RGB, vec3(2.2))
. This is not the case for other operations where you can + - * / a scalar and a vector -
So you can mix scalar and vectors, but not floats with ints. So do
1.0 + 0.5
and not1 + 0.5
-
It doesn’t like
mat3
type functions normat3
arguments in functions
So far these are what I found, currently having an issue with a block statement. Tried several alternatives all without success.
mat3 LimThres;
if (g_space_out < 1.0) {
LimThres = g_crtgamut == 3.0 ? mat3( 0.000000,0.044065,0.000000,
0.000000,0.095638,0.000000,
0.000000,0.000000,0.000000) : \
g_crtgamut == 2.0 ? mat3( 0.006910,0.092133,0.000000,
0.039836,0.121390,0.000000,
0.000000,0.000000,0.000000) : \
g_crtgamut == 1.0 ? mat3( 0.018083,0.059489,0.017911,
0.066570,0.105996,0.066276,
0.000000,0.000000,0.000000) : \
mat3( 0.100000,0.100000,0.100000,
0.125000,0.125000,0.125000,
0.000000,0.000000,0.000000);
} else if (g_space_out > 0.0) {
LimThres = g_crtgamut == 3.0 ? mat3( 0.000000,0.234229,0.007680,
0.000000,0.154983,0.042446,
0.000000,0.000000,0.000000) : \
g_crtgamut == 2.0 ? mat3( 0.078526,0.108432,0.006143,
0.115731,0.127194,0.037039,
0.000000,0.000000,0.000000) : \
g_crtgamut == 1.0 ? mat3( 0.021531,0.237184,0.013466,
0.072018,0.155438,0.057731,
0.000000,0.000000,0.000000) : \
mat3( 0.100000,0.100000,0.100000,
0.125000,0.125000,0.125000,
0.000000,0.000000,0.000000);
} else {
LimThres = mat3( 0.100000,0.100000,0.100000,
0.125000,0.125000,0.125000,
0.000000,0.000000,0.000000);
}
The Chromecast HD has a Mali-G31 GPU with support for:
OpenGL®ES 1.1, 2.0, 3.2
Vulkan 1.2