mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 00:42:48 +00:00
dont define empty attr arrays
This commit is contained in:
parent
8ab3da6b68
commit
0c58c681c7
@ -409,11 +409,13 @@ void EmitContext::DefineInputs() {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
const u32 num_attrs = runtime_info.hs_info.ls_stride >> 4;
|
const u32 num_attrs = runtime_info.hs_info.ls_stride >> 4;
|
||||||
|
if (num_attrs > 0) {
|
||||||
const Id per_vertex_type{TypeArray(F32[4], ConstU32(num_attrs))};
|
const Id per_vertex_type{TypeArray(F32[4], ConstU32(num_attrs))};
|
||||||
// The input vertex count isn't statically known, so make length 32 (what glslang does)
|
// The input vertex count isn't statically known, so make length 32 (what glslang does)
|
||||||
const Id patch_array_type{TypeArray(per_vertex_type, ConstU32(32u))};
|
const Id patch_array_type{TypeArray(per_vertex_type, ConstU32(32u))};
|
||||||
input_attr_array = DefineInput(patch_array_type, 0);
|
input_attr_array = DefineInput(patch_array_type, 0);
|
||||||
Name(input_attr_array, "in_attrs");
|
Name(input_attr_array, "in_attrs");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -436,11 +438,13 @@ void EmitContext::DefineInputs() {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
const u32 num_attrs = runtime_info.vs_info.hs_output_cp_stride >> 4;
|
const u32 num_attrs = runtime_info.vs_info.hs_output_cp_stride >> 4;
|
||||||
|
if (num_attrs > 0) {
|
||||||
const Id per_vertex_type{TypeArray(F32[4], ConstU32(num_attrs))};
|
const Id per_vertex_type{TypeArray(F32[4], ConstU32(num_attrs))};
|
||||||
// The input vertex count isn't statically known, so make length 32 (what glslang does)
|
// The input vertex count isn't statically known, so make length 32 (what glslang does)
|
||||||
const Id patch_array_type{TypeArray(per_vertex_type, ConstU32(32u))};
|
const Id patch_array_type{TypeArray(per_vertex_type, ConstU32(32u))};
|
||||||
input_attr_array = DefineInput(patch_array_type, 0);
|
input_attr_array = DefineInput(patch_array_type, 0);
|
||||||
Name(input_attr_array, "in_attrs");
|
Name(input_attr_array, "in_attrs");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
u32 patch_base_location = runtime_info.vs_info.hs_output_cp_stride >> 4;
|
u32 patch_base_location = runtime_info.vs_info.hs_output_cp_stride >> 4;
|
||||||
@ -479,9 +483,11 @@ void EmitContext::DefineOutputs() {
|
|||||||
}
|
}
|
||||||
if (stage == Shader::Stage::Local && runtime_info.ls_info.links_with_tcs) {
|
if (stage == Shader::Stage::Local && runtime_info.ls_info.links_with_tcs) {
|
||||||
const u32 num_attrs = runtime_info.ls_info.ls_stride >> 4;
|
const u32 num_attrs = runtime_info.ls_info.ls_stride >> 4;
|
||||||
|
if (num_attrs > 0) {
|
||||||
const Id type{TypeArray(F32[4], ConstU32(num_attrs))};
|
const Id type{TypeArray(F32[4], ConstU32(num_attrs))};
|
||||||
output_attr_array = DefineOutput(type, 0);
|
output_attr_array = DefineOutput(type, 0);
|
||||||
Name(output_attr_array, "out_attrs");
|
Name(output_attr_array, "out_attrs");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
for (u32 i = 0; i < IR::NumParams; i++) {
|
for (u32 i = 0; i < IR::NumParams; i++) {
|
||||||
const IR::Attribute param{IR::Attribute::Param0 + i};
|
const IR::Attribute param{IR::Attribute::Param0 + i};
|
||||||
@ -525,13 +531,15 @@ void EmitContext::DefineOutputs() {
|
|||||||
output_params[i] = {id, output_f32, F32[1], 4};
|
output_params[i] = {id, output_f32, F32[1], 4};
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
const u32 num_attrs = runtime_info.hs_info.hs_cp_stride >> 4;
|
const u32 num_attrs = runtime_info.hs_info.hs_output_cp_stride >> 4;
|
||||||
|
if (num_attrs > 0) {
|
||||||
const Id per_vertex_type{TypeArray(F32[4], ConstU32(num_attrs))};
|
const Id per_vertex_type{TypeArray(F32[4], ConstU32(num_attrs))};
|
||||||
// The input vertex count isn't statically known, so make length 32 (what glslang does)
|
// The input vertex count isn't statically known, so make length 32 (what glslang does)
|
||||||
const Id patch_array_type{
|
const Id patch_array_type{
|
||||||
TypeArray(per_vertex_type, ConstU32(runtime_info.hs_info.output_control_points))};
|
TypeArray(per_vertex_type, ConstU32(runtime_info.hs_info.output_control_points))};
|
||||||
output_attr_array = DefineOutput(patch_array_type, 0);
|
output_attr_array = DefineOutput(patch_array_type, 0);
|
||||||
Name(output_attr_array, "out_attrs");
|
Name(output_attr_array, "out_attrs");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
u32 patch_base_location = runtime_info.hs_info.hs_output_cp_stride >> 4;
|
u32 patch_base_location = runtime_info.hs_info.hs_output_cp_stride >> 4;
|
||||||
|
Loading…
Reference in New Issue
Block a user