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
  • ParseContext.cpp
Find file
BlameHistoryPermalink
  • Nicolas Capens's avatar
    Validate GLSL attribute location range · 07c03b6d
    Nicolas Capens authored Sep 11, 2020
    The location index of a vertex shader input's layout qualifier must be
    less than GL_MAX_VERTEX_ATTRIBS to link successfully. We can check for
    this during shader compilation to not rely on other layers to handle
    pathological cases.
    
    While strictly speaking only 'active' attributes are considered during
    shader linking, this is merely intended to allow for 'uber' shaders to
    declare more inputs than GL_MAX_VERTEX_ATTRIBS but only use a subset of
    them. There is no known reasonable use case for a manually specified
    location to exceed the valid range.
    
    Note that according to http://opengl.gpuinfo.org, the highest
    GL_MAX_VERTEX_ATTRIBS value at the time of writing is 32. Also,
    D3D12_VS_INPUT_REGISTER_COUNT = 32. Hence the unit test's value of 1000
    should be sufficiently future proof.
    
    Also address the case where the uniform location might be close to
    INT_MAX and not be detected as out-of-range due to numeric overflow.
    
    Bug: chromium:1110800
    Change-Id: I9985c8eab3bb8a2a59b8f985e8f5b6884756383c
    Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2405368Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
    Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
    Commit-Queue: Nicolas Capens <capn@chromium.org>
    07c03b6d
ParseContext.cpp 227 KB
EditWeb IDE
×

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