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
  • tree_ops
  • RemoveDynamicIndexing.cpp
Find file
BlameHistoryPermalink
  • jchen10's avatar
    Add SH_REMOVE_DYNAMIC_INDEXING_OF_SWIZZLED_VECTOR · b3070102
    jchen10 authored Oct 18, 2019
    This is a workaround for the webgl2 conformance test case
    WebglConformance_conformance2_glsl3_vector_dynamic_indexing_swizzled_lvalue.
    Dynamic indexing of swizzled lvalue like "v.zyx[i] = 0.0" is problematic on
    various platforms. This removes the indexing by translating it this way:
    
    void dyn_index_write_vec3(inout vec3 base, in int index, in float value){
      switch (index) {
        case (0):
          (base[0] = value);
          return ;
        case (1):
          (base[1] = value);
          return ;
        case (2):
          (base[2] = value);
          return ;
        default:
          break;
      }
      if ((index < 0))
      {
        (base[0] = value);
        return ;
      }
      {
        (base[2] = value);
      }
    }
    
    ...
    dyn_index_write_vec3(v.zyx, i, 0.0);
    ...
    
    Bug: chromium:709351
    Change-Id: I971b38eb404209b56e6764af1063878c078a7e88
    Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869109
    Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
    Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
    b3070102
RemoveDynamicIndexing.cpp 23 KB
EditWeb IDE
×

Replace RemoveDynamicIndexing.cpp

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.