Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
mesa
mesa
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2,373
    • Issues 2,373
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 663
    • Merge Requests 663
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Mesa
  • mesamesa
  • Merge Requests
  • !7989

Merged
Opened Dec 08, 2020 by Connor Abbott@cwabbott0Developer

nir: Make nir_tex_instr::dest_type consistently sized

  • Overview 16
  • Commits 25
  • Pipelines 16
  • Changes 43

Originally this field didn't have any bitsize information. However, later types were added to some load/store intrinsics, and setters of those add a bitsize which always matches the size of the data SSA value/register, which made nir_tex_instr inconsistent. However the real mess was created when adding support for mediump, as glsl-to-nir just made fp16 and int16 destinations have a sized dest_type but kept the unsized type for the old 32-bit destinations. This meant that e.g. nir_type_float now actually meant nir_type_float32, so the shed was now painted half-red and half-green with some ugly mixture in the middle, and various backends have various workarounds for the situation. Further confusing things was that the new CL image-to-sampler lowering pass was even more (in)consistent, using sized types for everything.

This series untangles the resulting mess. I decided to go with sized types, as even though it's redundant it seems to be what backends that actually care want, and so it makes backends ever-so-slightly simpler, in addition to being consistent with what we're doing with intrinsics. First we update the few places that were inspecting the type and explicitly using e.g. nir_type_float, making them accept both sized and unsized types temporarily so that we can update everything piecemeal. Then we update all creators of nir_tex_instr to use sized types. The annoying part is that this includes everyone's home-baked blit shader, of which there are quite a lot. After this is done, we update nir_validate to make sure that we got it right and make sure it stays right, at which point we can finally get rid of the scaffolding we introduced at the beginning and make a few other simplifications. I think there are probably room for more simplifications in the dxil backend, but I'll let someone else handle that.

Edited Dec 08, 2020 by Connor Abbott
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: mesa/mesa!7989
Source branch: review/nir-fix-tex-dest-type