Пример #1
0
        public bool GetDeclaredStructMemberSize(SpirvType structType, int index, out int size)
        {
            if (spvc_compiler_get_declared_struct_member_size(Handle, structType.Handle, (uint)index, out IntPtr size_ptr) != Result.Success)
            {
                size = 0;
                return(false);
            }

            size = size_ptr.ToInt32();
            return(true);
        }
Пример #2
0
 internal SpirvType(Compiler compiler, IntPtr handle)
 {
     _compiler        = compiler;
     Handle           = handle;
     BaseType         = spvc_type_get_basetype(handle);
     BitWidth         = spvc_type_get_bit_width(handle);
     VectorSize       = spvc_type_get_vector_size(handle);
     Columns          = spvc_type_get_columns(handle);
     ArrayDimensions  = spvc_type_get_num_array_dimensions(handle);
     MemberCount      = spvc_type_get_num_member_types(handle);
     StorageClass     = spvc_type_get_storage_class(handle);
     ImageSampledType = compiler.GetSpirvType(spvc_type_get_image_sampled_type(handle));
     if (ImageSampledType != null)
     {
         ImageDimension       = spvc_type_get_image_dimension(handle);
         ImageIsDepth         = spvc_type_get_image_is_depth(handle);
         ImageIsArray         = spvc_type_get_image_arrayed(handle);
         ImageIsMultisampled  = spvc_type_get_image_multisampled(handle);
         ImageIsStorage       = spvc_type_get_image_is_storage(handle);
         ImageStorageFormat   = spvc_type_get_image_storage_format(handle);
         ImageAccessQualifier = spvc_type_get_image_access_qualifier(handle);
     }
 }
Пример #3
0
 public bool GetStructMemberMatrixStride(SpirvType type, int index, out int stride)
 {
     return(spvc_compiler_type_struct_member_matrix_stride(Handle, type.Handle, index, out stride) == Result.Success);
 }
Пример #4
0
 public bool GetStructMemberOffset(SpirvType type, int index, out int offset)
 {
     return(spvc_compiler_type_struct_member_offset(Handle, type.Handle, index, out offset) == Result.Success);
 }