ホーム › Graphics.Direct3D10 › D3D10_STATE_BLOCK_MASK
D3D10_STATE_BLOCK_MASK
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| VS | BYTE | 1 | +0 | +0 | 頂点シェーダ状態を保存対象とするかのマスク。 |
| VSSamplers | BYTE | 2 | +1 | +1 | 頂点シェーダのサンプラ状態を示すビットマスク配列。 |
| VSShaderResources | BYTE | 16 | +3 | +3 | 頂点シェーダのシェーダリソース状態を示すビットマスク配列。 |
| VSConstantBuffers | BYTE | 2 | +19 | +19 | 頂点シェーダの定数バッファ状態を示すビットマスク配列。 |
| GS | BYTE | 1 | +21 | +21 | ジオメトリシェーダ状態を保存対象とするかのマスク。 |
| GSSamplers | BYTE | 2 | +22 | +22 | ジオメトリシェーダのサンプラ状態を示すビットマスク配列。 |
| GSShaderResources | BYTE | 16 | +24 | +24 | ジオメトリシェーダのシェーダリソース状態を示すビットマスク配列。 |
| GSConstantBuffers | BYTE | 2 | +40 | +40 | ジオメトリシェーダの定数バッファ状態を示すビットマスク配列。 |
| PS | BYTE | 1 | +42 | +42 | ピクセルシェーダ状態を保存対象とするかのマスク。 |
| PSSamplers | BYTE | 2 | +43 | +43 | ピクセルシェーダのサンプラ状態を示すビットマスク配列。 |
| PSShaderResources | BYTE | 16 | +45 | +45 | ピクセルシェーダのシェーダリソース状態を示すビットマスク配列。 |
| PSConstantBuffers | BYTE | 2 | +61 | +61 | ピクセルシェーダの定数バッファ状態を示すビットマスク配列。 |
| IAVertexBuffers | BYTE | 2 | +63 | +63 | 入力アセンブラの頂点バッファ状態を示すビットマスク配列。 |
| IAIndexBuffer | BYTE | 1 | +65 | +65 | 入力アセンブラのインデックスバッファ状態を示すマスク。 |
| IAInputLayout | BYTE | 1 | +66 | +66 | 入力アセンブラの入力レイアウト状態を示すマスク。 |
| IAPrimitiveTopology | BYTE | 1 | +67 | +67 | 入力アセンブラのプリミティブトポロジ状態を示すマスク。 |
| OMRenderTargets | BYTE | 1 | +68 | +68 | 出力マージャのレンダーターゲット状態を示すマスク。 |
| OMDepthStencilState | BYTE | 1 | +69 | +69 | 出力マージャの深度ステンシル状態を示すマスク。 |
| OMBlendState | BYTE | 1 | +70 | +70 | 出力マージャのブレンド状態を示すマスク。 |
| RSViewports | BYTE | 1 | +71 | +71 | ラスタライザのビューポート状態を示すマスク。 |
| RSScissorRects | BYTE | 1 | +72 | +72 | ラスタライザのシザー矩形状態を示すマスク。 |
| RSRasterizerState | BYTE | 1 | +73 | +73 | ラスタライザのラスタライザ状態を示すマスク。 |
| SOBuffers | BYTE | 1 | +74 | +74 | ストリーム出力バッファ状態を示すマスク。 |
| Predication | BYTE | 1 | +75 | +75 | プレディケーション状態を保存対象とするかのマスク。 |
各言語での定義
#include <windows.h>
// D3D10_STATE_BLOCK_MASK (x64 76 / x86 76 バイト)
typedef struct D3D10_STATE_BLOCK_MASK {
BYTE VS;
BYTE VSSamplers[2];
BYTE VSShaderResources[16];
BYTE VSConstantBuffers[2];
BYTE GS;
BYTE GSSamplers[2];
BYTE GSShaderResources[16];
BYTE GSConstantBuffers[2];
BYTE PS;
BYTE PSSamplers[2];
BYTE PSShaderResources[16];
BYTE PSConstantBuffers[2];
BYTE IAVertexBuffers[2];
BYTE IAIndexBuffer;
BYTE IAInputLayout;
BYTE IAPrimitiveTopology;
BYTE OMRenderTargets;
BYTE OMDepthStencilState;
BYTE OMBlendState;
BYTE RSViewports;
BYTE RSScissorRects;
BYTE RSRasterizerState;
BYTE SOBuffers;
BYTE Predication;
} D3D10_STATE_BLOCK_MASK;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D10_STATE_BLOCK_MASK
{
public byte VS;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] VSSamplers;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] VSShaderResources;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] VSConstantBuffers;
public byte GS;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] GSSamplers;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] GSShaderResources;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] GSConstantBuffers;
public byte PS;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] PSSamplers;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] PSShaderResources;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] PSConstantBuffers;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] IAVertexBuffers;
public byte IAIndexBuffer;
public byte IAInputLayout;
public byte IAPrimitiveTopology;
public byte OMRenderTargets;
public byte OMDepthStencilState;
public byte OMBlendState;
public byte RSViewports;
public byte RSScissorRects;
public byte RSRasterizerState;
public byte SOBuffers;
public byte Predication;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D10_STATE_BLOCK_MASK
Public VS As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public VSSamplers() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public VSShaderResources() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public VSConstantBuffers() As Byte
Public GS As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public GSSamplers() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public GSShaderResources() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public GSConstantBuffers() As Byte
Public PS As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public PSSamplers() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public PSShaderResources() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public PSConstantBuffers() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public IAVertexBuffers() As Byte
Public IAIndexBuffer As Byte
Public IAInputLayout As Byte
Public IAPrimitiveTopology As Byte
Public OMRenderTargets As Byte
Public OMDepthStencilState As Byte
Public OMBlendState As Byte
Public RSViewports As Byte
Public RSScissorRects As Byte
Public RSRasterizerState As Byte
Public SOBuffers As Byte
Public Predication As Byte
End Structureimport ctypes
from ctypes import wintypes
class D3D10_STATE_BLOCK_MASK(ctypes.Structure):
_fields_ = [
("VS", ctypes.c_ubyte),
("VSSamplers", ctypes.c_ubyte * 2),
("VSShaderResources", ctypes.c_ubyte * 16),
("VSConstantBuffers", ctypes.c_ubyte * 2),
("GS", ctypes.c_ubyte),
("GSSamplers", ctypes.c_ubyte * 2),
("GSShaderResources", ctypes.c_ubyte * 16),
("GSConstantBuffers", ctypes.c_ubyte * 2),
("PS", ctypes.c_ubyte),
("PSSamplers", ctypes.c_ubyte * 2),
("PSShaderResources", ctypes.c_ubyte * 16),
("PSConstantBuffers", ctypes.c_ubyte * 2),
("IAVertexBuffers", ctypes.c_ubyte * 2),
("IAIndexBuffer", ctypes.c_ubyte),
("IAInputLayout", ctypes.c_ubyte),
("IAPrimitiveTopology", ctypes.c_ubyte),
("OMRenderTargets", ctypes.c_ubyte),
("OMDepthStencilState", ctypes.c_ubyte),
("OMBlendState", ctypes.c_ubyte),
("RSViewports", ctypes.c_ubyte),
("RSScissorRects", ctypes.c_ubyte),
("RSRasterizerState", ctypes.c_ubyte),
("SOBuffers", ctypes.c_ubyte),
("Predication", ctypes.c_ubyte),
]#[repr(C)]
pub struct D3D10_STATE_BLOCK_MASK {
pub VS: u8,
pub VSSamplers: [u8; 2],
pub VSShaderResources: [u8; 16],
pub VSConstantBuffers: [u8; 2],
pub GS: u8,
pub GSSamplers: [u8; 2],
pub GSShaderResources: [u8; 16],
pub GSConstantBuffers: [u8; 2],
pub PS: u8,
pub PSSamplers: [u8; 2],
pub PSShaderResources: [u8; 16],
pub PSConstantBuffers: [u8; 2],
pub IAVertexBuffers: [u8; 2],
pub IAIndexBuffer: u8,
pub IAInputLayout: u8,
pub IAPrimitiveTopology: u8,
pub OMRenderTargets: u8,
pub OMDepthStencilState: u8,
pub OMBlendState: u8,
pub RSViewports: u8,
pub RSScissorRects: u8,
pub RSRasterizerState: u8,
pub SOBuffers: u8,
pub Predication: u8,
}import "golang.org/x/sys/windows"
type D3D10_STATE_BLOCK_MASK struct {
VS byte
VSSamplers [2]byte
VSShaderResources [16]byte
VSConstantBuffers [2]byte
GS byte
GSSamplers [2]byte
GSShaderResources [16]byte
GSConstantBuffers [2]byte
PS byte
PSSamplers [2]byte
PSShaderResources [16]byte
PSConstantBuffers [2]byte
IAVertexBuffers [2]byte
IAIndexBuffer byte
IAInputLayout byte
IAPrimitiveTopology byte
OMRenderTargets byte
OMDepthStencilState byte
OMBlendState byte
RSViewports byte
RSScissorRects byte
RSRasterizerState byte
SOBuffers byte
Predication byte
}type
D3D10_STATE_BLOCK_MASK = record
VS: Byte;
VSSamplers: array[0..1] of Byte;
VSShaderResources: array[0..15] of Byte;
VSConstantBuffers: array[0..1] of Byte;
GS: Byte;
GSSamplers: array[0..1] of Byte;
GSShaderResources: array[0..15] of Byte;
GSConstantBuffers: array[0..1] of Byte;
PS: Byte;
PSSamplers: array[0..1] of Byte;
PSShaderResources: array[0..15] of Byte;
PSConstantBuffers: array[0..1] of Byte;
IAVertexBuffers: array[0..1] of Byte;
IAIndexBuffer: Byte;
IAInputLayout: Byte;
IAPrimitiveTopology: Byte;
OMRenderTargets: Byte;
OMDepthStencilState: Byte;
OMBlendState: Byte;
RSViewports: Byte;
RSScissorRects: Byte;
RSRasterizerState: Byte;
SOBuffers: Byte;
Predication: Byte;
end;const D3D10_STATE_BLOCK_MASK = extern struct {
VS: u8,
VSSamplers: [2]u8,
VSShaderResources: [16]u8,
VSConstantBuffers: [2]u8,
GS: u8,
GSSamplers: [2]u8,
GSShaderResources: [16]u8,
GSConstantBuffers: [2]u8,
PS: u8,
PSSamplers: [2]u8,
PSShaderResources: [16]u8,
PSConstantBuffers: [2]u8,
IAVertexBuffers: [2]u8,
IAIndexBuffer: u8,
IAInputLayout: u8,
IAPrimitiveTopology: u8,
OMRenderTargets: u8,
OMDepthStencilState: u8,
OMBlendState: u8,
RSViewports: u8,
RSScissorRects: u8,
RSRasterizerState: u8,
SOBuffers: u8,
Predication: u8,
};type
D3D10_STATE_BLOCK_MASK {.bycopy.} = object
VS: uint8
VSSamplers: array[2, uint8]
VSShaderResources: array[16, uint8]
VSConstantBuffers: array[2, uint8]
GS: uint8
GSSamplers: array[2, uint8]
GSShaderResources: array[16, uint8]
GSConstantBuffers: array[2, uint8]
PS: uint8
PSSamplers: array[2, uint8]
PSShaderResources: array[16, uint8]
PSConstantBuffers: array[2, uint8]
IAVertexBuffers: array[2, uint8]
IAIndexBuffer: uint8
IAInputLayout: uint8
IAPrimitiveTopology: uint8
OMRenderTargets: uint8
OMDepthStencilState: uint8
OMBlendState: uint8
RSViewports: uint8
RSScissorRects: uint8
RSRasterizerState: uint8
SOBuffers: uint8
Predication: uint8struct D3D10_STATE_BLOCK_MASK
{
ubyte VS;
ubyte[2] VSSamplers;
ubyte[16] VSShaderResources;
ubyte[2] VSConstantBuffers;
ubyte GS;
ubyte[2] GSSamplers;
ubyte[16] GSShaderResources;
ubyte[2] GSConstantBuffers;
ubyte PS;
ubyte[2] PSSamplers;
ubyte[16] PSShaderResources;
ubyte[2] PSConstantBuffers;
ubyte[2] IAVertexBuffers;
ubyte IAIndexBuffer;
ubyte IAInputLayout;
ubyte IAPrimitiveTopology;
ubyte OMRenderTargets;
ubyte OMDepthStencilState;
ubyte OMBlendState;
ubyte RSViewports;
ubyte RSScissorRects;
ubyte RSRasterizerState;
ubyte SOBuffers;
ubyte Predication;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D10_STATE_BLOCK_MASK サイズ: 76 バイト(x64)
dim st, 19 ; 4byte整数×19(構造体サイズ 76 / 4 切り上げ)
; VS : BYTE (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; VSSamplers : BYTE (+1, 2byte) varptr(st)+1 を基点に操作(2byte:入れ子/配列)
; VSShaderResources : BYTE (+3, 16byte) varptr(st)+3 を基点に操作(16byte:入れ子/配列)
; VSConstantBuffers : BYTE (+19, 2byte) varptr(st)+19 を基点に操作(2byte:入れ子/配列)
; GS : BYTE (+21, 1byte) poke st,21,値 / 値 = peek(st,21)
; GSSamplers : BYTE (+22, 2byte) varptr(st)+22 を基点に操作(2byte:入れ子/配列)
; GSShaderResources : BYTE (+24, 16byte) varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; GSConstantBuffers : BYTE (+40, 2byte) varptr(st)+40 を基点に操作(2byte:入れ子/配列)
; PS : BYTE (+42, 1byte) poke st,42,値 / 値 = peek(st,42)
; PSSamplers : BYTE (+43, 2byte) varptr(st)+43 を基点に操作(2byte:入れ子/配列)
; PSShaderResources : BYTE (+45, 16byte) varptr(st)+45 を基点に操作(16byte:入れ子/配列)
; PSConstantBuffers : BYTE (+61, 2byte) varptr(st)+61 を基点に操作(2byte:入れ子/配列)
; IAVertexBuffers : BYTE (+63, 2byte) varptr(st)+63 を基点に操作(2byte:入れ子/配列)
; IAIndexBuffer : BYTE (+65, 1byte) poke st,65,値 / 値 = peek(st,65)
; IAInputLayout : BYTE (+66, 1byte) poke st,66,値 / 値 = peek(st,66)
; IAPrimitiveTopology : BYTE (+67, 1byte) poke st,67,値 / 値 = peek(st,67)
; OMRenderTargets : BYTE (+68, 1byte) poke st,68,値 / 値 = peek(st,68)
; OMDepthStencilState : BYTE (+69, 1byte) poke st,69,値 / 値 = peek(st,69)
; OMBlendState : BYTE (+70, 1byte) poke st,70,値 / 値 = peek(st,70)
; RSViewports : BYTE (+71, 1byte) poke st,71,値 / 値 = peek(st,71)
; RSScissorRects : BYTE (+72, 1byte) poke st,72,値 / 値 = peek(st,72)
; RSRasterizerState : BYTE (+73, 1byte) poke st,73,値 / 値 = peek(st,73)
; SOBuffers : BYTE (+74, 1byte) poke st,74,値 / 値 = peek(st,74)
; Predication : BYTE (+75, 1byte) poke st,75,値 / 値 = peek(st,75)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D10_STATE_BLOCK_MASK
#field byte VS
#field byte VSSamplers 2
#field byte VSShaderResources 16
#field byte VSConstantBuffers 2
#field byte GS
#field byte GSSamplers 2
#field byte GSShaderResources 16
#field byte GSConstantBuffers 2
#field byte PS
#field byte PSSamplers 2
#field byte PSShaderResources 16
#field byte PSConstantBuffers 2
#field byte IAVertexBuffers 2
#field byte IAIndexBuffer
#field byte IAInputLayout
#field byte IAPrimitiveTopology
#field byte OMRenderTargets
#field byte OMDepthStencilState
#field byte OMBlendState
#field byte RSViewports
#field byte RSScissorRects
#field byte RSRasterizerState
#field byte SOBuffers
#field byte Predication
#endstruct
stdim st, D3D10_STATE_BLOCK_MASK ; NSTRUCT 変数を確保
st->VS = 100
mes "VS=" + st->VS