ホーム › Graphics.Direct3D12 › D3D12_BARRIER_SUBRESOURCE_RANGE
D3D12_BARRIER_SUBRESOURCE_RANGE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| IndexOrFirstMipLevel | DWORD | 4 | +0 | +0 | 単一サブリソースのインデックス、または範囲指定時の先頭ミップレベル。 |
| NumMipLevels | DWORD | 4 | +4 | +4 | 対象とするミップレベル数。0で単一サブリソース指定とみなす。 |
| FirstArraySlice | DWORD | 4 | +8 | +8 | 対象とする先頭の配列スライス。 |
| NumArraySlices | DWORD | 4 | +12 | +12 | 対象とする配列スライス数。 |
| FirstPlane | DWORD | 4 | +16 | +16 | 対象とする先頭のプレーンスライス。 |
| NumPlanes | DWORD | 4 | +20 | +20 | 対象とするプレーンスライス数。 |
各言語での定義
#include <windows.h>
// D3D12_BARRIER_SUBRESOURCE_RANGE (x64 24 / x86 24 バイト)
typedef struct D3D12_BARRIER_SUBRESOURCE_RANGE {
DWORD IndexOrFirstMipLevel;
DWORD NumMipLevels;
DWORD FirstArraySlice;
DWORD NumArraySlices;
DWORD FirstPlane;
DWORD NumPlanes;
} D3D12_BARRIER_SUBRESOURCE_RANGE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_BARRIER_SUBRESOURCE_RANGE
{
public uint IndexOrFirstMipLevel;
public uint NumMipLevels;
public uint FirstArraySlice;
public uint NumArraySlices;
public uint FirstPlane;
public uint NumPlanes;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_BARRIER_SUBRESOURCE_RANGE
Public IndexOrFirstMipLevel As UInteger
Public NumMipLevels As UInteger
Public FirstArraySlice As UInteger
Public NumArraySlices As UInteger
Public FirstPlane As UInteger
Public NumPlanes As UInteger
End Structureimport ctypes
from ctypes import wintypes
class D3D12_BARRIER_SUBRESOURCE_RANGE(ctypes.Structure):
_fields_ = [
("IndexOrFirstMipLevel", wintypes.DWORD),
("NumMipLevels", wintypes.DWORD),
("FirstArraySlice", wintypes.DWORD),
("NumArraySlices", wintypes.DWORD),
("FirstPlane", wintypes.DWORD),
("NumPlanes", wintypes.DWORD),
]#[repr(C)]
pub struct D3D12_BARRIER_SUBRESOURCE_RANGE {
pub IndexOrFirstMipLevel: u32,
pub NumMipLevels: u32,
pub FirstArraySlice: u32,
pub NumArraySlices: u32,
pub FirstPlane: u32,
pub NumPlanes: u32,
}import "golang.org/x/sys/windows"
type D3D12_BARRIER_SUBRESOURCE_RANGE struct {
IndexOrFirstMipLevel uint32
NumMipLevels uint32
FirstArraySlice uint32
NumArraySlices uint32
FirstPlane uint32
NumPlanes uint32
}type
D3D12_BARRIER_SUBRESOURCE_RANGE = record
IndexOrFirstMipLevel: DWORD;
NumMipLevels: DWORD;
FirstArraySlice: DWORD;
NumArraySlices: DWORD;
FirstPlane: DWORD;
NumPlanes: DWORD;
end;const D3D12_BARRIER_SUBRESOURCE_RANGE = extern struct {
IndexOrFirstMipLevel: u32,
NumMipLevels: u32,
FirstArraySlice: u32,
NumArraySlices: u32,
FirstPlane: u32,
NumPlanes: u32,
};type
D3D12_BARRIER_SUBRESOURCE_RANGE {.bycopy.} = object
IndexOrFirstMipLevel: uint32
NumMipLevels: uint32
FirstArraySlice: uint32
NumArraySlices: uint32
FirstPlane: uint32
NumPlanes: uint32struct D3D12_BARRIER_SUBRESOURCE_RANGE
{
uint IndexOrFirstMipLevel;
uint NumMipLevels;
uint FirstArraySlice;
uint NumArraySlices;
uint FirstPlane;
uint NumPlanes;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_BARRIER_SUBRESOURCE_RANGE サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; IndexOrFirstMipLevel : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; NumMipLevels : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; FirstArraySlice : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; NumArraySlices : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; FirstPlane : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; NumPlanes : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D12_BARRIER_SUBRESOURCE_RANGE
#field int IndexOrFirstMipLevel
#field int NumMipLevels
#field int FirstArraySlice
#field int NumArraySlices
#field int FirstPlane
#field int NumPlanes
#endstruct
stdim st, D3D12_BARRIER_SUBRESOURCE_RANGE ; NSTRUCT 変数を確保
st->IndexOrFirstMipLevel = 100
mes "IndexOrFirstMipLevel=" + st->IndexOrFirstMipLevel