Closed zicklag closed 3 years ago
There, found a minimal example:
WGSL:
[[group(0), binding(4)]]
var point_shadow_textures: texture_depth_cube_array;
[[group(0), binding(5)]]
var point_shadow_textures_sampler: sampler_comparison;
[[stage(fragment)]]
fn fragment() -> [[location(0)]] vec4<f32> {
let frag_ls = vec4<f32>(1., 1., 2., 1.).xyz;
let a = textureSampleCompareLevel(point_shadow_textures, point_shadow_textures_sampler, frag_ls, i32(1), 1.);
return vec4<f32>(a, 1., 1., 1.);
}
GLSL:
#version 310 es
#extension GL_EXT_texture_cube_map_array : require
precision highp float;
precision highp int;
uniform highp samplerCubeArrayShadow _group_0_binding_4;
layout(location = 0) out vec4 _fs2p_location0;
void main() {
vec3 frag_ls = vec4(1.0, 1.0, 2.0, 1.0).xyz;
float a = textureGrad(_group_0_binding_4, vec5(frag_ls, int(1), 1.0), vec2(0,0), vec2(0,0));
_fs2p_location0 = vec4(a, 1.0, 1.0, 1.0);
return;
}
Uh oh, looking at the GLES 3.1 reference card it doesn't look like there's a textureGrad
function that works on cube array shadows. I have no idea what that means or how to work-around. :man_shrugging:
Edit: It looks like textureGrad
on CubeArrayShadows does work with the extension: EXT_texture_cube_map_array
.
I'm going to look into this, but in case anybody will know what is wrong right off, I'm getting an error translating Bevy's new PBR shader to GLSL from WGSL. Somehow the GLSL ends up with a call to a non-existant
vec5
function.PS: This shader is way too big and I should have gotten a smaller sample shader that exhibits the issue, I just haven't figured out how yet so feel free to wait for me to do that if you want. :grin:
WGSL:
GLSL: