mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-24 20:35:01 +00:00
shader_recompiler: Exclude defaulted fragment inputs from quad/rect passthrough. (#2383)
This commit is contained in:
parent
b51c767296
commit
40eef6a066
3 changed files with 15 additions and 3 deletions
|
@ -254,10 +254,14 @@ private:
|
||||||
gl_per_vertex = AddOutput(gl_per_vertex_type);
|
gl_per_vertex = AddOutput(gl_per_vertex_type);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < fs_info.num_inputs; i++) {
|
for (int i = 0; i < fs_info.num_inputs; i++) {
|
||||||
|
const auto& input = fs_info.inputs[i];
|
||||||
|
if (input.IsDefault()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
outputs[i] = AddOutput(model == spv::ExecutionModel::TessellationControl
|
outputs[i] = AddOutput(model == spv::ExecutionModel::TessellationControl
|
||||||
? TypeArray(vec4_id, Int(4))
|
? TypeArray(vec4_id, Int(4))
|
||||||
: vec4_id);
|
: vec4_id);
|
||||||
Decorate(outputs[i], spv::Decoration::Location, fs_info.inputs[i].param_index);
|
Decorate(outputs[i], spv::Decoration::Location, input.param_index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,8 +277,12 @@ private:
|
||||||
gl_in = AddInput(gl_per_vertex_array);
|
gl_in = AddInput(gl_per_vertex_array);
|
||||||
const Id float_arr{TypeArray(vec4_id, Int(32))};
|
const Id float_arr{TypeArray(vec4_id, Int(32))};
|
||||||
for (int i = 0; i < fs_info.num_inputs; i++) {
|
for (int i = 0; i < fs_info.num_inputs; i++) {
|
||||||
|
const auto& input = fs_info.inputs[i];
|
||||||
|
if (input.IsDefault()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
inputs[i] = AddInput(float_arr);
|
inputs[i] = AddInput(float_arr);
|
||||||
Decorate(inputs[i], spv::Decoration::Location, fs_info.inputs[i].param_index);
|
Decorate(inputs[i], spv::Decoration::Location, input.param_index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -316,7 +316,7 @@ void EmitContext::DefineInputs() {
|
||||||
const auto& input = runtime_info.fs_info.inputs[i];
|
const auto& input = runtime_info.fs_info.inputs[i];
|
||||||
const u32 semantic = input.param_index;
|
const u32 semantic = input.param_index;
|
||||||
ASSERT(semantic < IR::NumParams);
|
ASSERT(semantic < IR::NumParams);
|
||||||
if (input.is_default && !input.is_flat) {
|
if (input.IsDefault()) {
|
||||||
input_params[semantic] = {
|
input_params[semantic] = {
|
||||||
MakeDefaultValue(*this, input.default_value), input_f32, F32[1], 4, false, true,
|
MakeDefaultValue(*this, input.default_value), input_f32, F32[1], 4, false, true,
|
||||||
};
|
};
|
||||||
|
|
|
@ -174,6 +174,10 @@ struct FragmentRuntimeInfo {
|
||||||
bool is_flat;
|
bool is_flat;
|
||||||
u8 default_value;
|
u8 default_value;
|
||||||
|
|
||||||
|
[[nodiscard]] bool IsDefault() const {
|
||||||
|
return is_default && !is_flat;
|
||||||
|
}
|
||||||
|
|
||||||
auto operator<=>(const PsInput&) const noexcept = default;
|
auto operator<=>(const PsInput&) const noexcept = default;
|
||||||
};
|
};
|
||||||
AmdGpu::Liverpool::PsInput en_flags;
|
AmdGpu::Liverpool::PsInput en_flags;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue