Win32 API 日本語リファレンス
ホームGraphics.Direct3D12 › D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT

D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT

構造体
サイズx64: 288 バイト / x86: 288 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
szAdapterFamilyWCHAR256+0+0アダプターファミリー名(ワイド文字列バッファ)。
MinimumABISupportVersionULONGLONG8+256+256サポートする最小ABIバージョン。
MaximumABISupportVersionULONGLONG8+264+264サポートする最大ABIバージョン。
CompilerVersionD3D12_VERSION_NUMBER8+272+272コンパイラーのバージョン番号。
ApplicationProfileVersionD3D12_VERSION_NUMBER8+280+280アプリケーションプロファイルのバージョン番号。

各言語での定義

#include <windows.h>

// D3D12_VERSION_NUMBER  (x64 8 / x86 8 バイト)
typedef struct D3D12_VERSION_NUMBER {
    ULONGLONG Version;
    WORD VersionParts[4];
} D3D12_VERSION_NUMBER;

// D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT  (x64 288 / x86 288 バイト)
typedef struct D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT {
    WCHAR szAdapterFamily[128];
    ULONGLONG MinimumABISupportVersion;
    ULONGLONG MaximumABISupportVersion;
    D3D12_VERSION_NUMBER CompilerVersion;
    D3D12_VERSION_NUMBER ApplicationProfileVersion;
} D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VERSION_NUMBER
{
    public ulong Version;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public ushort[] VersionParts;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT
{
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string szAdapterFamily;
    public ulong MinimumABISupportVersion;
    public ulong MaximumABISupportVersion;
    public D3D12_VERSION_NUMBER CompilerVersion;
    public D3D12_VERSION_NUMBER ApplicationProfileVersion;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VERSION_NUMBER
    Public Version As ULong
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public VersionParts() As UShort
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> Public szAdapterFamily As String
    Public MinimumABISupportVersion As ULong
    Public MaximumABISupportVersion As ULong
    Public CompilerVersion As D3D12_VERSION_NUMBER
    Public ApplicationProfileVersion As D3D12_VERSION_NUMBER
End Structure
import ctypes
from ctypes import wintypes

class D3D12_VERSION_NUMBER(ctypes.Structure):
    _fields_ = [
        ("Version", ctypes.c_ulonglong),
        ("VersionParts", ctypes.c_ushort * 4),
    ]

class D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT(ctypes.Structure):
    _fields_ = [
        ("szAdapterFamily", ctypes.c_wchar * 128),
        ("MinimumABISupportVersion", ctypes.c_ulonglong),
        ("MaximumABISupportVersion", ctypes.c_ulonglong),
        ("CompilerVersion", D3D12_VERSION_NUMBER),
        ("ApplicationProfileVersion", D3D12_VERSION_NUMBER),
    ]
#[repr(C)]
pub struct D3D12_VERSION_NUMBER {
    pub Version: u64,
    pub VersionParts: [u16; 4],
}

#[repr(C)]
pub struct D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT {
    pub szAdapterFamily: [u16; 128],
    pub MinimumABISupportVersion: u64,
    pub MaximumABISupportVersion: u64,
    pub CompilerVersion: D3D12_VERSION_NUMBER,
    pub ApplicationProfileVersion: D3D12_VERSION_NUMBER,
}
import "golang.org/x/sys/windows"

type D3D12_VERSION_NUMBER struct {
	Version uint64
	VersionParts [4]uint16
}

type D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT struct {
	szAdapterFamily [128]uint16
	MinimumABISupportVersion uint64
	MaximumABISupportVersion uint64
	CompilerVersion D3D12_VERSION_NUMBER
	ApplicationProfileVersion D3D12_VERSION_NUMBER
}
type
  D3D12_VERSION_NUMBER = record
    Version: UInt64;
    VersionParts: array[0..3] of Word;
  end;

  D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT = record
    szAdapterFamily: array[0..127] of WideChar;
    MinimumABISupportVersion: UInt64;
    MaximumABISupportVersion: UInt64;
    CompilerVersion: D3D12_VERSION_NUMBER;
    ApplicationProfileVersion: D3D12_VERSION_NUMBER;
  end;
const D3D12_VERSION_NUMBER = extern struct {
    Version: u64,
    VersionParts: [4]u16,
};

const D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT = extern struct {
    szAdapterFamily: [128]u16,
    MinimumABISupportVersion: u64,
    MaximumABISupportVersion: u64,
    CompilerVersion: D3D12_VERSION_NUMBER,
    ApplicationProfileVersion: D3D12_VERSION_NUMBER,
};
type
  D3D12_VERSION_NUMBER {.bycopy.} = object
    Version: uint64
    VersionParts: array[4, uint16]

  D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT {.bycopy.} = object
    szAdapterFamily: array[128, uint16]
    MinimumABISupportVersion: uint64
    MaximumABISupportVersion: uint64
    CompilerVersion: D3D12_VERSION_NUMBER
    ApplicationProfileVersion: D3D12_VERSION_NUMBER
struct D3D12_VERSION_NUMBER
{
    ulong Version;
    ushort[4] VersionParts;
}

struct D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT
{
    wchar[128] szAdapterFamily;
    ulong MinimumABISupportVersion;
    ulong MaximumABISupportVersion;
    D3D12_VERSION_NUMBER CompilerVersion;
    D3D12_VERSION_NUMBER ApplicationProfileVersion;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT サイズ: 288 バイト(x64)
dim st, 72    ; 4byte整数×72(構造体サイズ 288 / 4 切り上げ)
; szAdapterFamily : WCHAR (+0, 256byte)  varptr(st)+0 を基点に操作(256byte:入れ子/配列)
; MinimumABISupportVersion : ULONGLONG (+256, 8byte)  qpoke st,256,値 / qpeek(st,256)  ※IronHSPのみ。3.7/3.8は lpoke st,256,下位 : lpoke st,260,上位
; MaximumABISupportVersion : ULONGLONG (+264, 8byte)  qpoke st,264,値 / qpeek(st,264)  ※IronHSPのみ。3.7/3.8は lpoke st,264,下位 : lpoke st,268,上位
; CompilerVersion : D3D12_VERSION_NUMBER (+272, 8byte)  varptr(st)+272 を基点に操作(8byte:入れ子/配列)
; ApplicationProfileVersion : D3D12_VERSION_NUMBER (+280, 8byte)  varptr(st)+280 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT
    #field wchar szAdapterFamily 128
    #field int64 MinimumABISupportVersion
    #field int64 MaximumABISupportVersion
    #field byte CompilerVersion 8
    #field byte ApplicationProfileVersion 8
#endstruct

stdim st, D3D12_FEATURE_DATA_SHADERCACHE_ABI_SUPPORT        ; NSTRUCT 変数を確保
st->MinimumABISupportVersion = 100
mes "MinimumABISupportVersion=" + st->MinimumABISupportVersion
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。