commit | f63c4e51101a33fbaeaaafba949830ad43f39055 | [log] [tgz] |
---|---|---|
author | Ben Clayton <bclayton@google.com> | Thu Aug 01 13:40:43 2019 +0100 |
committer | Ben Clayton <bclayton@google.com> | Thu Aug 01 15:30:27 2019 +0000 |
tree | d2bb2f53ef2a129741a817710b430462cdfb126c | |
parent | 0697da051e3ebeace6ef5a41df2dfc405d0eaa7d [diff] |
Reactor: Don't auto-initialize Pointer<T> variables with null. Micro-optimization as discussed here: https://swiftshader-review.googlesource.com/c/SwiftShader/+/34528/7/src/Pipeline/SpirvShader.hpp#1257 Change-Id: I0e71f2b5c882b2e65271a2e8f114239a924462f8 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/34549 Reviewed-by: Nicolas Capens <nicolascapens@google.com> Tested-by: Ben Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Pipeline/SpirvShader.hpp b/src/Pipeline/SpirvShader.hpp index c1d5e62..6405f18 100644 --- a/src/Pipeline/SpirvShader.hpp +++ b/src/Pipeline/SpirvShader.hpp
@@ -1253,9 +1253,9 @@ struct SamplerCache { - Pointer<Byte> imageDescriptor; - Pointer<Byte> sampler; - Pointer<Byte> function; + Pointer<Byte> imageDescriptor = nullptr; + Pointer<Byte> sampler = nullptr; + Pointer<Byte> function = nullptr; }; vk::PipelineLayout const * const pipelineLayout;
diff --git a/src/Reactor/Reactor.hpp b/src/Reactor/Reactor.hpp index e13f24d..d6a2f4a 100644 --- a/src/Reactor/Reactor.hpp +++ b/src/Reactor/Reactor.hpp
@@ -2818,10 +2818,7 @@ } template<class T> - Pointer<T>::Pointer() : alignment(1) - { - LValue<Pointer<T>>::storeValue(Nucleus::createNullPointer(T::getType())); - } + Pointer<T>::Pointer() : alignment(1) {} template<class T> Pointer<T>::Pointer(RValue<Pointer<T>> rhs) : alignment(1)