INNER CODE UNIT · Python

validate_shader

Hongtae/SwiftVVD · SupportPackages/SPIRV-Cross/Sources/test_shaders.py:588

def validate_shader(shader, vulkan, paths):
    if vulkan:
        spirv_14 = '.spv14.' in shader
        glslang_env = 'spirv1.4' if spirv_14 else 'vulkan1.1'
        subprocess.check_call([paths.glslang, '--amb', '--target-env', glslang_env, '-V', shader])
    else:
        subprocess.check_call([paths.glslang, shader])

def cross_compile(shader, vulkan, spirv, invalid_spirv, eliminate, is_legacy, force_es, flatten_ubo, sso, flatten_dim, opt, push_ubo, iterations, paths):
    spirv_path = create_temporary()
    glsl_path = create_temporary(os.path.basename(shader))

    spirv_16 = '.spv16.' in shader
    spirv_14 = '.spv14.' in shader
    if spirv_16:
        spirv_env = 'spv1.6'
        glslang_env = 'spirv1.6'
    elif spirv_14:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…