mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 11:26:56 +02:00
shader: drop the unread F32Class bits and the per-pass HS reflection counter reset
This commit is contained in:
@@ -98,11 +98,10 @@ void ReflectTessellationLayout(const Decoder::Program& program, bool local,
|
|||||||
return changed;
|
return changed;
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32_t stride = 0, patch_begin = 0, patch_end = 0;
|
uint32_t stride = 0, patch_begin = UINT32_MAX, patch_end = 0;
|
||||||
for (bool repeat = true; repeat;) {
|
for (bool repeat = true; repeat;) {
|
||||||
repeat = false;
|
repeat = false;
|
||||||
registers = entry;
|
registers = entry;
|
||||||
stride = 0, patch_begin = UINT32_MAX, patch_end = 0;
|
|
||||||
for (const auto& inst: program.instructions) {
|
for (const auto& inst: program.instructions) {
|
||||||
if (const auto join = joins.find(inst.pc); join != joins.end()) {
|
if (const auto join = joins.find(inst.pc); join != joins.end()) {
|
||||||
merge(registers, join->second);
|
merge(registers, join->second);
|
||||||
@@ -112,7 +111,7 @@ void ReflectTessellationLayout(const Decoder::Program& program, bool local,
|
|||||||
merge(registers, loop->second);
|
merge(registers, loop->second);
|
||||||
if (IsDirectBranch(inst.opcode)) {
|
if (IsDirectBranch(inst.opcode)) {
|
||||||
const bool back = inst.branch_target <= inst.pc;
|
const bool back = inst.branch_target <= inst.pc;
|
||||||
auto [join, inserted] =
|
const auto [join, inserted] =
|
||||||
(back ? loops : joins).try_emplace(inst.branch_target, registers);
|
(back ? loops : joins).try_emplace(inst.branch_target, registers);
|
||||||
const bool changed = !inserted && merge(join->second, registers);
|
const bool changed = !inserted && merge(join->second, registers);
|
||||||
repeat |= back && (inserted || changed);
|
repeat |= back && (inserted || changed);
|
||||||
|
|||||||
@@ -17,12 +17,9 @@ uint32_t EmitCompareU32Constant(EmitterState& state, spv::Op opcode, uint32_t va
|
|||||||
}
|
}
|
||||||
|
|
||||||
F32Class EmitClassifyF32Bits(EmitterState& state, uint32_t bits) {
|
F32Class EmitClassifyF32Bits(EmitterState& state, uint32_t bits) {
|
||||||
F32Class cls;
|
const auto abs_bits = EmitAndConstant(state, bits, 0x7fffffffu);
|
||||||
cls.bits = bits;
|
return {EmitCompareU32Constant(state, spv::OpUGreaterThan, abs_bits, 0x7f800000u),
|
||||||
const auto abs_bits = EmitAndConstant(state, cls.bits, 0x7fffffffu);
|
EmitCompareU32Constant(state, spv::OpIEqual, abs_bits, 0)};
|
||||||
cls.nan = EmitCompareU32Constant(state, spv::OpUGreaterThan, abs_bits, 0x7f800000u);
|
|
||||||
cls.zero = EmitCompareU32Constant(state, spv::OpIEqual, abs_bits, 0);
|
|
||||||
return cls;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t EmitClassMaskBitMatch(EmitterState& state, uint32_t mask, uint32_t bit,
|
uint32_t EmitClassMaskBitMatch(EmitterState& state, uint32_t mask, uint32_t bit,
|
||||||
|
|||||||
@@ -285,7 +285,6 @@ struct ImageSampleLayout {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct F32Class {
|
struct F32Class {
|
||||||
uint32_t bits = 0;
|
|
||||||
uint32_t nan = 0;
|
uint32_t nan = 0;
|
||||||
uint32_t zero = 0;
|
uint32_t zero = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user