Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest phosphorus #241

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions generate-native.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
curl https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/main/xml/gl.xml > generated/gl.xml

# phosphorus expects one API, but we're trying to generate bindings for multiple at once.
# We'll work around it for now by renaming GL ES 3.2 to match GL 4.6.
replacements=''
replacements+='s/api="gles2"/api="gl"/g;'
replacements+='s/name="GL_ES_VERSION_3_2"/name="GL_VERSION_4_6"/g;'
replacements+='s/number="3.2"/number="4.6"/g;'
sed --in-place $replacements generated/gl.xml

phosphorus \
--xml ./generated/gl.xml \
--api gl \
--name GL_VERSION_4_6 \
--number 4.6 \
--ext GL_ARB_base_instance \
--ext GL_ARB_buffer_storage \
--ext GL_ARB_compute_shader \
--ext GL_ARB_copy_buffer \
--ext GL_ARB_debug_output \
--ext GL_ARB_draw_elements_base_vertex \
--ext GL_ARB_draw_instanced \
--ext GL_ARB_framebuffer_object \
--ext GL_ARB_framebuffer_sRGB \
--ext GL_ARB_instanced_arrays \
--ext GL_ARB_parallel_shader_compile \
--ext GL_ARB_program_interface_query \
--ext GL_ARB_sampler_objects \
--ext GL_ARB_sync \
--ext GL_ARB_tessellation_shader \
--ext GL_ARB_texture_filter_anisotropic \
--ext GL_ARB_texture_storage \
--ext GL_ARB_uniform_buffer_object \
--ext GL_ARB_vertex_array_object \
--ext GL_EXT_buffer_storage \
--ext GL_EXT_draw_buffers2 \
--ext GL_EXT_texture_filter_anisotropic \
--ext GL_KHR_debug \
--ext GL_KHR_parallel_shader_compile \
--ext GL_NV_copy_buffer \
> generated/gl46gles32.rs

cp generated/gl46gles32.rs src/gl46gles32.rs
Loading