mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-15 14:17:57 -05:00
glsl/glasm: Pass and use scaling parameters in shaders
This commit is contained in:
committed by
Fernando Sahmkow
parent
4a512d6827
commit
cfeb161c7e
@ -394,7 +394,7 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
|
||||
}
|
||||
}
|
||||
if (info.uses_rescaling_uniform) {
|
||||
header += "layout(location=0) uniform float down_factor;";
|
||||
header += "layout(location=0) uniform vec4 scaling;";
|
||||
}
|
||||
DefineConstantBuffers(bindings);
|
||||
DefineStorageBuffers(bindings);
|
||||
|
@ -446,7 +446,7 @@ void EmitYDirection(EmitContext& ctx, IR::Inst& inst) {
|
||||
}
|
||||
|
||||
void EmitResolutionDownFactor(EmitContext& ctx, IR::Inst& inst) {
|
||||
ctx.AddF32("{}=down_factor;", inst);
|
||||
ctx.AddF32("{}=scaling.y;", inst);
|
||||
}
|
||||
|
||||
void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, std::string_view word_offset) {
|
||||
|
@ -616,8 +616,8 @@ void EmitIsTextureScaled(EmitContext& ctx, IR::Inst& inst, const IR::Value& inde
|
||||
if (!index.IsImmediate()) {
|
||||
throw NotImplementedException("Non-constant texture rescaling");
|
||||
}
|
||||
UNIMPLEMENTED();
|
||||
ctx.AddU1("{}=true;", inst);
|
||||
const u32 image_index{index.U32()};
|
||||
ctx.AddU1("{}=(ftou(scaling.x)&{})!=0;", inst, 1u << image_index);
|
||||
}
|
||||
|
||||
void EmitBindlessImageSampleImplicitLod(EmitContext&) {
|
||||
|
Reference in New Issue
Block a user