mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 17:19:44 -06:00
TextureConverter: Use integer math for swizzling
also move int(efb_coord) -> float(ogl_fb_coord) into WriteSampleColor
This commit is contained in:
@ -584,6 +584,9 @@ void ProgramShaderCache::CreateHeader ( void )
|
||||
"#define float2 vec2\n"
|
||||
"#define float3 vec3\n"
|
||||
"#define float4 vec4\n"
|
||||
"#define int2 ivec2\n"
|
||||
"#define int3 ivec3\n"
|
||||
"#define int4 ivec4\n"
|
||||
|
||||
// hlsl to glsl function translation
|
||||
"#define frac fract\n"
|
||||
|
@ -291,17 +291,10 @@ int EncodeToRamFromTexture(u32 address,GLuint source_texture, bool bFromZBuffer,
|
||||
s32 expandedWidth = (width + blkW) & (~blkW);
|
||||
s32 expandedHeight = (height + blkH) & (~blkH);
|
||||
|
||||
float sampleStride = bScaleByHalf ? 2.f : 1.f;
|
||||
|
||||
float params[] = {
|
||||
Renderer::EFBToScaledXf(sampleStride), Renderer::EFBToScaledYf(sampleStride),
|
||||
0.0f, 0.0f,
|
||||
(float)expandedWidth, (float)Renderer::EFBToScaledY(expandedHeight)-1,
|
||||
(float)Renderer::EFBToScaledX(source.left), (float)Renderer::EFBToScaledY(EFB_HEIGHT - source.top - expandedHeight)
|
||||
};
|
||||
|
||||
texconv_shader.Bind();
|
||||
glUniform4fv(texconv_shader.UniformLocations[0], 2, params);
|
||||
glUniform4f(texconv_shader.UniformLocations[0],
|
||||
float(source.left), float(source.top),
|
||||
(float)expandedWidth, bScaleByHalf ? 2.f : 1.f);
|
||||
|
||||
TargetRectangle scaledSource;
|
||||
scaledSource.top = 0;
|
||||
|
Reference in New Issue
Block a user