mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-26 05:16:24 -05:00
rescaling_pass: Enable PatchImageQueryDimensions on fragment stages
This commit is contained in:
parent
36f261edef
commit
dd66384451
1 changed files with 4 additions and 5 deletions
|
@ -249,6 +249,7 @@ void PatchImageRead(IR::Block& block, IR::Inst& inst) {
|
||||||
|
|
||||||
void Visit(const IR::Program& program, IR::Block& block, IR::Inst& inst) {
|
void Visit(const IR::Program& program, IR::Block& block, IR::Inst& inst) {
|
||||||
const bool is_fragment_shader{program.stage == Stage::Fragment};
|
const bool is_fragment_shader{program.stage == Stage::Fragment};
|
||||||
|
const bool is_compute_shader{program.stage == Stage::Compute};
|
||||||
switch (inst.GetOpcode()) {
|
switch (inst.GetOpcode()) {
|
||||||
case IR::Opcode::GetAttribute: {
|
case IR::Opcode::GetAttribute: {
|
||||||
const IR::Attribute attr{inst.Arg(0).Attribute()};
|
const IR::Attribute attr{inst.Arg(0).Attribute()};
|
||||||
|
@ -265,21 +266,19 @@ void Visit(const IR::Program& program, IR::Block& block, IR::Inst& inst) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IR::Opcode::ImageQueryDimensions:
|
case IR::Opcode::ImageQueryDimensions:
|
||||||
if (program.stage == Stage::Compute) {
|
|
||||||
PatchImageQueryDimensions(block, inst);
|
PatchImageQueryDimensions(block, inst);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case IR::Opcode::ImageFetch:
|
case IR::Opcode::ImageFetch:
|
||||||
if (is_fragment_shader) {
|
if (is_fragment_shader) {
|
||||||
SubScaleImageFetch(block, inst);
|
SubScaleImageFetch(block, inst);
|
||||||
} else if (program.stage == Stage::Compute) {
|
} else if (is_compute_shader) {
|
||||||
PatchImageFetch(block, inst);
|
PatchImageFetch(block, inst);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IR::Opcode::ImageRead:
|
case IR::Opcode::ImageRead:
|
||||||
if (is_fragment_shader) {
|
if (is_fragment_shader) {
|
||||||
SubScaleImageRead(block, inst);
|
SubScaleImageRead(block, inst);
|
||||||
} else if (program.stage == Stage::Compute) {
|
} else if (is_compute_shader) {
|
||||||
PatchImageRead(block, inst);
|
PatchImageRead(block, inst);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue