ホーム › Graphics.Direct3D11 › D3D11_CLASS_INSTANCE_DESC
D3D11_CLASS_INSTANCE_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| InstanceId | DWORD | 4 | +0 | +0 | HLSL クラスのインスタンス ID です。既定値は 0 です。 |
| InstanceIndex | DWORD | 4 | +4 | +4 | HLSL クラスのインスタンス インデックスです。既定値は 0 です。 |
| TypeId | DWORD | 4 | +8 | +8 | HLSL クラスの型 ID です。既定値は 0 です。 |
| ConstantBuffer | DWORD | 4 | +12 | +12 | HLSL クラスに関連付けられた定数バッファーを表します。既定値は 0 です。 |
| BaseConstantBufferOffset | DWORD | 4 | +16 | +16 | HLSL クラスに関連付けられた基本定数バッファーのオフセットです。既定値は 0 です。 |
| BaseTexture | DWORD | 4 | +20 | +20 | HLSL クラスに関連付けられた基本テクスチャです。既定値は 127 です。 |
| BaseSampler | DWORD | 4 | +24 | +24 | HLSL クラスに関連付けられた基本サンプラーです。既定値は 15 です。 |
| Created | BOOL | 4 | +28 | +28 | クラスが作成された場合は true です。既定値は false です。 |
公式ドキュメント
HLSL のクラス インスタンスを記述します。
解説(Remarks)
D3D11_CLASS_INSTANCE_DESC 構造体は、ID3D11ClassInstance::GetDesc メソッドによって返されます。
この構造体のメンバーは、InstanceIndex を除き、ID3D11ClassLinkage::CreateClassInstance を使用して取得したクラス インスタンスを表す場合に有効です (既定値以外の値になります)。InstanceIndex メンバーは、ID3D11ClassLinkage::GetClassInstance を使用してクラス インスタンスを取得した場合にのみ有効です。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// D3D11_CLASS_INSTANCE_DESC (x64 32 / x86 32 バイト)
typedef struct D3D11_CLASS_INSTANCE_DESC {
DWORD InstanceId;
DWORD InstanceIndex;
DWORD TypeId;
DWORD ConstantBuffer;
DWORD BaseConstantBufferOffset;
DWORD BaseTexture;
DWORD BaseSampler;
BOOL Created;
} D3D11_CLASS_INSTANCE_DESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_CLASS_INSTANCE_DESC
{
public uint InstanceId;
public uint InstanceIndex;
public uint TypeId;
public uint ConstantBuffer;
public uint BaseConstantBufferOffset;
public uint BaseTexture;
public uint BaseSampler;
[MarshalAs(UnmanagedType.Bool)] public bool Created;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_CLASS_INSTANCE_DESC
Public InstanceId As UInteger
Public InstanceIndex As UInteger
Public TypeId As UInteger
Public ConstantBuffer As UInteger
Public BaseConstantBufferOffset As UInteger
Public BaseTexture As UInteger
Public BaseSampler As UInteger
<MarshalAs(UnmanagedType.Bool)> Public Created As Boolean
End Structureimport ctypes
from ctypes import wintypes
class D3D11_CLASS_INSTANCE_DESC(ctypes.Structure):
_fields_ = [
("InstanceId", wintypes.DWORD),
("InstanceIndex", wintypes.DWORD),
("TypeId", wintypes.DWORD),
("ConstantBuffer", wintypes.DWORD),
("BaseConstantBufferOffset", wintypes.DWORD),
("BaseTexture", wintypes.DWORD),
("BaseSampler", wintypes.DWORD),
("Created", wintypes.BOOL),
]#[repr(C)]
pub struct D3D11_CLASS_INSTANCE_DESC {
pub InstanceId: u32,
pub InstanceIndex: u32,
pub TypeId: u32,
pub ConstantBuffer: u32,
pub BaseConstantBufferOffset: u32,
pub BaseTexture: u32,
pub BaseSampler: u32,
pub Created: i32,
}import "golang.org/x/sys/windows"
type D3D11_CLASS_INSTANCE_DESC struct {
InstanceId uint32
InstanceIndex uint32
TypeId uint32
ConstantBuffer uint32
BaseConstantBufferOffset uint32
BaseTexture uint32
BaseSampler uint32
Created int32
}type
D3D11_CLASS_INSTANCE_DESC = record
InstanceId: DWORD;
InstanceIndex: DWORD;
TypeId: DWORD;
ConstantBuffer: DWORD;
BaseConstantBufferOffset: DWORD;
BaseTexture: DWORD;
BaseSampler: DWORD;
Created: BOOL;
end;const D3D11_CLASS_INSTANCE_DESC = extern struct {
InstanceId: u32,
InstanceIndex: u32,
TypeId: u32,
ConstantBuffer: u32,
BaseConstantBufferOffset: u32,
BaseTexture: u32,
BaseSampler: u32,
Created: i32,
};type
D3D11_CLASS_INSTANCE_DESC {.bycopy.} = object
InstanceId: uint32
InstanceIndex: uint32
TypeId: uint32
ConstantBuffer: uint32
BaseConstantBufferOffset: uint32
BaseTexture: uint32
BaseSampler: uint32
Created: int32struct D3D11_CLASS_INSTANCE_DESC
{
uint InstanceId;
uint InstanceIndex;
uint TypeId;
uint ConstantBuffer;
uint BaseConstantBufferOffset;
uint BaseTexture;
uint BaseSampler;
int Created;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D11_CLASS_INSTANCE_DESC サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; InstanceId : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; InstanceIndex : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; TypeId : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ConstantBuffer : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; BaseConstantBufferOffset : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; BaseTexture : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; BaseSampler : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; Created : BOOL (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D11_CLASS_INSTANCE_DESC
#field int InstanceId
#field int InstanceIndex
#field int TypeId
#field int ConstantBuffer
#field int BaseConstantBufferOffset
#field int BaseTexture
#field int BaseSampler
#field bool Created
#endstruct
stdim st, D3D11_CLASS_INSTANCE_DESC ; NSTRUCT 変数を確保
st->InstanceId = 100
mes "InstanceId=" + st->InstanceId