OSDN Git Service

Add support for derivative instructions
authorChris Forbes <chrisforbes@google.com>
Wed, 20 Mar 2019 21:50:24 +0000 (14:50 -0700)
committerChris Forbes <chrisforbes@google.com>
Thu, 21 Mar 2019 00:37:38 +0000 (00:37 +0000)
commitaff2dd067015060a81d43ea768160045a42648c2
tree67b2a32ab756d6570497f265ef7f04b92145968d
parentc296806411fb97eeb756c02378ac9b33b4feaada
Add support for derivative instructions

- OpDPdx
- OpDPdy
- OpFwidth
- OpDPdxCoarse
- OpDPdyCoarse
- OpFwidthCoarse
- OpDPdxFine
- OpDPdyFine
- OpFwidthFine

We have flexibility in how we implement the OpDPdx, OpDPdy and OpFwidth
instructions; they can return either coarse or fine derivatives.
I have chosen to make them equivalent to the coarse derivatives since
those are slightly cheaper to compute.

Added a static assert to ensure we revisit these when considering other
vector widths.

Bug: b/129002115
Test: dEQP-VK.glsl.derivate.*
Change-Id: I75224c1e77c1eefac4f219be5662836daa86a098
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27689
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
src/Pipeline/SpirvShader.cpp