Commit 029a36c7 by Nicolas Capens Committed by Nicolas Capens

Omit null initialization of sampler cache pointers

The last-used sampler routine can be reused when both the image and sampler descriptors are the same. To prevent a match on uninitialized cache keys we previously initialized them both to nullptr (as well as the function pointer itself), at the entry of the shader routine. This change reduces it to just initializing the image descriptor. This suffices since all image instructions use an image descriptor (but not all use a sampler descriptor). Bug: b/137649247 Change-Id: I62112f12a58ddefb6e56bddab8e3fdfa76c5b756 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/34628Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com>
parent 59d55a33
......@@ -1254,8 +1254,8 @@ namespace sw
struct SamplerCache
{
Pointer<Byte> imageDescriptor = nullptr;
Pointer<Byte> sampler = nullptr;
Pointer<Byte> function = nullptr;
Pointer<Byte> sampler;
Pointer<Byte> function;
};
vk::PipelineLayout const * const pipelineLayout;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment