OSDN Git Service

SpirvShader: Rework pointer types
authorBen Clayton <bclayton@google.com>
Fri, 5 Apr 2019 11:11:39 +0000 (12:11 +0100)
committerBen Clayton <bclayton@google.com>
Fri, 5 Apr 2019 17:09:36 +0000 (17:09 +0000)
commit484e08e0fae627f107df3458242e158741a42e96
treeaca1745a9086443a2ed9147b6a20b6100fc3a396
parentbd3af855ae74d9767eb68adcdd1a66c29dc1d81e
SpirvShader: Rework pointer types

Previously Objects of the Variable kind would hold an Object::ID to another pointerBase object, which was combined with a per-lane offset in SpirvRoutine::intermediates.
This is almost exactly the same as PhysicalPointer - except the base address was taken from SpirvRoutine::physicalPointers.

With descriptor indices, we need a dynamic base pointer (only known at emit time) with per lane offsets.

This change transforms the Kind::Variable and Kind::PhysicalPointer kinds into Kind::DivergentPointer and Kind::NonDivergentPointer. This reduces complexity in loads and stores, and better represents the various forms of pointer we care about.

Bug: b/126330097
Change-Id: I514af5962b9cad4109197893066eda6f996be107
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28390
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Presubmit-Ready: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
src/Pipeline/SpirvShader.cpp
src/Pipeline/SpirvShader.hpp