Пример #1
0
        private static void Reflect(CompiledShader shader)
        {
            var buffer = new DxcBuffer
            {
                Encoding = 0,
                Ptr      = shader.Pointer,
                Size     = shader.Length
            };

            using UniqueComPtr <ID3D12ShaderReflection> reflection = default;
            Guard.ThrowIfFailed(Utils.Ptr->CreateReflection(&buffer, reflection.Iid, (void **)&reflection));

            D3D12_SHADER_DESC desc;

            Guard.ThrowIfFailed(reflection.Ptr->GetDesc(&desc));

            for (var i = 0u; i < desc.BoundResources; i++)
            {
                D3D12_SHADER_INPUT_BIND_DESC bindDesc;
                Guard.ThrowIfFailed(reflection.Ptr->GetResourceBindingDesc(i, &bindDesc));
            }
        }
Пример #2
0
 /// <inheritdoc cref="IEquatable{T}.Equals(T)"/>
 public bool Equals(CompiledShader other) => Type == other.Type && Span.SequenceEqual(other.Span);