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
  • OutputHLSL.cpp
Find file
BlameHistoryPermalink
  • jchen10's avatar
    Optimize HLSL zero initializer · efe061bd
    jchen10 authored Nov 13, 2018
    Currently we initialize a variable using zero initializer. Take the
    below variable for example:
        uint var[4];
    We translate it to:
        uint var[4] = { 0, 0, 0, 0};
    If the array size is large, we have to use very long zero initializer.
    The problem is that it's very slow for D3D drivers to compile.
    
    This CL uses the 'static' trick below to solve the problem:
        static uint _ANGLE_ZEROS_[256];
        ...
        uint var[516] = {_ANGLE_ZEROS_, _ANGLE_ZEROS_, 0, 0, 0, 0};
    
    For 'static', if the declaration does not include an initializer, the
    value is set to zero.
    https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-variable-syntax
    
    Bug: chromium:898030
    
    Change-Id: Ia3f6574b5ddaffa94bf971140eba95835ee105ee
    Reviewed-on: https://chromium-review.googlesource.com/c/1332805Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org>
    Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
    Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
    efe061bd
OutputHLSL.cpp 107 KB
EditWeb IDE
×

Replace OutputHLSL.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.