|
@@ -277,6 +277,8 @@ static void print_resources(const Compiler &compiler, const char *tag, const Sma
|
|
|
fprintf(stderr, " (Set : %u)", compiler.get_decoration(res.id, DecorationDescriptorSet));
|
|
fprintf(stderr, " (Set : %u)", compiler.get_decoration(res.id, DecorationDescriptorSet));
|
|
|
if (mask.get(DecorationBinding))
|
|
if (mask.get(DecorationBinding))
|
|
|
fprintf(stderr, " (Binding : %u)", compiler.get_decoration(res.id, DecorationBinding));
|
|
fprintf(stderr, " (Binding : %u)", compiler.get_decoration(res.id, DecorationBinding));
|
|
|
|
|
+ if (static_cast<const CompilerGLSL &>(compiler).variable_is_depth_or_compare(res.id))
|
|
|
|
|
+ fprintf(stderr, " (comparison)");
|
|
|
if (mask.get(DecorationInputAttachmentIndex))
|
|
if (mask.get(DecorationInputAttachmentIndex))
|
|
|
fprintf(stderr, " (Attachment : %u)", compiler.get_decoration(res.id, DecorationInputAttachmentIndex));
|
|
fprintf(stderr, " (Attachment : %u)", compiler.get_decoration(res.id, DecorationInputAttachmentIndex));
|
|
|
if (mask.get(DecorationNonReadable))
|
|
if (mask.get(DecorationNonReadable))
|
|
@@ -560,6 +562,7 @@ struct CLIArguments
|
|
|
bool hlsl_compat = false;
|
|
bool hlsl_compat = false;
|
|
|
bool hlsl_support_nonzero_base = false;
|
|
bool hlsl_support_nonzero_base = false;
|
|
|
bool hlsl_force_storage_buffer_as_uav = false;
|
|
bool hlsl_force_storage_buffer_as_uav = false;
|
|
|
|
|
+ bool hlsl_nonwritable_uav_texture_as_srv = false;
|
|
|
HLSLBindingFlags hlsl_binding_flags = 0;
|
|
HLSLBindingFlags hlsl_binding_flags = 0;
|
|
|
bool vulkan_semantics = false;
|
|
bool vulkan_semantics = false;
|
|
|
bool flatten_multidimensional_arrays = false;
|
|
bool flatten_multidimensional_arrays = false;
|
|
@@ -632,6 +635,7 @@ static void print_help()
|
|
|
"\t[--hlsl-support-nonzero-basevertex-baseinstance]\n"
|
|
"\t[--hlsl-support-nonzero-basevertex-baseinstance]\n"
|
|
|
"\t[--hlsl-auto-binding (push, cbv, srv, uav, sampler, all)]\n"
|
|
"\t[--hlsl-auto-binding (push, cbv, srv, uav, sampler, all)]\n"
|
|
|
"\t[--hlsl-force-storage-buffer-as-uav]\n"
|
|
"\t[--hlsl-force-storage-buffer-as-uav]\n"
|
|
|
|
|
+ "\t[--hlsl-nonwritable-uav-texture-as-srv]\n"
|
|
|
"\t[--separate-shader-objects]\n"
|
|
"\t[--separate-shader-objects]\n"
|
|
|
"\t[--pls-in format input-name]\n"
|
|
"\t[--pls-in format input-name]\n"
|
|
|
"\t[--pls-out format output-name]\n"
|
|
"\t[--pls-out format output-name]\n"
|
|
@@ -988,6 +992,7 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
|
|
|
|
|
|
|
|
hlsl_opts.support_nonzero_base_vertex_base_instance = args.hlsl_support_nonzero_base;
|
|
hlsl_opts.support_nonzero_base_vertex_base_instance = args.hlsl_support_nonzero_base;
|
|
|
hlsl_opts.force_storage_buffer_as_uav = args.hlsl_force_storage_buffer_as_uav;
|
|
hlsl_opts.force_storage_buffer_as_uav = args.hlsl_force_storage_buffer_as_uav;
|
|
|
|
|
+ hlsl_opts.nonwritable_uav_texture_as_srv = args.hlsl_nonwritable_uav_texture_as_srv;
|
|
|
hlsl->set_hlsl_options(hlsl_opts);
|
|
hlsl->set_hlsl_options(hlsl_opts);
|
|
|
hlsl->set_resource_binding_flags(args.hlsl_binding_flags);
|
|
hlsl->set_resource_binding_flags(args.hlsl_binding_flags);
|
|
|
}
|
|
}
|
|
@@ -1053,14 +1058,6 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (args.dump_resources)
|
|
|
|
|
- {
|
|
|
|
|
- print_resources(*compiler, res);
|
|
|
|
|
- print_push_constant_resources(*compiler, res.push_constant_buffers);
|
|
|
|
|
- print_spec_constants(*compiler);
|
|
|
|
|
- print_capabilities_and_extensions(*compiler);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
if (combined_image_samplers)
|
|
if (combined_image_samplers)
|
|
|
{
|
|
{
|
|
|
compiler->build_combined_image_samplers();
|
|
compiler->build_combined_image_samplers();
|
|
@@ -1092,7 +1089,17 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
|
|
|
static_cast<CompilerHLSL *>(compiler.get())->add_vertex_attribute_remap(remap);
|
|
static_cast<CompilerHLSL *>(compiler.get())->add_vertex_attribute_remap(remap);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return compiler->compile();
|
|
|
|
|
|
|
+ auto ret = compiler->compile();
|
|
|
|
|
+
|
|
|
|
|
+ if (args.dump_resources)
|
|
|
|
|
+ {
|
|
|
|
|
+ print_resources(*compiler, res);
|
|
|
|
|
+ print_push_constant_resources(*compiler, res.push_constant_buffers);
|
|
|
|
|
+ print_spec_constants(*compiler);
|
|
|
|
|
+ print_capabilities_and_extensions(*compiler);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return ret;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static int main_inner(int argc, char *argv[])
|
|
static int main_inner(int argc, char *argv[])
|
|
@@ -1154,6 +1161,8 @@ static int main_inner(int argc, char *argv[])
|
|
|
});
|
|
});
|
|
|
cbs.add("--hlsl-force-storage-buffer-as-uav",
|
|
cbs.add("--hlsl-force-storage-buffer-as-uav",
|
|
|
[&args](CLIParser &) { args.hlsl_force_storage_buffer_as_uav = true; });
|
|
[&args](CLIParser &) { args.hlsl_force_storage_buffer_as_uav = true; });
|
|
|
|
|
+ cbs.add("--hlsl-nonwritable-uav-texture-as-srv",
|
|
|
|
|
+ [&args](CLIParser &) { args.hlsl_nonwritable_uav_texture_as_srv = true; });
|
|
|
cbs.add("--vulkan-semantics", [&args](CLIParser &) { args.vulkan_semantics = true; });
|
|
cbs.add("--vulkan-semantics", [&args](CLIParser &) { args.vulkan_semantics = true; });
|
|
|
cbs.add("-V", [&args](CLIParser &) { args.vulkan_semantics = true; });
|
|
cbs.add("-V", [&args](CLIParser &) { args.vulkan_semantics = true; });
|
|
|
cbs.add("--flatten-multidimensional-arrays", [&args](CLIParser &) { args.flatten_multidimensional_arrays = true; });
|
|
cbs.add("--flatten-multidimensional-arrays", [&args](CLIParser &) { args.flatten_multidimensional_arrays = true; });
|