Skip to content

shaders: Add missing extension requirements in Dolphin shaders

Discovered when an experiment resulted in a driver that only gave OpenGL 3.0 without GL_ARB_uniform_buffer_object.

All changes made with this script:

for ext in GL_ARB_shader_image_load_store \
           GL_ARB_shader_storage_buffer_object \
	   GL_ARB_shading_language_420pack \
	   GL_ARB_uniform_buffer_object \
	   GL_ARB_explicit_attrib_location
do
    egrep -lr "extension[[:space:]]+${ext}.*enable" . |\
        while read s; do
            # If the shader already has the requirement, skip
            if grep -A10 '[[]require]' $s | grep -q ^$ext ; then
                continue
            fi

            # If the shader has ifdefs for the extension, skip
            if egrep -q "#[[:space:]]*if.*${ext}" $s; then
                continue
            fi

            sed --in-place -e "s/\(^GLSL >.*$\)/\1\n${ext}/" $s
        done
done

Merge request reports