Skip to content

[Spir-V] Failing simple tests #1344

Closed
Closed

Description

@TiemoJung

Hi,

we are considering moving over to dxc to translate hlsl to spir-v but our first simple test just fail.
Consider this:

ConsumeStructuredBuffer<uint> src : register(u0);
AppendStructuredBuffer<uint> dst : register(u1);

[numthreads(1,1,1)]
void main()
{
  dst.Append(src.Consume());
}

With this it reports an type mismatch error when you try to compile it with spir-v target turned on.
Tested with 0987e48

Activity

  1. added
    spirv
    on Jun 6, 2018
  2. ehsannas commented on Jun 6, 2018

    @ehsannas
    Contributor

    Hi! Thanks for reporting this issue. I'm investigating and will provide details soon.

  3. mmostajab commented on Jun 6, 2018

    @mmostajab

    ConsumeStructuredBuffer and AppendStructuredBuffer do not map to any valid buffer on Vulkan. I am not sure if this should be supported by DXC at all. Although, throwing an error mentioning this would be nice. These buffers do not exist in Dx12 either.

  4. ehsannas commented on Jun 6, 2018

    @ehsannas
    Contributor

    We currently do support compiling {Append|Consume}StructuredBuffer.

    I have found the root cause to be a corner case since the result of src.Consume() is passed directly to Append. Since these are intrinsic methods, they are treated with custom code in the compiler. I have a fix coming up.

  5. TiemoJung commented on Jun 6, 2018

    @TiemoJung
    Author

    Morteza Mostajab (@mmostajab) I have to disagree, they certainly do exist in DX12. And mapping to Vulkan exists as Ehsan (@ehsannas) already stated.

  6. mmostajab commented on Jun 6, 2018

    @mmostajab

    Thanks for the replies and sorry for the wrong information. You are right about it (since shader model 5 supports it, dx12 should support it as well) but I am not aware of any GLSL structs mapping to them. On the C/C++ side, we can use storage buffer or an image for them, probably.

  7. TiemoJung commented on Jun 6, 2018

    @TiemoJung
    Author

    DX12 has nativ support, on UAV create you supply a buffer that holds the counter.
    On GL and Vulkan you are on your own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

spirv

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions