Skip to content

Commit

Permalink
Fix the generator test (#14)
Browse files Browse the repository at this point in the history
* Try to recurse submodules

* Fix recurse submodules

* Identify `glslc`

* Test serially for better diagnostics

* Compile with `glslang` instead of `glslc`

* Parallelize the compilation back again
  • Loading branch information
ppenenko authored Dec 11, 2024
1 parent adacc9a commit 58d560b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'true'
submodules: 'recursive'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
Expand Down
13 changes: 7 additions & 6 deletions src/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
from typing import List, NamedTuple
from pygltflib import GLTF2

from metashade.hlsl.util import dxc
from metashade.util import perf, spirv_cross
from metashade.glsl.util import glslc
from metashade.hlsl.util import dxc
from metashade.glsl.util import glslang, glslc

import _impl

Expand Down Expand Up @@ -155,11 +155,10 @@ def compile(self, to_glsl : bool) -> str:

try:
glsl_output_path = Path(self._file_path).with_suffix('.spv')
glslc.compile(
glslang.compile(
src_path = self._file_path,
target_env = 'vulkan1.1',
shader_stage = self._get_glslc_stage(),
entry_point_name = _impl.entry_point_name,
shader_stage = 'frag',
output_path = glsl_output_path
)
except subprocess.CalledProcessError as err:
Expand Down Expand Up @@ -265,9 +264,11 @@ def generate(
if compile:
print()
dxc.identify()
glslang.identify()

if to_glsl:
spirv_cross.identify()
glslc.identify()
spirv_cross.identify()

if serial:
for shader in shaders:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ def test_generate(self):
compile = True,
to_glsl = False,
skip_codegen = False,
serial = False
serial = False
)

0 comments on commit 58d560b

Please sign in to comment.