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
  • UniformHLSL.cpp
Find file
BlameHistoryPermalink
  • Olli Etuaho's avatar
    Support ESSL structs containing samplers on D3D · 9696316d
    Olli Etuaho authored Mar 21, 2016
    Since HLSL can't natively handle samplers in structs, samplers need to
    be extracted out of structs into separate variables in the translated
    shader code. In HLSL 4.1, samplers that were in structs go into the
    normal sampler arrays and are identified by index constants. In other
    HLSL versions, samplers that were in structs are translated as uniform
    variables.
    
    These transformations are done inside the HLSL output classes, not as
    tree transformations. This helps to keep the uniform API provided by
    the shader translator intact.
    
    Wherever a struct containing samplers is passed into a user-defined
    function, the translated HLSL code passes the separate sampler
    variables alongside a struct where the samplers have been removed.
    
    The D3D backend in libANGLE queries the uniform registers of any
    samplers that were in uniform structs, and adds them to the register
    maps, so that correct sampler state gets assigned to them.
    
    The extracted sampler variables are prefixed with "angle_" instead of
    the usual "_" to prevent any name conflicts between them and regular
    variables.
    
    BUG=angleproject:504
    TEST=angle_end2end_tests,
         dEQP-GLES*.functional.shaders.struct.uniform.* (all pass),
         dEQP-GLES*.functional.uniform_api.* (most now pass)
    
    Change-Id: Ib79cba2fa0ff8257a973d70dfd917a64f0ca1efb
    Reviewed-on: https://chromium-review.googlesource.com/333743Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
    Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
    Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
    9696316d
UniformHLSL.cpp 17.1 KB
EditWeb IDE
×

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