Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
A
angle
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • angle
  • Repository

Switch branch/tag
  • angle
  • src
  • compiler
  • translator
  • SeparateArrayInitialization.h
Find file
BlameHistoryPermalink
  • Olli Etuaho's avatar
    Support writing initializers using HLSL literal syntax · 18b9deb4
    Olli Etuaho authored Nov 05, 2015
    Instead of using constructor functions to initialize variables, it is
    better to use literal initializer syntax provided by HLSL when it is
    possible. This way shader complexity is reduced and constant array
    initialization doesn't have to go through as many AST transformations.
    
    Before this patch, vec4 initialization would result in the following
    kind of HLSL:
    
    float4 f = float4(1.0, 2.0, 3.0, 4.0);
    
    After this patch, it will be:
    
    float4 f = {1.0, 2.0, 3.0, 4.0};
    
    Before this patch, vec2 array initialization would result in the
    following kind of HLSL:
    
    float2 f[2] = {0, 0, 0, 0};
    angle_construct_into_2_float2(f, float2(1.0, 2.0), float2(3.0, 4.0));
    
    After this patch, it will be:
    
    float2 f[2] = {1.0, 2.0, 3.0, 4.0};
    
    BUG=angleproject:1094
    BUG=541551
    TEST=WebGL conformance tests
    
    Change-Id: I9816a8d95a2cba3964922f6b561862d478da6145
    Reviewed-on: https://chromium-review.googlesource.com/311160Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org>
    Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com>
    18b9deb4
SeparateArrayInitialization.h 1017 Bytes
EditWeb IDE
×

Replace SeparateArrayInitialization.h

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.