ホーム › Graphics.Direct3D10 › D3D10_SHADER_DESC
D3D10_SHADER_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Version | DWORD | 4 | +0 | +0 | シェーダのバージョンとタイプを符号化した値。 |
| Creator | LPSTR | 8/4 | +8 | +4 | シェーダをコンパイルしたコンパイラ名を示す文字列。 |
| Flags | DWORD | 4 | +16 | +8 | コンパイル時に指定されたフラグの組み合わせ。 |
| ConstantBuffers | DWORD | 4 | +20 | +12 | シェーダが使用する定数バッファの数。 |
| BoundResources | DWORD | 4 | +24 | +16 | シェーダにバインドされたリソースの数。 |
| InputParameters | DWORD | 4 | +28 | +20 | 入力シグネチャのパラメータ数。 |
| OutputParameters | DWORD | 4 | +32 | +24 | 出力シグネチャのパラメータ数。 |
| InstructionCount | DWORD | 4 | +36 | +28 | シェーダ命令の総数。 |
| TempRegisterCount | DWORD | 4 | +40 | +32 | 使用された一時レジスタの数。 |
| TempArrayCount | DWORD | 4 | +44 | +36 | 使用された一時配列の数。 |
| DefCount | DWORD | 4 | +48 | +40 | 定数定義(def)命令の数。 |
| DclCount | DWORD | 4 | +52 | +44 | 宣言(dcl)命令の数。 |
| TextureNormalInstructions | DWORD | 4 | +56 | +48 | 通常のテクスチャ命令の数。 |
| TextureLoadInstructions | DWORD | 4 | +60 | +52 | テクスチャロード命令の数。 |
| TextureCompInstructions | DWORD | 4 | +64 | +56 | テクスチャ比較命令の数。 |
| TextureBiasInstructions | DWORD | 4 | +68 | +60 | バイアス付きテクスチャ命令の数。 |
| TextureGradientInstructions | DWORD | 4 | +72 | +64 | 勾配付きテクスチャ命令の数。 |
| FloatInstructionCount | DWORD | 4 | +76 | +68 | 浮動小数点演算命令の数。 |
| IntInstructionCount | DWORD | 4 | +80 | +72 | 符号付き整数演算命令の数。 |
| UintInstructionCount | DWORD | 4 | +84 | +76 | 符号なし整数演算命令の数。 |
| StaticFlowControlCount | DWORD | 4 | +88 | +80 | 静的フロー制御命令の数。 |
| DynamicFlowControlCount | DWORD | 4 | +92 | +84 | 動的フロー制御命令の数。 |
| MacroInstructionCount | DWORD | 4 | +96 | +88 | マクロ命令の数。 |
| ArrayInstructionCount | DWORD | 4 | +100 | +92 | 配列命令の数。 |
| CutInstructionCount | DWORD | 4 | +104 | +96 | ジオメトリシェーダのcut命令の数。 |
| EmitInstructionCount | DWORD | 4 | +108 | +100 | ジオメトリシェーダのemit命令の数。 |
| GSOutputTopology | D3D_PRIMITIVE_TOPOLOGY | 4 | +112 | +104 | ジオメトリシェーダ出力のプリミティブトポロジ。 |
| GSMaxOutputVertexCount | DWORD | 4 | +116 | +108 | ジオメトリシェーダが出力する最大頂点数。 |
各言語での定義
#include <windows.h>
// D3D10_SHADER_DESC (x64 120 / x86 112 バイト)
typedef struct D3D10_SHADER_DESC {
DWORD Version;
LPSTR Creator;
DWORD Flags;
DWORD ConstantBuffers;
DWORD BoundResources;
DWORD InputParameters;
DWORD OutputParameters;
DWORD InstructionCount;
DWORD TempRegisterCount;
DWORD TempArrayCount;
DWORD DefCount;
DWORD DclCount;
DWORD TextureNormalInstructions;
DWORD TextureLoadInstructions;
DWORD TextureCompInstructions;
DWORD TextureBiasInstructions;
DWORD TextureGradientInstructions;
DWORD FloatInstructionCount;
DWORD IntInstructionCount;
DWORD UintInstructionCount;
DWORD StaticFlowControlCount;
DWORD DynamicFlowControlCount;
DWORD MacroInstructionCount;
DWORD ArrayInstructionCount;
DWORD CutInstructionCount;
DWORD EmitInstructionCount;
D3D_PRIMITIVE_TOPOLOGY GSOutputTopology;
DWORD GSMaxOutputVertexCount;
} D3D10_SHADER_DESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D10_SHADER_DESC
{
public uint Version;
public IntPtr Creator;
public uint Flags;
public uint ConstantBuffers;
public uint BoundResources;
public uint InputParameters;
public uint OutputParameters;
public uint InstructionCount;
public uint TempRegisterCount;
public uint TempArrayCount;
public uint DefCount;
public uint DclCount;
public uint TextureNormalInstructions;
public uint TextureLoadInstructions;
public uint TextureCompInstructions;
public uint TextureBiasInstructions;
public uint TextureGradientInstructions;
public uint FloatInstructionCount;
public uint IntInstructionCount;
public uint UintInstructionCount;
public uint StaticFlowControlCount;
public uint DynamicFlowControlCount;
public uint MacroInstructionCount;
public uint ArrayInstructionCount;
public uint CutInstructionCount;
public uint EmitInstructionCount;
public int GSOutputTopology;
public uint GSMaxOutputVertexCount;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D10_SHADER_DESC
Public Version As UInteger
Public Creator As IntPtr
Public Flags As UInteger
Public ConstantBuffers As UInteger
Public BoundResources As UInteger
Public InputParameters As UInteger
Public OutputParameters As UInteger
Public InstructionCount As UInteger
Public TempRegisterCount As UInteger
Public TempArrayCount As UInteger
Public DefCount As UInteger
Public DclCount As UInteger
Public TextureNormalInstructions As UInteger
Public TextureLoadInstructions As UInteger
Public TextureCompInstructions As UInteger
Public TextureBiasInstructions As UInteger
Public TextureGradientInstructions As UInteger
Public FloatInstructionCount As UInteger
Public IntInstructionCount As UInteger
Public UintInstructionCount As UInteger
Public StaticFlowControlCount As UInteger
Public DynamicFlowControlCount As UInteger
Public MacroInstructionCount As UInteger
Public ArrayInstructionCount As UInteger
Public CutInstructionCount As UInteger
Public EmitInstructionCount As UInteger
Public GSOutputTopology As Integer
Public GSMaxOutputVertexCount As UInteger
End Structureimport ctypes
from ctypes import wintypes
class D3D10_SHADER_DESC(ctypes.Structure):
_fields_ = [
("Version", wintypes.DWORD),
("Creator", ctypes.c_void_p),
("Flags", wintypes.DWORD),
("ConstantBuffers", wintypes.DWORD),
("BoundResources", wintypes.DWORD),
("InputParameters", wintypes.DWORD),
("OutputParameters", wintypes.DWORD),
("InstructionCount", wintypes.DWORD),
("TempRegisterCount", wintypes.DWORD),
("TempArrayCount", wintypes.DWORD),
("DefCount", wintypes.DWORD),
("DclCount", wintypes.DWORD),
("TextureNormalInstructions", wintypes.DWORD),
("TextureLoadInstructions", wintypes.DWORD),
("TextureCompInstructions", wintypes.DWORD),
("TextureBiasInstructions", wintypes.DWORD),
("TextureGradientInstructions", wintypes.DWORD),
("FloatInstructionCount", wintypes.DWORD),
("IntInstructionCount", wintypes.DWORD),
("UintInstructionCount", wintypes.DWORD),
("StaticFlowControlCount", wintypes.DWORD),
("DynamicFlowControlCount", wintypes.DWORD),
("MacroInstructionCount", wintypes.DWORD),
("ArrayInstructionCount", wintypes.DWORD),
("CutInstructionCount", wintypes.DWORD),
("EmitInstructionCount", wintypes.DWORD),
("GSOutputTopology", ctypes.c_int),
("GSMaxOutputVertexCount", wintypes.DWORD),
]#[repr(C)]
pub struct D3D10_SHADER_DESC {
pub Version: u32,
pub Creator: *mut core::ffi::c_void,
pub Flags: u32,
pub ConstantBuffers: u32,
pub BoundResources: u32,
pub InputParameters: u32,
pub OutputParameters: u32,
pub InstructionCount: u32,
pub TempRegisterCount: u32,
pub TempArrayCount: u32,
pub DefCount: u32,
pub DclCount: u32,
pub TextureNormalInstructions: u32,
pub TextureLoadInstructions: u32,
pub TextureCompInstructions: u32,
pub TextureBiasInstructions: u32,
pub TextureGradientInstructions: u32,
pub FloatInstructionCount: u32,
pub IntInstructionCount: u32,
pub UintInstructionCount: u32,
pub StaticFlowControlCount: u32,
pub DynamicFlowControlCount: u32,
pub MacroInstructionCount: u32,
pub ArrayInstructionCount: u32,
pub CutInstructionCount: u32,
pub EmitInstructionCount: u32,
pub GSOutputTopology: i32,
pub GSMaxOutputVertexCount: u32,
}import "golang.org/x/sys/windows"
type D3D10_SHADER_DESC struct {
Version uint32
Creator uintptr
Flags uint32
ConstantBuffers uint32
BoundResources uint32
InputParameters uint32
OutputParameters uint32
InstructionCount uint32
TempRegisterCount uint32
TempArrayCount uint32
DefCount uint32
DclCount uint32
TextureNormalInstructions uint32
TextureLoadInstructions uint32
TextureCompInstructions uint32
TextureBiasInstructions uint32
TextureGradientInstructions uint32
FloatInstructionCount uint32
IntInstructionCount uint32
UintInstructionCount uint32
StaticFlowControlCount uint32
DynamicFlowControlCount uint32
MacroInstructionCount uint32
ArrayInstructionCount uint32
CutInstructionCount uint32
EmitInstructionCount uint32
GSOutputTopology int32
GSMaxOutputVertexCount uint32
}type
D3D10_SHADER_DESC = record
Version: DWORD;
Creator: Pointer;
Flags: DWORD;
ConstantBuffers: DWORD;
BoundResources: DWORD;
InputParameters: DWORD;
OutputParameters: DWORD;
InstructionCount: DWORD;
TempRegisterCount: DWORD;
TempArrayCount: DWORD;
DefCount: DWORD;
DclCount: DWORD;
TextureNormalInstructions: DWORD;
TextureLoadInstructions: DWORD;
TextureCompInstructions: DWORD;
TextureBiasInstructions: DWORD;
TextureGradientInstructions: DWORD;
FloatInstructionCount: DWORD;
IntInstructionCount: DWORD;
UintInstructionCount: DWORD;
StaticFlowControlCount: DWORD;
DynamicFlowControlCount: DWORD;
MacroInstructionCount: DWORD;
ArrayInstructionCount: DWORD;
CutInstructionCount: DWORD;
EmitInstructionCount: DWORD;
GSOutputTopology: Integer;
GSMaxOutputVertexCount: DWORD;
end;const D3D10_SHADER_DESC = extern struct {
Version: u32,
Creator: ?*anyopaque,
Flags: u32,
ConstantBuffers: u32,
BoundResources: u32,
InputParameters: u32,
OutputParameters: u32,
InstructionCount: u32,
TempRegisterCount: u32,
TempArrayCount: u32,
DefCount: u32,
DclCount: u32,
TextureNormalInstructions: u32,
TextureLoadInstructions: u32,
TextureCompInstructions: u32,
TextureBiasInstructions: u32,
TextureGradientInstructions: u32,
FloatInstructionCount: u32,
IntInstructionCount: u32,
UintInstructionCount: u32,
StaticFlowControlCount: u32,
DynamicFlowControlCount: u32,
MacroInstructionCount: u32,
ArrayInstructionCount: u32,
CutInstructionCount: u32,
EmitInstructionCount: u32,
GSOutputTopology: i32,
GSMaxOutputVertexCount: u32,
};type
D3D10_SHADER_DESC {.bycopy.} = object
Version: uint32
Creator: pointer
Flags: uint32
ConstantBuffers: uint32
BoundResources: uint32
InputParameters: uint32
OutputParameters: uint32
InstructionCount: uint32
TempRegisterCount: uint32
TempArrayCount: uint32
DefCount: uint32
DclCount: uint32
TextureNormalInstructions: uint32
TextureLoadInstructions: uint32
TextureCompInstructions: uint32
TextureBiasInstructions: uint32
TextureGradientInstructions: uint32
FloatInstructionCount: uint32
IntInstructionCount: uint32
UintInstructionCount: uint32
StaticFlowControlCount: uint32
DynamicFlowControlCount: uint32
MacroInstructionCount: uint32
ArrayInstructionCount: uint32
CutInstructionCount: uint32
EmitInstructionCount: uint32
GSOutputTopology: int32
GSMaxOutputVertexCount: uint32struct D3D10_SHADER_DESC
{
uint Version;
void* Creator;
uint Flags;
uint ConstantBuffers;
uint BoundResources;
uint InputParameters;
uint OutputParameters;
uint InstructionCount;
uint TempRegisterCount;
uint TempArrayCount;
uint DefCount;
uint DclCount;
uint TextureNormalInstructions;
uint TextureLoadInstructions;
uint TextureCompInstructions;
uint TextureBiasInstructions;
uint TextureGradientInstructions;
uint FloatInstructionCount;
uint IntInstructionCount;
uint UintInstructionCount;
uint StaticFlowControlCount;
uint DynamicFlowControlCount;
uint MacroInstructionCount;
uint ArrayInstructionCount;
uint CutInstructionCount;
uint EmitInstructionCount;
int GSOutputTopology;
uint GSMaxOutputVertexCount;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D10_SHADER_DESC サイズ: 112 バイト(x86)
dim st, 28 ; 4byte整数×28(構造体サイズ 112 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Creator : LPSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Flags : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ConstantBuffers : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; BoundResources : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; InputParameters : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; OutputParameters : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; InstructionCount : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; TempRegisterCount : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; TempArrayCount : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; DefCount : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; DclCount : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; TextureNormalInstructions : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; TextureLoadInstructions : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; TextureCompInstructions : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; TextureBiasInstructions : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; TextureGradientInstructions : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; FloatInstructionCount : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; IntInstructionCount : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; UintInstructionCount : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; StaticFlowControlCount : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; DynamicFlowControlCount : DWORD (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; MacroInstructionCount : DWORD (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; ArrayInstructionCount : DWORD (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; CutInstructionCount : DWORD (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; EmitInstructionCount : DWORD (+100, 4byte) st.25 = 値 / 値 = st.25 (lpoke/lpeek も可)
; GSOutputTopology : D3D_PRIMITIVE_TOPOLOGY (+104, 4byte) st.26 = 値 / 値 = st.26 (lpoke/lpeek も可)
; GSMaxOutputVertexCount : DWORD (+108, 4byte) st.27 = 値 / 値 = st.27 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D10_SHADER_DESC サイズ: 120 バイト(x64)
dim st, 30 ; 4byte整数×30(構造体サイズ 120 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Creator : LPSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Flags : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ConstantBuffers : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; BoundResources : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; InputParameters : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; OutputParameters : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; InstructionCount : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; TempRegisterCount : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; TempArrayCount : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; DefCount : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; DclCount : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; TextureNormalInstructions : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; TextureLoadInstructions : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; TextureCompInstructions : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; TextureBiasInstructions : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; TextureGradientInstructions : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; FloatInstructionCount : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; IntInstructionCount : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; UintInstructionCount : DWORD (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; StaticFlowControlCount : DWORD (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; DynamicFlowControlCount : DWORD (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; MacroInstructionCount : DWORD (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; ArrayInstructionCount : DWORD (+100, 4byte) st.25 = 値 / 値 = st.25 (lpoke/lpeek も可)
; CutInstructionCount : DWORD (+104, 4byte) st.26 = 値 / 値 = st.26 (lpoke/lpeek も可)
; EmitInstructionCount : DWORD (+108, 4byte) st.27 = 値 / 値 = st.27 (lpoke/lpeek も可)
; GSOutputTopology : D3D_PRIMITIVE_TOPOLOGY (+112, 4byte) st.28 = 値 / 値 = st.28 (lpoke/lpeek も可)
; GSMaxOutputVertexCount : DWORD (+116, 4byte) st.29 = 値 / 値 = st.29 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D10_SHADER_DESC
#field int Version
#field intptr Creator
#field int Flags
#field int ConstantBuffers
#field int BoundResources
#field int InputParameters
#field int OutputParameters
#field int InstructionCount
#field int TempRegisterCount
#field int TempArrayCount
#field int DefCount
#field int DclCount
#field int TextureNormalInstructions
#field int TextureLoadInstructions
#field int TextureCompInstructions
#field int TextureBiasInstructions
#field int TextureGradientInstructions
#field int FloatInstructionCount
#field int IntInstructionCount
#field int UintInstructionCount
#field int StaticFlowControlCount
#field int DynamicFlowControlCount
#field int MacroInstructionCount
#field int ArrayInstructionCount
#field int CutInstructionCount
#field int EmitInstructionCount
#field int GSOutputTopology
#field int GSMaxOutputVertexCount
#endstruct
stdim st, D3D10_SHADER_DESC ; NSTRUCT 変数を確保
st->Version = 100
mes "Version=" + st->Version