Run format_all.sh.
This commit is contained in:
parent
d4ad1e266a
commit
6e99fcf695
@ -459,10 +459,8 @@ std::string CompilerGLSL::get_partial_source()
|
||||
return buffer ? buffer->str() : "No compiled source available yet.";
|
||||
}
|
||||
|
||||
void CompilerGLSL::build_workgroup_size(vector<string> &arguments,
|
||||
const SpecializationConstant &wg_x,
|
||||
const SpecializationConstant &wg_y,
|
||||
const SpecializationConstant &wg_z)
|
||||
void CompilerGLSL::build_workgroup_size(vector<string> &arguments, const SpecializationConstant &wg_x,
|
||||
const SpecializationConstant &wg_y, const SpecializationConstant &wg_z)
|
||||
{
|
||||
auto &execution = get_entry_point();
|
||||
|
||||
@ -1750,16 +1748,15 @@ void CompilerGLSL::emit_constant(const SPIRConstant &constant)
|
||||
// These specialization constants are implicitly declared by emitting layout() in;
|
||||
// In legacy GLSL, we will still need to emit macros for these, so a layout() in; declaration
|
||||
// later can use macro overrides for work group size.
|
||||
bool is_workgroup_size_constant = constant.self == wg_x.id ||
|
||||
constant.self == wg_y.id ||
|
||||
constant.self == wg_z.id;
|
||||
bool is_workgroup_size_constant = constant.self == wg_x.id || constant.self == wg_y.id || constant.self == wg_z.id;
|
||||
|
||||
if (options.vulkan_semantics && is_workgroup_size_constant)
|
||||
{
|
||||
// Vulkan GLSL does not need to declare workgroup spec constants explicitly, it is handled in layout().
|
||||
return;
|
||||
}
|
||||
else if (!options.vulkan_semantics && is_workgroup_size_constant && !has_decoration(constant.self, DecorationSpecId))
|
||||
else if (!options.vulkan_semantics && is_workgroup_size_constant &&
|
||||
!has_decoration(constant.self, DecorationSpecId))
|
||||
{
|
||||
// Only bother declaring a workgroup size if it is actually a specialization constant, because we need macros.
|
||||
return;
|
||||
@ -2217,7 +2214,8 @@ void CompilerGLSL::emit_resources()
|
||||
// If we needed to declare work group size late, check here.
|
||||
// If the work group size depends on a specialization constant, we need to declare the layout() block
|
||||
// after constants (and their macros) have been declared.
|
||||
if (execution.model == ExecutionModelGLCompute && !options.vulkan_semantics && execution.workgroup_size.constant != 0)
|
||||
if (execution.model == ExecutionModelGLCompute && !options.vulkan_semantics &&
|
||||
execution.workgroup_size.constant != 0)
|
||||
{
|
||||
SpecializationConstant wg_x, wg_y, wg_z;
|
||||
get_work_group_size_specialization_constants(wg_x, wg_y, wg_z);
|
||||
|
@ -232,10 +232,8 @@ protected:
|
||||
virtual void emit_spv_amd_gcn_shader_op(uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args,
|
||||
uint32_t count);
|
||||
virtual void emit_header();
|
||||
void build_workgroup_size(std::vector<std::string> &arguments,
|
||||
const SpecializationConstant &x,
|
||||
const SpecializationConstant &y,
|
||||
const SpecializationConstant &z);
|
||||
void build_workgroup_size(std::vector<std::string> &arguments, const SpecializationConstant &x,
|
||||
const SpecializationConstant &y, const SpecializationConstant &z);
|
||||
|
||||
virtual void emit_sampled_image_op(uint32_t result_type, uint32_t result_id, uint32_t image_id, uint32_t samp_id);
|
||||
virtual void emit_texture_op(const Instruction &i);
|
||||
|
@ -1029,8 +1029,7 @@ void CompilerHLSL::emit_specialization_constants()
|
||||
if (c.self == workgroup_size_id)
|
||||
{
|
||||
statement("static const uint3 gl_WorkGroupSize = ",
|
||||
constant_expression(get<SPIRConstant>(workgroup_size_id)),
|
||||
";");
|
||||
constant_expression(get<SPIRConstant>(workgroup_size_id)), ";");
|
||||
emitted = true;
|
||||
}
|
||||
else if (c.specialization)
|
||||
|
@ -1944,7 +1944,8 @@ void CompilerMSL::emit_specialization_constants()
|
||||
// This "default" value can be overridden to the true specialization constant by the API user.
|
||||
// Specialization constants which are used as array length expressions cannot be function constants in MSL,
|
||||
// so just fall back to macros.
|
||||
if (msl_options.supports_msl_version(1, 2) && has_decoration(c.self, DecorationSpecId) && !c.is_used_as_array_length)
|
||||
if (msl_options.supports_msl_version(1, 2) && has_decoration(c.self, DecorationSpecId) &&
|
||||
!c.is_used_as_array_length)
|
||||
{
|
||||
uint32_t constant_id = get_decoration(c.self, DecorationSpecId);
|
||||
// Only scalar, non-composite values can be function constants.
|
||||
@ -1962,7 +1963,8 @@ void CompilerMSL::emit_specialization_constants()
|
||||
statement("#ifndef ", c.specialization_constant_macro_name);
|
||||
statement("#define ", c.specialization_constant_macro_name, " ", constant_expression(c));
|
||||
statement("#endif");
|
||||
statement("constant ", sc_type_name, " ", sc_name, " = ", c.specialization_constant_macro_name, ";");
|
||||
statement("constant ", sc_type_name, " ", sc_name, " = ", c.specialization_constant_macro_name,
|
||||
";");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user