Skip to content

[replay] Handle Pointer Math to find the BDA #2536

@spencer-lunarg

Description

@spencer-lunarg

In ParseBufferReferences in track_back_instruction it needs to handle pointer math

Here is an example godot based spirv bad.spv.txt

But you can see this with a simple GLSL shader https://godbolt.org/z/nj55vrMq4

You need to handle a case like

%load_a = OpLoad %uint64 %24
%load_b = OpLoad %uint32 %26
%1 = OpUConvert %uint64 %load_b
%2 = OpIAdd %uint64 %load_a %1
%3 = OpConvertUToPtr %ptr_type %2
OpStore %var %3

Note, there are now 2 loads that are used to calculate the pointer, a simpler version would be like https://godbolt.org/z/qWTMa7ac4 (no cast)

But a nasty case (not sure if real or not) is when you have 2 different variables used to generate the math like https://godbolt.org/z/EjMWrjb6x

@fabian-lunarg feel free to ping me for help/ideas around this if you want

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions