File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1097,7 +1097,7 @@ def inherit_technique(technique, pmfx_json):
1097
1097
1098
1098
1099
1099
# parse pmfx file to find the json block pmfx: { }
1100
- def find_pmfx_json (shader_file_text ):
1100
+ def find_pmfx_json (shader_file_text , create_default = True ):
1101
1101
pmfx_loc = shader_file_text .find ("pmfx:" )
1102
1102
if pmfx_loc != - 1 :
1103
1103
# pmfx json exists, return the block
@@ -1106,7 +1106,7 @@ def find_pmfx_json(shader_file_text):
1106
1106
pmfx_json = jsn .loads (shader_file_text [json_loc :pmfx_end + json_loc ])
1107
1107
shader_text_removed = shader_file_text [:pmfx_loc ] + shader_file_text [pmfx_loc + pmfx_end :].strip ()
1108
1108
return pmfx_json , shader_text_removed
1109
- else :
1109
+ elif create_default :
1110
1110
# shader can have no pmfx, provided it supplies vs_main and ps_main
1111
1111
if find_function (shader_file_text , "vs_main" ) and find_function (shader_file_text , "ps_main" ):
1112
1112
pmfx_json = dict ()
Original file line number Diff line number Diff line change @@ -799,7 +799,7 @@ def generate_pmfx(file, root):
799
799
800
800
# semi similar to v1-path, allows pmfx: {} and hls source code to be mixed in the ame file
801
801
shader_file_text_full , included_files = build_pmfx .create_shader_set (input_pmfx_filepath , root )
802
- pmfx_json , shader_source = build_pmfx .find_pmfx_json (shader_file_text_full )
802
+ pmfx_json , shader_source = build_pmfx .find_pmfx_json (shader_file_text_full , False )
803
803
804
804
if not pmfx_json :
805
805
pmfx_json , shader_source , included_files = load_pmfx_jsn (file , root )
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ python3 pmfx.py -v1 -shader_platform metal -metal_sdk iphoneos -metal_min_os 0.9
107
107
python3 pmfx.py -v1 -shader_platform spirv -i examples/v1 -o output/bin -h output/structs -t output/temp
108
108
109
109
// hlsl d3d11
110
- python3 pmfx.py -v1 -shader_platform hlsl -shader_version 4_0 -i examples/v1 -o output/bin -h output/structs -t output/temp
110
+ py -3 pmfx.py -v1 -shader_platform hlsl -shader_version 5_0 -i examples/v1 -o output/bin -h output/structs -t output/temp
111
111
112
112
// glsl
113
113
python3 pmfx.py -v1 -shader_platform glsl -shader_version 330 -i examples/v1 -o output/bin -h output/structs -t output/temp
@@ -609,7 +609,7 @@ Full [documentation](https://github.com/polymonster/pmfx-shader/blob/master/docs
609
609
Compilation is simple with command line args as so:
610
610
611
611
``` text
612
- python3 pmfx.py -shader_platform hlsl -shader_version 6_0 -i examples/v2/ -o ${data_dir}/ shaders -t ${temp_dir} /shaders
612
+ py -3 pmfx.py -shader_platform hlsl -shader_version 6_0 -i examples/v2/ -o build/data/ shaders -t build/temp /shaders
613
613
```
614
614
615
615
### Examples
You can’t perform that action at this time.
0 commit comments