summaryrefslogtreecommitdiff
path: root/gles3_builders.py
diff options
context:
space:
mode:
Diffstat (limited to 'gles3_builders.py')
-rw-r--r--gles3_builders.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/gles3_builders.py b/gles3_builders.py
index eafe503dd5..46ab1bbc03 100644
--- a/gles3_builders.py
+++ b/gles3_builders.py
@@ -3,6 +3,10 @@
All such functions are invoked in a subprocess on Windows to prevent build flakiness.
"""
+import os.path
+
+from typing import Optional
+
from platform_methods import subprocess_main
@@ -30,7 +34,7 @@ class GLES3HeaderStruct:
self.specialization_values = []
-def include_file_in_gles3_header(filename, header_data, depth):
+def include_file_in_gles3_header(filename: str, header_data: GLES3HeaderStruct, depth: int):
fs = open(filename, "r")
line = fs.readline()
@@ -91,8 +95,6 @@ def include_file_in_gles3_header(filename, header_data, depth):
while line.find("#include ") != -1:
includeline = line.replace("#include ", "").strip()[1:-1]
- import os.path
-
included_file = os.path.relpath(os.path.dirname(filename) + "/" + includeline)
if not included_file in header_data.vertex_included_files and header_data.reading == "vertex":
header_data.vertex_included_files += [included_file]
@@ -182,7 +184,7 @@ def include_file_in_gles3_header(filename, header_data, depth):
return header_data
-def build_gles3_header(filename, include, class_suffix, header_data=None):
+def build_gles3_header(filename: str, include: str, class_suffix: str, header_data: Optional[GLES3HeaderStruct] = None):
header_data = header_data or GLES3HeaderStruct()
include_file_in_gles3_header(filename, header_data, 0)
@@ -434,7 +436,7 @@ def build_gles3_header(filename, include, class_suffix, header_data=None):
)
fd.write(
- """_FORCE_INLINE_ void version_set_uniform(Uniforms p_uniform, const Projection& p_matrix,RID p_version,ShaderVariant p_variant"""
+ """_FORCE_INLINE_ void version_set_uniform(Uniforms p_uniform, const Projection& p_matrix, RID p_version, ShaderVariant p_variant"""
+ defvariant
+ """,uint64_t p_specialization="""
+ str(defspec)
@@ -442,13 +444,13 @@ def build_gles3_header(filename, include, class_suffix, header_data=None):
GLfloat matrix[16];
- for (int i=0;i<4;i++) {
- for (int j=0;j<4;j++) {
- matrix[i*4+j]=p_matrix.matrix[i][j];
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
+ matrix[i * 4 + j] = p_matrix.columns[i][j];
}
}
- glUniformMatrix4fv(version_get_uniform(p_uniform,p_version,p_variant,p_specialization),1,false,matrix);
+ glUniformMatrix4fv(version_get_uniform(p_uniform, p_version, p_variant, p_specialization), 1, false, matrix);
}"""
)