gl_graphics_pipeline: Add downscale factor to shader uniforms

This commit is contained in:
ameerj 2021-07-29 13:27:01 -04:00 committed by Fernando Sahmkow
parent b1504f3118
commit b83c3e7182
4 changed files with 19 additions and 5 deletions

View file

@ -211,8 +211,7 @@ void EmitYDirection(EmitContext& ctx, IR::Inst& inst) {
}
void EmitResolutionDownFactor(EmitContext& ctx, IR::Inst& inst) {
UNIMPLEMENTED();
ctx.Add("MOV.F {}.x,1;", inst);
ctx.Add("MOV.F {}.x,program.env[0].x;", inst);
}
void EmitUndefU1(EmitContext& ctx, IR::Inst& inst) {

View file

@ -393,6 +393,9 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
DefineGenericOutput(index, program.invocations);
}
}
if (info.uses_rescaling_uniform) {
header += "layout(location=0) uniform float down_factor;";
}
DefineConstantBuffers(bindings);
DefineStorageBuffers(bindings);
SetupImages(bindings);

View file

@ -446,8 +446,7 @@ void EmitYDirection(EmitContext& ctx, IR::Inst& inst) {
}
void EmitResolutionDownFactor(EmitContext& ctx, IR::Inst& inst) {
UNIMPLEMENTED();
ctx.AddF32("{}=1.0f;", inst);
ctx.AddF32("{}=down_factor;", inst);
}
void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, std::string_view word_offset) {