Skip to content

[SPIR-V] vk::BufferPointer<T>().Get().member = undefinedVar don't generate OpStore #7463

@devshgraphicsprogramming

Description

Description

I ran into this by accident, testing the types that vk::BufferPointer performs loads/stores with.

Steps to Reproduce

struct StaticMeshVertex
{
	float3 Position;
    uint pad;
};


StaticMeshVertex VertexFactory_GetVertex(uint vertexId)
 

{
    StaticMeshVertex retval;
    float3 uninit;
	vk::BufferPointer<StaticMeshVertex,4>(0xdeadbeefull).Get().Position = uninit;
    return retval;
}

https://godbolt.org/z/ee9PEMEsM

Actual Behavior

If the variable on the right hand side of the assignment is an OpUndef the corresponding OpStore won't be generated, and the BDA write gets sliently dropped.

If you perform the store with a constant or something else, it will be preserved

Environment

  • DXC version
  • Host Operating System <!--- Host operating system and version --->

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashneeds-triageAwaiting triagespirvWork related to SPIR-V

    Type

    No type

    Projects

    Status

    Triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions