Marshal image instruction parameters to the sampling trampoline
The SPIR-V 1.3 spec states that the Coordinate operand of
OpImageSample* instructions "may be a vector larger than needed, but all
unused components will appear after all used components."
The function for generating the sampling routine previously determined
the number of coordinates from the image view descriptor, which may not
match what's passed in at the SPIR-V sample instruction call site.
This change passes a 32-bit run-time constant to the trampoline, which
can contain the number of coordinates as well as the instruction type.
Hence we can eliminate the need for multiple static functions to encode
the latter.
Bug: b/129523279
Change-Id: I625b7396be3da770024a858d11e49b63ac457bed
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/30151
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Tested-by:
Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by:
Chris Forbes <chrisforbes@google.com>
Showing
Please
register
or
sign in
to comment