floooh / sokol-tools

Command line tools for use with sokol headers
MIT License
219 stars 54 forks source link

Incorrect line number #126

Closed danielchasehooper closed 4 months ago

danielchasehooper commented 4 months ago

run sokol-shdc --ifdef -l glsl330:metal_macos:metal_sim:metal_ios:glsl300es -i bug.glsl -o shaders_sokol.h

@vs COMMON_VS

void main()
{
    gl_Position = vec4(1.0);
}

@end

@fs MAIN_SHADER_FS

uniform fs_uniforms {
    vec2 iResolution;
};
uniform sampler2D my_texture;

out vec4 finalColor;

void main()
{
    vec2 size = textureSize(my_texture, 0);
    vec2 sample_loc = (gl_FragCoord.xy + .5) * size/iResolution.xy;
    vec3 color = texture(my_texture, sample_loc).rgb;

    finalColor = vec4(color, 1);
}

@end

@program MAIN_SHADER COMMON_VS MAIN_SHADER_FS

produces error with wrong line number: src/bug.glsl:0:0: error: combined image sampler 'my_texture' detected, please use separate textures and samplers

sokol-shdc hash (note that this is different from the other issue I just created):

shasum -a 256 scripts/sokol-shdc                                                                                                                                                                                                                                               
4a27c0d7da05a162a0ff4abcb2e55b0d1a56a231452c2ef185555d789f1502cb  scripts/sokol-shdc

may be related to #125

floooh commented 4 months ago

Yeah the line number offset is already fixed in the storage-buffer branch, will be merged sometime this week.