Skip to content

spirv: Change spirv_to_nir() to return a nir_shader

Caio Oliveira requested to merge cmarcelo/mesa:r/spirv-to-nir-shader into master

spirv_to_nir() returned the nir_function corresponding to the entrypoint, as a way to identify it. There's now a bool is_entrypoint in nir_function and also a helper function to get the entry_point from a nir_shader.

The return type reflects better what the function name suggests. It also helps drivers avoid the mistake of reusing internal shader references after running NIR_PASS on it. When using NIR_TEST_CLONE or NIR_TEST_SERIALIZE, those would be invalidated right in the first pass executed.

Merge request reports