<commit_before>#line 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

void main(void) {
    Primitive prim = load_primitive();
#ifdef WR_FEATURE_TRANSFORM
    TransformVertexInfo vi = write_transform_vertex(prim.local_rect,
                                                    prim.local_clip_rect,
                                                    prim.z,
                                                    prim.layer,
                                                    prim.task,
                                                    prim.local_rect.p0);
    vLocalRect = prim.local_rect;
    vLocalPos = vi.local_pos;
#else
    VertexInfo vi = write_vertex(prim.local_rect,
                                 prim.local_clip_rect,
                                 prim.z,
                                 prim.layer,
                                 prim.task,
                                 prim.local_rect.p0);
    vLocalPos = vi.local_pos - prim.local_rect.p0;
#endif

    YuvImage image = fetch_yuv_image(prim.prim_index);
    ResourceRect y_rect = fetch_resource_rect(prim.user_data.x);
    ResourceRect u_rect = fetch_resource_rect(prim.user_data.x + 1);
    ResourceRect v_rect = fetch_resource_rect(prim.user_data.x + 2);

    vec2 y_texture_size = vec2(textureSize(sColor0, 0));
    vec2 y_st0 = y_rect.uv_rect.xy / y_texture_size;
    vec2 y_st1 = y_rect.uv_rect.zw / y_texture_size;

    vTextureSizeY = y_st1 - y_st0;
    vTextureOffsetY = y_st0;

    vec2 uv_texture_size = vec2(textureSize(sColor1, 0));
    vec2 u_st0 = u_rect.uv_rect.xy / uv_texture_size;
    vec2 u_st1 = u_rect.uv_rect.zw / uv_texture_size;

    vec2 v_st0 = v_rect.uv_rect.xy / uv_texture_size;
    vec2 v_st1 = v_rect.uv_rect.zw / uv_texture_size;

    // This assumes the U and V surfaces have the same size.
    vTextureSizeUv = u_st1 - u_st0;
    vTextureOffsetU = u_st0;
    vTextureOffsetV = v_st0;

    vStretchSize = image.size;

    vHalfTexelY = vec2(0.5) / y_texture_size;
    vHalfTexelUv = vec2(0.5) / uv_texture_size;


    write_clip(vi.screen_pos, prim.clip_area);

}<commit_msg>Reorder some function calls in ps_yuv_image shader.<commit_after>#line 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

void main(void) {
    Primitive prim = load_primitive();
#ifdef WR_FEATURE_TRANSFORM
    TransformVertexInfo vi = write_transform_vertex(prim.local_rect,
                                                    prim.local_clip_rect,
                                                    prim.z,
                                                    prim.layer,
                                                    prim.task,
                                                    prim.local_rect.p0);
    vLocalRect = prim.local_rect;
    vLocalPos = vi.local_pos;
#else
    VertexInfo vi = write_vertex(prim.local_rect,
                                 prim.local_clip_rect,
                                 prim.z,
                                 prim.layer,
                                 prim.task,
                                 prim.local_rect.p0);
    vLocalPos = vi.local_pos - prim.local_rect.p0;
#endif

    write_clip(vi.screen_pos, prim.clip_area);

    ResourceRect y_rect = fetch_resource_rect(prim.user_data.x);
    ResourceRect u_rect = fetch_resource_rect(prim.user_data.x + 1);
    ResourceRect v_rect = fetch_resource_rect(prim.user_data.x + 2);

    vec2 y_texture_size = vec2(textureSize(sColor0, 0));
    vec2 y_st0 = y_rect.uv_rect.xy / y_texture_size;
    vec2 y_st1 = y_rect.uv_rect.zw / y_texture_size;

    vTextureSizeY = y_st1 - y_st0;
    vTextureOffsetY = y_st0;

    vec2 uv_texture_size = vec2(textureSize(sColor1, 0));
    vec2 u_st0 = u_rect.uv_rect.xy / uv_texture_size;
    vec2 u_st1 = u_rect.uv_rect.zw / uv_texture_size;

    vec2 v_st0 = v_rect.uv_rect.xy / uv_texture_size;
    vec2 v_st1 = v_rect.uv_rect.zw / uv_texture_size;

    // This assumes the U and V surfaces have the same size.
    vTextureSizeUv = u_st1 - u_st0;
    vTextureOffsetU = u_st0;
    vTextureOffsetV = v_st0;

    YuvImage image = fetch_yuv_image(prim.prim_index);
    vStretchSize = image.size;

    vHalfTexelY = vec2(0.5) / y_texture_size;
    vHalfTexelUv = vec2(0.5) / uv_texture_size;



}
{'fraction_non_alphanumeric': 0.08151093439363817, 'fraction_numerical': 0.018997128341064724, 'mean_word_length': 1.7694189602446484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6065864', 'n_tokens_mistral': 1493, 'n_tokens_neox': 1433, 'n_words': 300}