1
Fork 0

fix sqrt math

This commit is contained in:
Christofer Nolander 2023-09-10 21:59:38 +02:00
commit 4bd6c60b99
4 changed files with 7 additions and 3 deletions

1
spec/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
GLSLangSpec.4.60.html

View file

@ -116,7 +116,8 @@ def expand_math(node):
return res
if node.name == 'msqrt':
return f'sqrt({expand_math(node.contents[0])})'
inner = ' '.join([expand_math(c) for c in math_children(node)])
return f'sqrt({inner})'
raise Exception(f'unknown math node {node.name}: {node}')

View file

@ -5,3 +5,5 @@ generate-spec:
watch:
watchexec -e py -c -- just generate-spec
download-html-spec:
wget https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.html

View file

@ -13426,7 +13426,7 @@
}
],
"description": [
"`length` returns the length of the vector. i.e., ` sqrt() `"
"`length` returns the length of the vector. i.e., ` sqrt( x [ 0 ] **2 + x [ 1 ] **2 + …) `"
],
"versions": [
110,
@ -13453,7 +13453,7 @@
}
],
"description": [
"`length` returns the length of the vector. i.e., ` sqrt() `"
"`length` returns the length of the vector. i.e., ` sqrt( x [ 0 ] **2 + x [ 1 ] **2 + …) `"
],
"versions": [
400,