#![allow(
non_snake_case,
clippy::too_many_arguments,
clippy::missing_safety_doc,
dead_code
)]
use core::ffi::c_void;
pub unsafe trait Tools12Methods: Sized {
fn inner(&self) -> *mut c_void;
unsafe fn QueryInterface(
&self,
iid: *const windows::core::GUID,
out: *mut *mut c_void,
) -> windows::core::HRESULT;
unsafe fn AddRef(&self) -> u32;
unsafe fn Release(&self) -> u32;
unsafe fn EnableShaderInstrumentation(&self, a0: windows::core::BOOL) {
unsafe { real::EnableShaderInstrumentation(self.inner(), a0) }
}
unsafe fn ShaderInstrumentationEnabled(&self) -> windows::core::BOOL {
unsafe { real::ShaderInstrumentationEnabled(self.inner()) }
}
}
pub mod real {
use core::ffi::c_void;
pub unsafe fn EnableShaderInstrumentation(inner: *mut c_void, a0: windows::core::BOOL) {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12Tools_Vtbl)))
.EnableShaderInstrumentation)(inner, a0)
}
}
pub unsafe fn ShaderInstrumentationEnabled(inner: *mut c_void) -> windows::core::BOOL {
unsafe {
((*(*(inner as *const *const windows::Win32::Graphics::Direct3D12::ID3D12Tools_Vtbl)))
.ShaderInstrumentationEnabled)(inner)
}
}
}
unsafe extern "system" fn QueryInterface<T: Tools12Methods>(
this: *mut c_void,
iid: *const windows::core::GUID,
out: *mut *mut c_void,
) -> windows::core::HRESULT {
unsafe { (*(this as *const T)).QueryInterface(iid, out) }
}
unsafe extern "system" fn AddRef<T: Tools12Methods>(this: *mut c_void) -> u32 {
unsafe { (*(this as *const T)).AddRef() }
}
unsafe extern "system" fn Release<T: Tools12Methods>(this: *mut c_void) -> u32 {
unsafe { (*(this as *const T)).Release() }
}
unsafe extern "system" fn EnableShaderInstrumentation<T: Tools12Methods>(
this: *mut c_void,
a0: windows::core::BOOL,
) {
unsafe { (*(this as *const T)).EnableShaderInstrumentation(a0) }
}
unsafe extern "system" fn ShaderInstrumentationEnabled<T: Tools12Methods>(
this: *mut c_void,
) -> windows::core::BOOL {
unsafe { (*(this as *const T)).ShaderInstrumentationEnabled() }
}
#[allow(clippy::let_and_return)] unsafe impl Tools12Methods for crate::d3d12::Object {
fn inner(&self) -> *mut c_void {
self.real()
}
unsafe fn QueryInterface(
&self,
iid: *const windows::core::GUID,
out: *mut *mut c_void,
) -> windows::core::HRESULT {
unsafe { self.query(iid, out) }
}
unsafe fn AddRef(&self) -> u32 {
self.add_ref()
}
unsafe fn Release(&self) -> u32 {
unsafe { self.release() }
}
unsafe fn EnableShaderInstrumentation(&self, a0: windows::core::BOOL) {
unsafe {
real::EnableShaderInstrumentation(self.real(), a0);
}
}
unsafe fn ShaderInstrumentationEnabled(&self) -> windows::core::BOOL {
unsafe {
let result = real::ShaderInstrumentationEnabled(self.real());
result
}
}
}
pub const fn vtable<T: Tools12Methods>() -> windows::Win32::Graphics::Direct3D12::ID3D12Tools_Vtbl {
windows::Win32::Graphics::Direct3D12::ID3D12Tools_Vtbl {
base__: windows::core::IUnknown_Vtbl {
QueryInterface: QueryInterface::<T>,
AddRef: AddRef::<T>,
Release: Release::<T>,
},
EnableShaderInstrumentation: EnableShaderInstrumentation::<T>,
ShaderInstrumentationEnabled: ShaderInstrumentationEnabled::<T>,
}
}