Flip BGRA surface texture sampling
This commit is contained in:
+5
-1
@@ -890,7 +890,11 @@ fragment float4 surface_bgra_fragment(SurfaceFragmentInput input [[stage_in]],
|
||||
texture2d<float> bgra_texture
|
||||
[[texture(SurfaceInputIndex_YTexture)]]) {
|
||||
constexpr sampler texture_sampler(mag_filter::linear, min_filter::linear);
|
||||
return bgra_texture.sample(texture_sampler, input.texture_position);
|
||||
// Servo's CGL-backed IOSurfaces use the opposite framebuffer origin from
|
||||
// GPUI's surface quad, so flip both texture axes for browser frames.
|
||||
float2 texture_position =
|
||||
float2(1.0 - input.texture_position.x, 1.0 - input.texture_position.y);
|
||||
return bgra_texture.sample(texture_sampler, texture_position);
|
||||
}
|
||||
|
||||
float4 hsla_to_rgba(Hsla hsla) {
|
||||
|
||||
Reference in New Issue
Block a user