Pass the vk::Device to every routine as an extra parameter

Previously we stowed away the pointer to the device in the
SampledImageDescriptor structure. With OpImageWrite with an Unknown
format we'd also have to store it in the StorageImageDescriptor if we
were to follow the same approach for accessing the device's sampler
routine cache.

This change refactors things to instead pass the device pointer as an
argument of the processing routines.

Note that previously the pointer would be read again for every
descriptor access since the JIT has no way of knowing that the device
is the same for each of them.

Bug: b/203730083
Change-Id: I63f6f797610fb56b53d0b7f62811692f78e0d2f8
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/59328
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Device/VertexProcessor.hpp b/src/Device/VertexProcessor.hpp
index f202434..e8f6b14 100644
--- a/src/Device/VertexProcessor.hpp
+++ b/src/Device/VertexProcessor.hpp
@@ -51,7 +51,7 @@
 	VertexCache vertexCache;
 };
 
-using VertexRoutineFunction = FunctionT<void(Vertex *output, unsigned int *batch, VertexTask *vertextask, DrawData *draw)>;
+using VertexRoutineFunction = FunctionT<void(const vk::Device *device, Vertex *output, unsigned int *batch, VertexTask *vertextask, DrawData *draw)>;
 
 class VertexProcessor
 {