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

D3D12_BARRIER_SUBRESOURCE_RANGE

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

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

フィールド

フィールドサイズx64x86説明
IndexOrFirstMipLevelDWORD4+0+0範囲内の最初のミップレベルのインデックス。NumMipLevels が 0 の場合は、サブリソースのインデックスです。サブリソースのインデックスの場合は、値 0xffffffff を使用してすべてのサブリソースを指定できます。
NumMipLevelsDWORD4+4+4範囲内のミップレベルの数。0 の場合は、IndexOrFirstMipLevel がサブリソースのインデックスであることを示します。
FirstArraySliceDWORD4+8+8範囲内の最初の配列スライスのインデックス。NumMipLevels が 0 の場合は無視されます。
NumArraySlicesDWORD4+12+12範囲内の配列スライスの数。NumMipLevels が 0 の場合は無視されます。
FirstPlaneDWORD4+16+16範囲内の最初のプレーンスライス。NumMipLevels が 0 の場合は無視されます。
NumPlanesDWORD4+20+20範囲内のプレーンスライスの数。NumMipLevels が 0 の場合は無視されます。

公式ドキュメント

論理的に隣接するサブリソースの範囲をまとめて遷移させることができます。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#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 Structure
import 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: uint32
struct 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