/* * Copyright (C) 2021 Patrick Mours * SPDX-License-Identifier: BSD-3-Clause OR MIT */ #pragma once #include "reshade_api.hpp" namespace reshade { enum class addon_event : uint32_t { /// /// Called after successfull device creation, from: /// /// IDirect3D9::CreateDevice /// IDirect3D9Ex::CreateDeviceEx /// IDirect3DDevice9::Reset /// IDirect3DDevice9Ex::ResetEx /// D3D10CreateDevice /// D3D10CreateDevice1 /// D3D10CreateDeviceAndSwapChain /// D3D10CreateDeviceAndSwapChain1 /// D3D11CreateDevice /// D3D11CreateDeviceAndSwapChain /// D3D12CreateDevice /// glMakeCurrent /// vkCreateDevice /// /// Callback function signature: void (api::device *device) /// init_device, /// /// Called on device destruction, before: /// /// IDirect3DDevice9::Reset /// IDirect3DDevice9Ex::ResetEx /// IDirect3DDevice9::Release /// ID3D10Device::Release /// ID3D11Device::Release /// ID3D12Device::Release /// wglDeleteContext /// vkDestroyDevice /// /// Callback function signature: void (api::device *device) /// destroy_device, /// /// Called after successfull command list creation, from: /// /// ID3D11Device::CreateDeferredContext /// ID3D11Device1::CreateDeferredContext1 /// ID3D11Device2::CreateDeferredContext2 /// ID3D11Device3::CreateDeferredContext3 /// ID3D12Device::CreateCommandList /// ID3D12Device4::CreateCommandList1 /// vkAllocateCommandBuffers /// /// Callback function signature: void (api::command_list *cmd_list) /// /// /// In case of D3D9, D3D10, D3D11 and OpenGL this is called during device initialization as well and behaves as if an implicit immediate command list was created. /// init_command_list, /// /// Called on command list destruction, before: /// /// ID3D11CommandList::Release /// ID3D12CommandList::Release /// vkFreeCommandBuffers /// /// Callback function signature: void (api::command_list *cmd_list) /// destroy_command_list, /// /// Called after successfull command queue creation, from: /// /// ID3D12Device::CreateCommandQueue /// vkCreateDevice (for every queue associated with the device) /// /// Callback function signature: void (api::command_queue *queue) /// /// /// In case of D3D9, D3D10, D3D11 and OpenGL this is called during device initialization as well and behaves as if an implicit command queue was created. /// init_command_queue, /// /// Called on command queue destruction, before: /// /// ID3D12CommandQueue::Release /// vkDestroyDevice (for every queue associated with the device) /// /// Callback function signature: void (api::command_queue *queue) /// destroy_command_queue, /// /// Called after successfull swap chain creation, from: /// /// IDirect3D9::CreateDevice (for the implicit swap chain) /// IDirect3D9Ex::CreateDeviceEx (for the implicit swap chain) /// IDirect3D9Device::CreateAdditionalSwapChain /// IDirect3DDevice9::Reset (for the implicit swap chain) /// IDirect3DDevice9Ex::ResetEx (for the implicit swap chain) /// IDXGIFactory::CreateSwapChain /// IDXGIFactory2::CreateSwapChain(...) /// IDXGISwapChain::ResizeBuffers /// IDXGISwapChain3::ResizeBuffers1 /// wglMakeCurrent /// wglSwapBuffers (after window was resized) /// vkCreateSwapchainKHR /// /// Callback function signature: void (api::swapchain *swapchain) /// init_swapchain, /// /// Called on swap chain creation, before: /// /// IDirect3D9::CreateDevice (for the implicit swap chain) /// IDirect3D9Ex::CreateDeviceEx (for the implicit swap chain) /// IDirect3D9Device::CreateAdditionalSwapChain /// IDirect3D9Device::Reset (for the implicit swap chain) /// IDirect3D9DeviceEx::ResetEx (for the implicit swap chain) /// IDXGIFactory::CreateSwapChain /// IDXGIFactory2::CreateSwapChain(...) /// IDXGISwapChain::ResizeBuffers /// IDXGISwapChain3::ResizeBuffers1 /// wglSetPixelFormat /// vkCreateSwapchainKHR /// /// Callback function signature: bool (api::swapchain_desc &desc, void *hwnd) /// /// /// To overwrite the swap chain description, modify desc in the callback and return , otherwise return . /// create_swapchain, /// /// Called on swap chain destruction, before: /// /// IDirect3DDevice9::Release (for the implicit swap chain) /// IDirect3DSwapChain9::Release /// IDXGISwapChain::Release /// wglDeleteContext /// wglSwapBuffers (after window was resized) /// vkDestroySwapchainKHR /// /// In addition, called when swap chain is reset, before: /// /// IDirect3DDevice9::Reset (for the implicit swap chain) /// IDirect3DDevice9Ex::ResetEx (for the implicit swap chain) /// IDXGISwapChain::ResizeBuffers /// IDXGISwapChain1::ResizeBuffers1 /// /// Callback function signature: void (api::swapchain *swapchain) /// destroy_swapchain, /// /// Called after effect runtime initialization (which happens after swap chain creation or a swap chain buffer resize). /// Callback function signature: void (api::effect_runtime *runtime) /// init_effect_runtime, /// /// Called when an effect runtime is reset or destroyed. /// Callback function signature: void (api::effect_runtime *runtime) /// destroy_effect_runtime, /// /// Called after successfull sampler creation from: /// /// ID3D10Device::CreateSamplerState /// ID3D11Device::CreateSamplerState /// ID3D12Device::CreateSampler /// vkCreateSampler /// /// Callback function signature: void (api::device *device, const api::sampler_desc &desc, api::sampler sampler) /// /// /// Is not called in D3D9 (since samplers are loose state there) or OpenGL. /// init_sampler, /// /// Called on sampler creation, before: /// /// ID3D10Device::CreateSamplerState /// ID3D11Device::CreateSamplerState /// ID3D12Device::CreateSampler /// ID3D12Device::CreateRootSignature /// vkCreateSampler /// /// Callback function signature: bool (api::device *device, api::sampler_desc &desc) /// /// /// To overwrite the sampler description, modify desc in the callback and return , otherwise return . /// Is not called in D3D9 (since samplers are loose state there) or OpenGL. /// create_sampler, /// /// Called on sampler destruction, before: /// /// ID3D10SamplerState::Release /// ID3D11SamplerState::Release /// glDeleteSamplers /// vkDestroySampler /// /// Callback function signature: void (api::device *device, api::sampler sampler) /// /// /// Is not called in D3D9 (since samplers are loose state there), D3D12 (since samplers are descriptor handles instead of objects there) or OpenGL. /// destroy_sampler, /// /// Called after successfull resource creation from: /// /// IDirect3DDevice9::CreateVertexBuffer /// IDirect3DDevice9::CreateIndexBuffer /// IDirect3DDevice9::CreateTexture /// IDirect3DDevice9::CreateCubeTexture /// IDirect3DDevice9::CreateVolumeTexture /// IDirect3DDevice9::CreateRenderTargetSurface /// IDirect3DDevice9::CreateDepthStencilSurface /// IDirect3DDevice9::CreateOffscreenPlainSurface /// IDirect3DDevice9Ex::CreateRenderTargetSurfaceEx /// IDirect3DDevice9Ex::CreateDepthStencilSurfaceEx /// IDirect3DDevice9Ex::CreateOffscreenPlainSurfaceEx /// ID3D10Device::CreateBuffer /// ID3D10Device::CreateTexture1D /// ID3D10Device::CreateTexture2D /// ID3D10Device::CreateTexture2D /// ID3D11Device::CreateBuffer /// ID3D11Device::CreateTexture1D /// ID3D11Device::CreateTexture2D /// ID3D11Device::CreateTexture3D /// ID3D11Device3::CreateTexture2D /// ID3D11Device3::CreateTexture3D /// ID3D12Device::CreateCommittedResource /// ID3D12Device::CreatePlacedResource /// ID3D12Device::CreateReservedResource /// ID3D12Device4::CreateCommittedResource1 /// ID3D12Device4::CreateReservedResource1 /// glBufferData /// glBufferStorage /// glNamedBufferData /// glNamedBufferStorage /// glTexImage1D /// glTexImage2D /// glTexImage2DMultisample /// glTexImage3D /// glTexImage3DMultisample /// glCompressedTexImage1D /// glCompressedTexImage2D /// glCompressedTexImage3D /// glTexStorage1D /// glTexStorage2D /// glTexStorage2DMultisample /// glTexStorage3D /// glTexStorage3DMultisample /// glTextureStorage1D /// glTextureStorage2D /// glTextureStorage2DMultisample /// glTextureStorage3D /// glTextureStorage3DMultisample /// glRenderbufferStorage /// glRenderbufferStorageMultisample /// glNamedRenderbufferStorage /// glNamedRenderbufferStorageMultisample /// vkBindBufferMemory /// vkBindBufferMemory2 /// vkBindImageMemory /// vkBindImageMemory2 /// /// Callback function signature: void (api::device *device, const api::resource_desc &desc, const api::subresource_data *initial_data, api::resource_usage initial_state, api::resource resource) /// init_resource, /// /// Called on resource creation, before: /// /// IDirect3DDevice9::CreateVertexBuffer /// IDirect3DDevice9::CreateIndexBuffer /// IDirect3DDevice9::CreateTexture /// IDirect3DDevice9::CreateCubeTexture /// IDirect3DDevice9::CreateVolumeTexture /// IDirect3DDevice9::CreateRenderTargetSurface /// IDirect3DDevice9::CreateDepthStencilSurface /// IDirect3DDevice9::CreateOffscreenPlainSurface /// IDirect3DDevice9Ex::CreateRenderTargetSurfaceEx /// IDirect3DDevice9Ex::CreateDepthStencilSurfaceEx /// IDirect3DDevice9Ex::CreateOffscreenPlainSurfaceEx /// ID3D10Device::CreateBuffer /// ID3D10Device::CreateTexture1D /// ID3D10Device::CreateTexture2D /// ID3D10Device::CreateTexture2D /// ID3D11Device::CreateBuffer /// ID3D11Device::CreateTexture1D /// ID3D11Device::CreateTexture2D /// ID3D11Device::CreateTexture3D /// ID3D11Device3::CreateTexture2D /// ID3D11Device3::CreateTexture3D /// ID3D12Device::CreateCommittedResource /// ID3D12Device::CreatePlacedResource /// ID3D12Device::CreateReservedResource /// ID3D12Device4::CreateCommittedResource1 /// ID3D12Device4::CreateReservedResource1 /// glBufferData /// glBufferStorage /// glNamedBufferData /// glNamedBufferStorage /// glTexImage1D /// glTexImage2D /// glTexImage2DMultisample /// glTexImage3D /// glTexImage3DMultisample /// glCompressedTexImage1D /// glCompressedTexImage2D /// glCompressedTexImage3D /// glTexStorage1D /// glTexStorage2D /// glTexStorage2DMultisample /// glTexStorage3D /// glTexStorage3DMultisample /// glTextureStorage1D /// glTextureStorage2D /// glTextureStorage2DMultisample /// glTextureStorage3D /// glTextureStorage3DMultisample /// glRenderbufferStorage /// glRenderbufferStorageMultisample /// glNamedRenderbufferStorage /// glNamedRenderbufferStorageMultisample /// vkCreateBuffer /// vkCreateImage /// /// Callback function signature: bool (api::device *device, api::resource_desc &desc, api::subresource_data *initial_data, api::resource_usage initial_state) /// /// /// To overwrite the resource description, modify desc in the callback and return , otherwise return . /// create_resource, /// /// Called on resource destruction, before: /// /// IDirect3DResource9::Release /// ID3D10Resource::Release /// ID3D11Resource::Release /// ID3D12Resource::Release /// glDeleteBuffers /// glDeleteTextures /// glDeleteRenderbuffers /// vkDestroyBuffer /// vkDestroyImage /// /// Callback function signature: void (api::device *device, api::resource resource) /// destroy_resource, /// /// Called after successfull resource view creation from: /// /// IDirect3DDevice9::CreateTexture /// IDirect3DDevice9::CreateCubeTexture /// IDirect3DDevice9::CreateVolumeTexture /// ID3D10Device::CreateShaderResourceView /// ID3D10Device::CreateRenderTargetView /// ID3D10Device::CreateDepthStencilView /// ID3D10Device1::CreateShaderResourceView1 /// ID3D11Device::CreateShaderResourceView /// ID3D11Device::CreateUnorderedAccessView /// ID3D11Device::CreateRenderTargetView /// ID3D11Device::CreateDepthStencilView /// ID3D11Device3::CreateShaderResourceView1 /// ID3D11Device3::CreateUnorderedAccessView1 /// ID3D11Device3::CreateRenderTargetView1 /// ID3D12Device::CreateShaderResourceView /// ID3D12Device::CreateUnorderedAccessView /// ID3D12Device::CreateRenderTargetView /// ID3D12Device::CreateDepthStencilView /// glTexBuffer /// glTextureBuffer /// glTextureView /// vkCreateBufferView /// vkCreateImageView /// /// Callback function signature: void (api::device *device, api::resource resource, api::resource_usage usage_type, const api::resource_view_desc &desc, api::resource_view view) /// init_resource_view, /// /// Called on resource view creation, before: /// /// ID3D10Device::CreateShaderResourceView /// ID3D10Device::CreateRenderTargetView /// ID3D10Device::CreateDepthStencilView /// ID3D10Device1::CreateShaderResourceView1 /// ID3D11Device::CreateShaderResourceView /// ID3D11Device::CreateUnorderedAccessView /// ID3D11Device::CreateRenderTargetView /// ID3D11Device::CreateDepthStencilView /// ID3D11Device3::CreateShaderResourceView1 /// ID3D11Device3::CreateUnorderedAccessView1 /// ID3D11Device3::CreateRenderTargetView1 /// ID3D12Device::CreateShaderResourceView /// ID3D12Device::CreateUnorderedAccessView /// ID3D12Device::CreateRenderTargetView /// ID3D12Device::CreateDepthStencilView /// glTexBuffer /// glTextureBuffer /// glTextureView /// vkCreateBufferView /// vkCreateImageView /// /// Callback function signature: bool (api::device *device, api::resource resource, api::resource_usage usage_type, api::resource_view_desc &desc) /// /// /// To overwrite the resource view description, modify desc in the callback and return , otherwise return . /// Is not called in D3D9 (since resource views are tied to resources there). /// create_resource_view, /// /// Called on resource view destruction, before: /// /// IDirect3DResource9::Release /// ID3D10View::Release /// ID3D11View::Release /// glDeleteTextures /// vkDestroyBufferView /// vkDestroyImageView /// /// Callback function signature: void (api::device *device, api::resource_view view) /// /// /// Is not called in D3D12 (since resource views are descriptor handles instead of objects there). /// destroy_resource_view, /// /// Called after: /// /// IDirect3DVertexBuffer9::Lock /// IDirect3DIndexBuffer9::Lock /// ID3D10Resource::Map /// ID3D11DeviceContext::Map /// ID3D12Resource::Map /// glMapBuffer /// glMapBufferRange /// glMapNamedBuffer /// glMapNamedBufferRange /// /// Callback function signature: void (api::device *device, api::resource resource, uint64_t offset, uint64_t size, api::map_access access, void **data) /// map_buffer_region, /// /// Called before: /// /// IDirect3DVertexBuffer9::Unlock /// IDirect3DIndexBuffer9::Unlock /// ID3D10Resource::Unmap /// ID3D11DeviceContext::Unmap /// ID3D12Resource::Unmap /// glUnmapBuffer /// glUnmapNamedBuffer /// /// Callback function signature: void (api::device *device, api::resource resource) /// unmap_buffer_region, /// /// Called after: /// /// IDirect3DSurface9::LockRect /// IDirect3DVolume9::LockBox /// IDirect3DTexture9::LockRect /// IDirect3DVolumeTexture9::LockBox /// IDirect3DCubeTexture9::LockRect /// ID3D10Resource::Map /// ID3D11DeviceContext::Map /// ID3D12Resource::Map /// /// Callback function signature: void (api::device *device, api::resource resource, uint32_t subresource, const api::subresource_box *box, api::map_access access, api::subresource_data *data) /// map_texture_region, /// /// Called before: /// /// IDirect3DSurface9::UnlockRect /// IDirect3DVolume9::UnlockBox /// IDirect3DTexture9::UnlockRect /// IDirect3DVolumeTexture9::UnlockBox /// IDirect3DCubeTexture9::UnlockRect /// ID3D10Resource::Unmap /// ID3D11DeviceContext::Unmap /// ID3D12Resource::Unmap /// /// Callback function signature: void (api::device *device, api::resource resource, uint32_t subresource) /// unmap_texture_region, /// /// Called before: /// /// ID3D10Device::UpdateSubresource /// ID3D11DeviceContext::UpdateSubresource /// glBufferSubData /// glNamedBufferSubData /// /// Callback function signature: bool (api::device *device, const void *data, api::resource resource, uint64_t offset, uint64_t size) /// /// /// To prevent this command from being executed, return , otherwise return . /// Destination resource will be in the state. /// update_buffer_region, /// /// Called before: /// /// ID3D10Device::UpdateSubresource /// ID3D11DeviceContext::UpdateSubresource /// glTexSubData1D /// glTexSubData2D /// glTexSubData3D /// glTextureSubData1D /// glTextureSubData2D /// glTextureSubData3D /// glCompressedTexSubData1D /// glCompressedTexSubData2D /// glCompressedTexSubData3D /// glCompressedTextureSubData1D /// glCompressedTextureSubData2D /// glCompressedTextureSubData3D /// /// Callback function signature: bool (api::device *device, const api::subresource_data &data, api::resource resource, uint32_t subresource, const api::subresource_box *box) /// /// /// To prevent this command from being executed, return , otherwise return . /// Destination resource will be in the state. /// update_texture_region, /// /// Called after successfull pipeline creation from: /// /// IDirect3DDevice9::CreateVertexShader /// IDirect3DDevice9::CreatePixelShader /// IDirect3DDevice9::CreateVertexDeclaration /// ID3D10Device::CreateVertexShader /// ID3D10Device::CreateGeometryShader /// ID3D10Device::CreateGeometryShaderWithStreamOutput /// ID3D10Device::CreatePixelShader /// ID3D10Device::CreateInputLayout /// ID3D10Device::CreateBlendState /// ID3D10Device::CreateDepthStencilState /// ID3D10Device::CreateRasterizerState /// ID3D10Device1::CreateBlendState1 /// ID3D11Device::CreateVertexShader /// ID3D11Device::CreateHullShader /// ID3D11Device::CreateDomainShader /// ID3D11Device::CreateGeometryShader /// ID3D11Device::CreateGeometryShaderWithStreamOutput /// ID3D11Device::CreatePixelShader /// ID3D11Device::CreateComputeShader /// ID3D11Device::CreateInputLayout /// ID3D11Device::CreateBlendState /// ID3D11Device::CreateDepthStencilState /// ID3D11Device::CreateRasterizerState /// ID3D11Device1::CreateBlendState1 /// ID3D11Device1::CreateRasterizerState1 /// ID3D11Device3::CreateRasterizerState2 /// ID3D12Device::CreateComputePipelineState /// ID3D12Device::CreateGraphicsPipelineState /// ID3D12Device2::CreatePipelineState /// ID3D12PipelineLibrary::LoadComputePipeline /// ID3D12PipelineLibrary::LoadGraphicsPipeline /// ID3D12PipelineLibrary1::LoadPipeline /// glLinkProgram /// vkCreateComputePipelines /// vkCreateGraphicsPipelines /// /// Callback function signature: void (api::device *device, api::pipeline_layout layout, uint32_t subobject_count, const api::pipeline_subobject *subobjects, api::pipeline pipeline) /// /// /// May be called multiple times with the same pipeline handle (whenever the pipeline is updated or its reference count is incremented). /// init_pipeline, /// /// Called on pipeline creation, before: /// /// IDirect3DDevice9::CreateVertexShader /// IDirect3DDevice9::CreatePixelShader /// IDirect3DDevice9::CreateVertexDeclaration /// ID3D10Device::CreateVertexShader /// ID3D10Device::CreateGeometryShader /// ID3D10Device::CreateGeometryShaderWithStreamOutput /// ID3D10Device::CreatePixelShader /// ID3D10Device::CreateInputLayout /// ID3D10Device::CreateBlendState /// ID3D10Device::CreateDepthStencilState /// ID3D10Device::CreateRasterizerState /// ID3D10Device1::CreateBlendState1 /// ID3D11Device::CreateVertexShader /// ID3D11Device::CreateHullShader /// ID3D11Device::CreateDomainShader /// ID3D11Device::CreateGeometryShader /// ID3D11Device::CreateGeometryShaderWithStreamOutput /// ID3D11Device::CreatePixelShader /// ID3D11Device::CreateComputeShader /// ID3D11Device::CreateInputLayout /// ID3D11Device::CreateBlendState /// ID3D11Device::CreateDepthStencilState /// ID3D11Device::CreateRasterizerState /// ID3D11Device1::CreateBlendState1 /// ID3D11Device1::CreateRasterizerState1 /// ID3D11Device3::CreateRasterizerState2 /// ID3D12Device::CreateComputePipelineState /// ID3D12Device::CreateGraphicsPipelineState /// ID3D12Device2::CreatePipelineState /// glShaderSource /// vkCreateComputePipelines /// vkCreateGraphicsPipelines /// /// Callback function signature: bool (api::device *device, api::pipeline_layout layout, uint32_t subobject_count, const api::pipeline_subobject *subobjects) /// /// /// To overwrite the pipeline description, modify desc in the callback and return , otherwise return . /// create_pipeline, /// /// Called on pipeline destruction, before: /// /// ID3D10VertexShader::Release /// ID3D10GeometryShader::Release /// ID3D10PixelShader::Release /// ID3D10InputLayout::Release /// ID3D10BlendState::Release /// ID3D10DepthStencilState::Release /// ID3D10RasterizerState::Release /// ID3D11VertexShader::Release /// ID3D11HullShader::Release /// ID3D11DomainShader::Release /// ID3D11GeometryShader::Release /// ID3D11PixelShader::Release /// ID3D11ComputeShader::Release /// ID3D11InputLayout::Release /// ID3D11BlendState::Release /// ID3D11DepthStencilState::Release /// ID3D11RasterizerState::Release /// ID3D12PipelineState::Release /// glDeleteProgram /// vkDestroyPipeline /// /// Callback function signature: void (api::device *device, api::pipeline pipeline) /// /// /// Is not called in D3D9. /// destroy_pipeline, /// /// Called after successfull pipeline layout creation from: /// /// ID3D12Device::CreateRootSignature /// vkCreatePipelineLayout /// /// Callback function signature: void (api::device *device, uint32_t param_count, const api::pipeline_layout_param *params, api::pipeline_layout layout) /// init_pipeline_layout, /// /// Called on pipeline layout creation. /// Callback function signature: bool (api::device *device, uint32_t param_count, const api::pipeline_layout_param *params) /// create_pipeline_layout, /// /// Called on pipeline layout destruction, before: /// /// ID3D12RootSignature::Release /// VkDestroyPipelineLayout /// /// Callback function signature: void (api::device *device, api::pipeline_layout layout) /// destroy_pipeline_layout, /// /// Called before: /// /// ID3D12Device::CopyDescriptors /// ID3D12Device::CopyDescriptorsSimple /// vkUpdateDescriptorSets /// /// Callback function signature: bool (api::device *device, uint32_t count, const api::descriptor_table_copy *copies) /// /// /// To prevent this command from being executed, return , otherwise return . /// copy_descriptor_tables, /// /// Called before: /// /// ID3D12Device::CreateConstantBufferView /// ID3D12Device::CreateShaderResourceView /// ID3D12Device::CreateUnorderedAccessView /// ID3D12Device::CreateSampler /// vkUpdateDescriptorSets /// /// Callback function signature: bool (api::device *device, uint32_t count, const api::descriptor_table_update *updates) /// /// /// To prevent this command from being executed, return , otherwise return . /// update_descriptor_tables, /// /// Called after successfull query heap creation from: /// /// ID3D12Device::CreateQueryHeap /// vkCreateQueryPool /// /// Callback function signature: void (api::device *device, api::query_type type, uint32_t size, api::query_heap heap) /// init_query_heap, /// /// Called on query heap creation, before: /// /// ID3D12Device::CreateQueryHeap /// vkCreateQueryPool /// /// Callback function signature: bool (api::device *device, api::query_type type, uint32_t &size) /// create_query_heap, /// /// Called on query heap destruction, before: /// /// ID3D12QueryHeap::Release /// vkDestroyQueryPool /// /// Callback function signature: void (api::device *device, api::query_heap heap) /// destroy_query_heap, /// /// Called before: /// /// vkGetQueryPoolResults /// /// Callback function signature: bool (api::device *device, api::query_heap heap, uint32_t first, uint32_t count, void *results, uint32_t stride) /// get_query_heap_results, /// /// Called after: /// /// ID3D12GraphicsCommandList::ResourceBarrier /// ID3D12GraphicsCommandList7::Barrier /// vkCmdPipelineBarrier /// vkCmdPipelineBarrier2 /// /// Callback function signature: void (api::command_list *cmd_list, uint32_t count, const api::resource *resources, const api::resource_usage *old_states, const api::resource_usage *new_states) /// barrier, /// /// Called before: /// /// ID3D12GraphicsCommandList4::BeginRenderPass /// vkCmdBeginRenderPass /// vkCmdBeginRenderPass2 /// vkCmdNextSubpass /// vkCmdNextSubpass2 /// vkCmdBeginRendering /// /// Callback function signature: void (api::command_list *cmd_list, uint32_t count, const api::render_pass_render_target_desc *rts, const api::render_pass_depth_stencil_desc *ds) /// /// /// The depth-stencil description argument is optional and may be . /// begin_render_pass, /// /// Called before: /// /// ID3D12GraphicsCommandList4::EndRenderPass /// vkCmdEndRenderPass /// vkCmdEndRenderPass2 /// vkCmdNextSubpass /// vkCmdNextSubpass2 /// vkCmdEndRendering /// /// Callback function signature: void (api::command_list *cmd_list) /// end_render_pass, /// /// Called after: /// /// IDirect3DDevice9::SetRenderTarget /// IDirect3DDevice9::SetDepthStencilSurface /// ID3D10Device::OMSetRenderTargets /// ID3D11DeviceContext::OMSetRenderTargets /// ID3D11DeviceContext::OMSetRenderTargetsAndUnorderedAccessViews /// ID3D12GraphicsCommandList::OMSetRenderTargets /// glBindFramebuffer /// /// Callback function signature: void (api::command_list *cmd_list, uint32_t count, const api::resource_view *rtvs, api::resource_view dsv) /// bind_render_targets_and_depth_stencil, /// /// Called after: /// /// IDirect3DDevice9::SetVertexShader /// IDirect3DDevice9::SetPixelShader /// IDirect3DDevice9::SetVertexDeclaration /// IDirect3DDevice9::ProcessVertices /// ID3D10Device::VSSetShader /// ID3D10Device::GSSetShader /// ID3D10Device::PSSetShader /// ID3D10Device::IASetInputLayout /// ID3D10Device::OMSetBlendState /// ID3D10Device::OMSetDepthStencilState /// ID3D10Device::RSSetState /// ID3D11DeviceContext::VSSetShader /// ID3D11DeviceContext::HSSetShader /// ID3D11DeviceContext::DSSetShader /// ID3D11DeviceContext::GSSetShader /// ID3D11DeviceContext::PSSetShader /// ID3D11DeviceContext::CSSetShader /// ID3D11DeviceContext::IASetInputLayout /// ID3D11DeviceContext::OMSetBlendState /// ID3D11DeviceContext::OMSetDepthStencilState /// ID3D11DeviceContext::RSSetState /// ID3D12GraphicsCommandList::Reset /// ID3D12GraphicsCommandList::SetPipelineState /// glUseProgram /// vkCmdBindPipeline /// /// Callback function signature: void (api::command_list *cmd_list, api::pipeline_stage stages, api::pipeline pipeline) /// bind_pipeline, /// /// Called after: /// /// IDirect3DDevice9::SetRenderState /// ID3D10Device::IASetPrimitiveTopology /// ID3D10Device::OMSetBlendState /// ID3D10Device::OMSetDepthStencilState /// ID3D11DeviceContext::IASetPrimitiveTopology /// ID3D11DeviceContext::OMSetBlendState /// ID3D11DeviceContext::OMSetDepthStencilState /// ID3D12GraphicsCommandList::IASetPrimitiveTopology /// ID3D12GraphicsCommandList::OMSetBlendFactor /// ID3D12GraphicsCommandList::OMSetStencilRef /// gl(...) /// vkCmdSetDepthBias /// vkCmdSetBlendConstants /// vkCmdSetStencilCompareMask /// vkCmdSetStencilWriteMask /// vkCmdSetStencilReference /// /// Callback function signature: void (api::command_list *cmd_list, uint32_t count, const api::dynamic_state *states, const uint32_t *values) /// bind_pipeline_states, /// /// Called after: /// /// IDirect3DDevice9::SetViewport /// IDirect3DDevice9::SetRenderTarget (implicitly updates the viewport) /// ID3D10Device::RSSetViewports /// ID3D11DeviceContext::RSSetViewports /// ID3D12GraphicsCommandList::RSSetViewports /// glViewport /// glViewportArrayv /// glViewportIndexedf /// glViewportIndexedfv /// vkCmdSetViewport /// /// Callback function signature: void (api::command_list *cmd_list, uint32_t first, uint32_t count, const api::viewport *viewports) /// bind_viewports, /// /// Called after: /// /// IDirect3DDevice9::SetScissorRect /// ID3D10Device::RSSetScissorRects /// ID3D11DeviceContext::RSSetScissorRects /// ID3D12GraphicsCommandList::RSSetScissorRects /// glScissor /// glScissorArrayv /// glScissorIndexed /// glScissorIndexedv /// vkCmdSetScissor /// /// Callback function signature: void (api::command_list *cmd_list, uint32_t first, uint32_t count, const api::rect *rects) /// bind_scissor_rects, /// /// Called after: /// /// IDirect3DDevice9::SetVertexShaderConstantF /// IDirect3DDevice9::SetPixelShaderConstantF /// ID3D12GraphicsCommandList::SetComputeRoot32BitConstant /// ID3D12GraphicsCommandList::SetComputeRoot32BitConstants /// ID3D12GraphicsCommandList::SetGraphicsRoot32BitConstant /// ID3D12GraphicsCommandList::SetGraphicsRoot32BitConstants /// glUniform(...) /// vkCmdPushConstants /// /// Callback function signature: void (api::command_list *cmd_list, api::shader_stage stages, api::pipeline_layout layout, uint32_t layout_param, uint32_t first, uint32_t count, const void *values) /// push_constants, /// /// Called after: /// /// IDirect3DDevice9::SetTexture /// ID3D10Device::VSSetSamplers /// ID3D10Device::VSSetShaderResources /// ID3D10Device::VSSetConstantBuffers /// ID3D10Device::GSSetSamplers /// ID3D10Device::GSSetShaderResources /// ID3D10Device::GSSetConstantBuffers /// ID3D10Device::PSSetSamplers /// ID3D10Device::PSSetShaderResources /// ID3D10Device::PSSetConstantBuffers /// ID3D11DeviceContext::VSSetSamplers /// ID3D11DeviceContext::VSSetShaderResources /// ID3D11DeviceContext::VSSetConstantBuffers /// ID3D11DeviceContext::HSSetSamplers /// ID3D11DeviceContext::HSSetShaderResources /// ID3D11DeviceContext::HSSetConstantBuffers /// ID3D11DeviceContext::DSSetSamplers /// ID3D11DeviceContext::DSSetShaderResources /// ID3D11DeviceContext::DSSetConstantBuffers /// ID3D11DeviceContext::GSSetSamplers /// ID3D11DeviceContext::GSSetShaderResources /// ID3D11DeviceContext::GSSetConstantBuffers /// ID3D11DeviceContext::PSSetSamplers /// ID3D11DeviceContext::PSSetShaderResources /// ID3D11DeviceContext::PSSetConstantBuffers /// ID3D11DeviceContext::CSSetSamplers /// ID3D11DeviceContext::CSSetShaderResources /// ID3D11DeviceContext::CSSetUnorderedAccessViews /// ID3D11DeviceContext::CSSetConstantBuffers /// ID3D12GraphicsCommandList::SetComputeRootConstantBufferView /// ID3D12GraphicsCommandList::SetGraphicsRootConstantBufferView /// ID3D12GraphicsCommandList::SetComputeRootShaderResourceView /// ID3D12GraphicsCommandList::SetGraphicsRootShaderResourceView /// ID3D12GraphicsCommandList::SetComputeRootUnorderedAccessView /// ID3D12GraphicsCommandList::SetGraphicsRootUnorderedAccessView /// glBindBufferBase /// glBindBufferRange /// glBindBuffersBase /// glBindBuffersRange /// glBindTexture /// glBindImageTexture /// glBindTextures /// glBindImageTextures /// glBindTextureUnit /// glBindMultiTextureEXT /// vkCmdPushDescriptorSetKHR /// /// Callback function signature: void (api::command_list *cmd_list, api::shader_stage stages, api::pipeline_layout layout, uint32_t layout_param, const api::descriptor_table_update &update) /// push_descriptors, /// /// Called after: /// /// ID3D12GraphicsCommandList::SetComputeRootSignature /// ID3D12GraphicsCommandList::SetGraphicsRootSignature /// ID3D12GraphicsCommandList::SetComputeRootDescriptorTable /// ID3D12GraphicsCommandList::SetGraphicsRootDescriptorTable /// vkCmdBindDescriptorSets /// /// Callback function signature: void (api::command_list *cmd_list, api::shader_stage stages, api::pipeline_layout layout, uint32_t first, uint32_t count, const api::descriptor_table *tables) /// bind_descriptor_tables, /// /// Called after: /// /// IDirect3DDevice9::SetIndices /// ID3D10Device::IASetIndexBuffer /// ID3D11DeviceContext::IASetIndexBuffer /// ID3D12GraphicsCommandList::IASetIndexBuffer /// glBindBuffer /// vkCmdBindIndexBuffer /// /// Callback function signature: void (api::command_list *cmd_list, api::resource buffer, uint64_t offset, uint32_t index_size) /// bind_index_buffer, /// /// Called after: /// /// IDirect3DDevice9::SetStreamSource /// ID3D10Device::IASetVertexBuffers /// ID3D11DeviceContext::IASetVertexBuffers /// ID3D12GraphicsCommandList::IASetVertexBuffers /// glBindBuffer /// glBindVertexBuffer /// glBindVertexBuffers /// vkCmdBindVertexBuffers /// vkCmdBindVertexBuffers2 /// /// Callback function signature: void (api::command_list *cmd_list, uint32_t first, uint32_t count, const api::resource *buffers, const uint64_t *offsets, const uint32_t *strides) /// /// /// The strides argument is optional and may be . /// bind_vertex_buffers, /// /// Called after: /// /// IDirect3DDevice9::ProcessVertices /// ID3D10Device::SOSetTargets /// ID3D11DeviceContext::SOSetTargets /// ID3D12GraphicsCommandList::SOSetTargets /// glBindBufferBase /// glBindBufferRange /// glBindBuffersBase /// glBindBuffersRange /// vkCmdBindTransformFeedbackBuffersEXT /// /// Callback function signature: void (api::command_list *cmd_list, uint32_t first, uint32_t count, const api::resource *buffers, const uint64_t *offsets, const uint64_t *max_sizes, const api::resource *counter_buffers, const uint64_t *counter_offsets) /// /// /// The counter arguments are optional and may be . /// bind_stream_output_buffers, /// /// Called before: /// /// IDirect3DDevice9::DrawPrimitive /// IDirect3DDevice9::DrawPrimitiveUP /// IDirect3DDevice9::ProcessVertices /// ID3D10Device::Draw /// ID3D10Device::DrawInstanced /// ID3D11DeviceContext::Draw /// ID3D11DeviceContext::DrawInstanced /// ID3D12GraphicsCommandList::DrawInstanced /// glDrawArrays /// glDrawArraysInstanced /// glDrawArraysInstancedBaseInstance /// glMultiDrawArrays /// vkCmdDraw /// /// Callback function signature: bool (api::command_list *cmd_list, uint32_t vertex_count, uint32_t instance_count, uint32_t first_vertex, uint32_t first_instance) /// /// /// To prevent this command from being executed, return , otherwise return . /// draw, /// /// Called before: /// /// IDirect3DDevice9::DrawIndexedPrimitive /// IDirect3DDevice9::DrawIndexedPrimitiveUP /// ID3D10Device::DrawIndexed /// ID3D10Device::DrawIndexedInstanced /// ID3D11DeviceContext::DrawIndexed /// ID3D11DeviceContext::DrawIndexedInstanced /// ID3D12GraphicsCommandList::DrawIndexedInstanced /// glDrawElements /// glDrawElementsBaseVertex /// glDrawElementsInstanced /// glDrawElementsInstancedBaseVertex /// glDrawElementsInstancedBaseInstance /// glDrawElementsInstancedBaseVertexBaseInstance /// glMultiDrawElements /// glMultiDrawElementsBaseVertex /// vkCmdDrawIndexed /// /// Callback function signature: bool (api::command_list *cmd_list, uint32_t index_count, uint32_t instance_count, uint32_t first_index, int32_t vertex_offset, uint32_t first_instance) /// /// /// To prevent this command from being executed, return , otherwise return . /// draw_indexed, /// /// Called before: /// /// ID3D11DeviceContext::Dispatch /// ID3D12GraphicsCommandList::Dispatch /// glDispatchCompute /// vkCmdDispatch /// /// Callback function signature: bool (api::command_list *cmd_list, uint32_t group_count_x, uint32_t group_count_y, uint32_t group_count_z) /// /// /// To prevent this command from being executed, return , otherwise return . /// dispatch, /// /// Called before: /// /// ID3D11DeviceContext::DrawInstancedIndirect /// ID3D11DeviceContext::DrawIndexedInstancedIndirect /// ID3D11DeviceContext::DispatchIndirect /// ID3D12GraphicsCommandList::ExecuteIndirect /// glDrawArraysIndirect /// glDrawElementsIndirect /// glMultiDrawArraysIndirect /// glMultiDrawElementsIndirect /// glDispatchComputeIndirect /// vkCmdDrawIndirect /// vkCmdDrawIndexedIndirect /// vkCmdDispatchIndirect /// /// Callback function signature: bool (api::command_list *cmd_list, api::indirect_command type, api::resource buffer, uint64_t offset, uint32_t draw_count, uint32_t stride) /// /// /// To prevent this command from being executed, return , otherwise return . /// draw_or_dispatch_indirect, /// /// Called before: /// /// IDirect3DDevice9::UpdateTexture /// IDirect3DDevice9::GetRenderTargetData /// ID3D10Device::CopyResource /// ID3D11DeviceContext::CopyResource /// ID3D12GraphicsCommandList::CopyResource /// /// Callback function signature: bool (api::command_list *cmd_list, api::resource source, api::resource dest) /// /// /// To prevent this command from being executed, return , otherwise return . /// Source resource will be in the state. /// Destination resource will be in the state. /// copy_resource, /// /// Called before: /// /// ID3D12GraphicsCommandList::CopyBufferRegion /// glCopyBufferSubData /// glCopyNamedBufferSubData /// vkCmdCopyBuffer /// vkCmdCopyBuffer2 /// /// Callback function signature: bool (api::command_list *cmd_list, api::resource source, uint64_t source_offset, api::resource dest, uint64_t dest_offset, uint64_t size) /// /// /// To prevent this command from being executed, return , otherwise return . /// Source resource will be in the state. /// Destination resource will be in the state. /// copy_buffer_region, /// /// Called before: /// /// ID3D12GraphicsCommandList::CopyTextureRegion /// vkCmdCopyBufferToImage /// vkCmdCopyBufferToImage2 /// /// Callback function signature: bool (api::command_list *cmd_list, api::resource source, uint64_t source_offset, uint32_t row_length, uint32_t slice_height, api::resource dest, uint32_t dest_subresource, const api::subresource_box *dest_box) /// /// /// To prevent this command from being executed, return , otherwise return . /// Source resource will be in the state. /// Destination resource will be in the state. /// The subresource box argument is optional and may be . /// copy_buffer_to_texture, /// /// Called before: /// /// IDirect3DDevice9::UpdateSurface /// IDirect3DDevice9::StretchRect /// ID3D10Device::CopySubresourceRegion /// ID3D11DeviceContext::CopySubresourceRegion /// ID3D12GraphicsCommandList::CopyTextureRegion /// glBlitFramebuffer /// glBlitNamedFramebuffer /// glCopyImageSubData /// glCopyTexSubImage1D /// glCopyTexSubImage2D /// glCopyTexSubImage3D /// glCopyTextureSubImage1D /// glCopyTextureSubImage2D /// glCopyTextureSubImage3D /// vkCmdBlitImage /// vkCmdBlitImage2 /// vkCmdCopyImage /// vkCmdCopyImage2 /// /// Callback function signature: bool (api::command_list *cmd_list, api::resource source, uint32_t source_subresource, const api::subresource_box *source_box, api::resource dest, uint32_t dest_subresource, const api::subresource_box *dest_box, api::filter_mode filter) /// /// /// To prevent this command from being executed, return , otherwise return . /// Source resource will be in the state. /// Destination resource will be in the state. /// The subresource box arguments are optional and may be . /// copy_texture_region, /// /// Called before: /// /// ID3D12GraphicsCommandList::CopyTextureRegion /// vkCmdCopyImageToBuffer /// vkCmdCopyImageToBuffer2 /// /// Callback function signature: bool (api::command_list *cmd_list, api::resource source, uint32_t source_subresource, const api::subresource_box *source_box, api::resource dest, uint64_t dest_offset, uint32_t row_length, uint32_t slice_height) /// /// /// To prevent this command from being executed, return , otherwise return . /// Source resource will be in the state. /// Destination resource will be in the state. /// The subresource box argument is optional and may be . /// copy_texture_to_buffer, /// /// Called before: /// /// IDirect3DDevice9::StretchRect /// ID3D10Device::ResolveSubresource /// ID3D11DeviceContext::ResolveSubresource /// ID3D12GraphicsCommandList::ResolveSubresource /// ID3D12GraphicsCommandList1::ResolveSubresourceRegion /// glBlitFramebuffer /// glBlitNamedFramebuffer /// vkCmdResolveImage /// vkCmdResolveImage2 /// /// Callback function signature: bool (api::command_list *cmd_list, api::resource source, uint32_t source_subresource, const api::subresource_box *source_box, api::resource dest, uint32_t dest_subresource, int32_t dest_x, int32_t dest_y, int32_t dest_z, api::format format) /// /// /// To prevent this command from being executed, return , otherwise return . /// Source resource will be in the state. /// Destination resource will be in the state. /// The subresource box argument is optional and may be . /// resolve_texture_region, /// /// Called before: /// /// IDirect3DDevice9::Clear /// ID3D10Device::ClearDepthStencilView /// ID3D11DeviceContext::ClearDepthStencilView /// ID3D11DeviceContext1::ClearView (for depth-stencil views) /// ID3D12GraphicsCommandList::ClearDepthStencilView /// glClear /// glClearBufferfi /// glClearBufferfv /// glClearNamedFramebufferfi /// glClearNamedFramebufferfv /// vkCmdClearDepthStencilImage /// vkCmdClearAttachments /// /// Callback function signature: bool (api::command_list *cmd_list, api::resource_view dsv, const float *depth, const uint8_t *stencil, uint32_t rect_count, const api::rect *rects) /// /// /// To prevent this command from being executed, return , otherwise return . /// Resource will be in the state. /// One of the depth or stencil clear value arguments may be when the respective component is not cleared. /// clear_depth_stencil_view, /// /// Called before: /// /// IDirect3DDevice9::Clear /// IDirect3DDevice9::ColorFill /// ID3D10Device::ClearRenderTargetView /// ID3D11DeviceContext::ClearRenderTargetView /// ID3D11DeviceContext1::ClearView (for render target views) /// ID3D12GraphicsCommandList::ClearRenderTargetView /// glClear /// glClearBufferfv /// glClearNamedFramebufferfv /// vkCmdClearColorImage /// vkCmdClearAttachments /// /// Callback function signature: bool (api::command_list *cmd_list, api::resource_view rtv, const float color[4], uint32_t rect_count, const api::rect *rects) /// /// /// To prevent this command from being executed, return , otherwise return . /// Resources will be in the state. /// clear_render_target_view, /// /// Called before: /// /// ID3D11DeviceContext::ClearUnorderedAccessViewUint /// ID3D12GraphicsCommandList::ClearUnorderedAccessViewUint /// /// Callback function signature: bool (api::command_list *cmd_list, api::resource_view uav, const uint32_t values[4], uint32_t rect_count, const api::rect *rects) /// /// /// To prevent this command from being executed, return , otherwise return . /// Resource will be in the state. /// clear_unordered_access_view_uint, /// /// Called before: /// /// ID3D11DeviceContext::ClearUnorderedAccessViewFloat /// ID3D11DeviceContext1::ClearView (for unordered access views) /// ID3D12GraphicsCommandList::ClearUnorderedAccessViewFloat /// /// Callback function signature: bool (api::command_list *cmd_list, api::resource_view uav, const float values[4], uint32_t rect_count, const api::rect *rects) /// /// /// To prevent this command from being executed, return , otherwise return . /// Resource will be in the state. /// clear_unordered_access_view_float, /// /// Called before: /// /// ID3D10Device::GenerateMips /// ID3D11DeviceContext::GenerateMips /// glGenerateMipmap /// glGenerateTextureMipmap /// /// Callback function signature: bool (api::command_list *cmd_list, api::resource_view srv) /// /// /// To prevent this command from being executed, return , otherwise return . /// generate_mipmaps, /// /// Called before: /// /// ID3D12GraphicsCommandList::BeginQuery /// vkCmdBeginQuery /// vkCmdBeginQueryIndexedEXT /// /// Callback function signature: bool (api::command_list *cmd_list, api::query_heap heap, api::query_type type, uint32_t index) /// /// /// To prevent this command from being executed, return , otherwise return . /// begin_query, /// /// Called before: /// /// ID3D12GraphicsCommandList::EndQuery /// vkCmdEndQuery /// vkCmdEndQueryIndexedEXT /// vkCmdWriteTimestamp /// vkCmdWriteTimestamp2 /// /// Callback function signature: bool (api::command_list *cmd_list, api::query_heap heap, api::query_type type, uint32_t index) /// /// /// To prevent this command from being executed, return , otherwise return . /// end_query, /// /// Called before: /// /// ID3D12GraphicsCommandList::ResolveQueryData /// vkCmdCopyQueryPoolResults /// /// Callback function signature: bool (api::command_list *cmd_list, api::query_heap heap, api::query_type type, uint32_t first, uint32_t count, api::resource dest, uint64_t dest_offset, uint32_t stride) /// /// /// To prevent this command from being executed, return , otherwise return . /// copy_query_heap_results, /// /// Called before: /// /// ID3D12GraphicsCommandList::Reset /// vkBeginCommandBuffer /// /// Callback function signature: void (api::command_list *cmd_list) /// /// /// Is not called for immediate command lists (since they cannot be reset). /// reset_command_list, /// /// Called before: /// /// ID3D11DeviceContext::FinishCommandList /// ID3D12GraphicsCommandList::Close /// vkEndCommandBuffer /// /// Callback function signature: void (api::command_list *cmd_list) /// /// /// Is not called for immediate command lists (since they cannot be closed). /// close_command_list, /// /// Called when a command list is submitted to a command queue (or an immediate command list is flushed), before: /// /// IDirect3DDevice9::EndScene /// ID3D10Device::Flush /// ID3D11DeviceContext::Flush /// ID3D11DeviceContext3::Flush1 /// ID3D12CommandQueue::ExecuteCommandLists /// glFlush /// vkQueueSubmit /// /// Callback function signature: void (api::command_queue *queue, api::command_list *cmd_list) /// execute_command_list, /// /// Called when a secondary command list is executed on a primary command list, before: /// /// ID3D11DeviceContext::ExecuteCommandList /// ID3D12GraphicsCommandList::ExecuteBundle /// vkCmdExecuteCommands /// /// In addition, called after: /// /// ID3D11DeviceContext::FinishCommandList /// /// Callback function signature: void (api::command_list *cmd_list, api::command_list *secondary_cmd_list) /// execute_secondary_command_list, /// /// Called before: /// /// IDirect3DDevice9::Present /// IDirect3DDevice9Ex::PresentEx /// IDirect3DSwapChain9::Present /// IDXGISwapChain::Present /// IDXGISwapChain3::Present1 /// ID3D12CommandQueueDownlevel::Present /// wglSwapBuffers /// vkQueuePresentKHR /// IVRCompositor::Submit /// /// Callback function signature: void (api::command_queue *queue, api::swapchain *swapchain, const api::rect *source_rect, const api::rect *dest_rect, uint32_t dirty_rect_count, const api::rect *dirty_rects) /// /// /// The source and destination rectangle arguments are optional and may be . /// present, /// /// Called after ReShade has rendered its overlay. /// Callback function signature: void (api::effect_runtime *runtime) /// reshade_present, /// /// Called right before ReShade effects are rendered. /// Callback function signature: void (api::effect_runtime *runtime, api::command_list *cmd_list, api::resource_view rtv, api::resource_view rtv_srgb) /// reshade_begin_effects, /// /// Called right after ReShade effects were rendered. /// Callback function signature: void (api::effect_runtime *runtime, api::command_list *cmd_list, api::resource_view rtv, api::resource_view rtv_srgb) /// reshade_finish_effects, /// /// Called right after all ReShade effects were reloaded. /// This occurs during effect runtime initialization or because the user pressed the "Reload" button in the overlay. /// Callback function signature: void (api::effect_runtime *runtime) /// reshade_reloaded_effects, /// /// Called before a uniform variable is changed. /// Callback function signature: bool (api::effect_runtime *runtime, api::effect_uniform_variable variable, const void *data, size_t size) /// /// /// To prevent the variable from being changed, return , otherwise return . /// reshade_set_uniform_value, /// /// Called before a technique is enabled or disabled. /// Callback function signature: bool (api::effect_runtime *runtime, api::effect_technique technique, bool enabled) /// /// /// To prevent the technique from being changed, return , otherwise return . /// reshade_set_technique_state, /// /// Called between the ImGui::NewFrame and ImGui::EndFrame calls for the ReShade overlay. /// Can be used to perform custom Dear ImGui calls, but it is recommended to instead use to register a dedicated overlay. /// Callback function signature: void (api::effect_runtime *runtime) /// /// /// This is not called for effect runtimes in VR. /// reshade_overlay, /// /// Called after a screenshot was taken and saved to disk. /// Callback function signature: void (api::effect_runtime *runtime, const char *path) /// reshade_screenshot, /// /// Called for each technique after it was rendered, usually between and . /// Callback function signature: void (api::effect_runtime *runtime, api::effect_technique technique, api::command_list *cmd_list, api::resource_view rtv, api::resource_view rtv_srgb) /// reshade_render_technique, /// /// Called after a preset was loaded and applied. /// This occurs during reloading or when the user chooses a new preset in the overlay. /// Callback function signature: void (api::effect_runtime *runtime, const char *path) /// reshade_set_current_preset_path, /// /// Called when the rendering order of loaded techniques is changed. /// Callback function signature: bool (api::effect_runtime *runtime, size_t count, api::effect_technique *techniques) /// /// /// To prevent the order from being changed, return , otherwise return . /// reshade_reorder_techniques, #if RESHADE_ADDON max // Last value used internally by ReShade to determine number of events in this enum #endif }; template struct addon_event_traits; #define RESHADE_DEFINE_ADDON_EVENT_TRAITS(ev, ret, ...) \ template <> \ struct addon_event_traits { \ using decl = ret(*)(__VA_ARGS__); \ using type = ret; \ } RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::init_device, void, api::device *device); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::destroy_device, void, api::device *device); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::init_command_list, void, api::command_list *cmd_list); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::destroy_command_list, void, api::command_list *cmd_list); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::init_command_queue, void, api::command_queue *queue); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::destroy_command_queue, void, api::command_queue *queue); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::init_swapchain, void, api::swapchain *swapchain); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::create_swapchain, bool, api::swapchain_desc &desc, void *hwnd); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::destroy_swapchain, void, api::swapchain *swapchain); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::init_effect_runtime, void, api::effect_runtime *runtime); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::destroy_effect_runtime, void, api::effect_runtime *runtime); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::init_sampler, void, api::device *device, const api::sampler_desc &desc, api::sampler sampler); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::create_sampler, bool, api::device *device, api::sampler_desc &desc); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::destroy_sampler, void, api::device *device, api::sampler sampler); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::init_resource, void, api::device *device, const api::resource_desc &desc, const api::subresource_data *initial_data, api::resource_usage initial_state, api::resource resource); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::create_resource, bool, api::device *device, api::resource_desc &desc, api::subresource_data *initial_data, api::resource_usage initial_state); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::destroy_resource, void, api::device *device, api::resource resource); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::init_resource_view, void, api::device *device, api::resource resource, api::resource_usage usage_type, const api::resource_view_desc &desc, api::resource_view view); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::create_resource_view, bool, api::device *device, api::resource resource, api::resource_usage usage_type, api::resource_view_desc &desc); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::destroy_resource_view, void, api::device *device, api::resource_view view); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::map_buffer_region, void, api::device *device, api::resource resource, uint64_t offset, uint64_t size, api::map_access access, void **data); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::unmap_buffer_region, void, api::device *device, api::resource resource); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::map_texture_region, void, api::device *device, api::resource resource, uint32_t subresource, const api::subresource_box *box, api::map_access access, api::subresource_data *data); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::unmap_texture_region, void, api::device *device, api::resource resource, uint32_t subresource); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::update_buffer_region, bool, api::device *device, const void *data, api::resource resource, uint64_t offset, uint64_t size); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::update_texture_region, bool, api::device *device, const api::subresource_data &data, api::resource resource, uint32_t subresource, const api::subresource_box *box); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::init_pipeline, void, api::device *device, api::pipeline_layout layout, uint32_t subobject_count, const api::pipeline_subobject *subobjects, api::pipeline pipeline); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::create_pipeline, bool, api::device *device, api::pipeline_layout layout, uint32_t subobject_count, const api::pipeline_subobject *subobjects); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::destroy_pipeline, void, api::device *device, api::pipeline pipeline); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::init_pipeline_layout, void, api::device *device, uint32_t param_count, const api::pipeline_layout_param *params, api::pipeline_layout layout); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::create_pipeline_layout, bool, api::device *device, uint32_t param_count, const api::pipeline_layout_param *params); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::destroy_pipeline_layout, void, api::device *device, api::pipeline_layout layout); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::copy_descriptor_tables, bool, api::device *device, uint32_t count, const api::descriptor_table_copy *copies); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::update_descriptor_tables, bool, api::device *device, uint32_t count, const api::descriptor_table_update *updates); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::init_query_heap, void, api::device *device, api::query_type type, uint32_t size, api::query_heap heap); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::create_query_heap, bool, api::device *device, api::query_type type, uint32_t &size); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::destroy_query_heap, void, api::device *device, api::query_heap heap); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::get_query_heap_results, bool, api::device *device, api::query_heap heap, uint32_t first, uint32_t count, void *results, uint32_t stride); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::barrier, void, api::command_list *cmd_list, uint32_t count, const api::resource *resources, const api::resource_usage *old_states, const api::resource_usage *new_states); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::begin_render_pass, void, api::command_list *cmd_list, uint32_t count, const api::render_pass_render_target_desc *rts, const api::render_pass_depth_stencil_desc *ds); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::end_render_pass, void, api::command_list *cmd_list); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::bind_render_targets_and_depth_stencil, void, api::command_list *cmd_list, uint32_t count, const api::resource_view *rtvs, api::resource_view dsv); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::bind_pipeline, void, api::command_list *cmd_list, api::pipeline_stage stages, api::pipeline pipeline); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::bind_pipeline_states, void, api::command_list *cmd_list, uint32_t count, const api::dynamic_state *states, const uint32_t *values); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::bind_viewports, void, api::command_list *cmd_list, uint32_t first, uint32_t count, const api::viewport *viewports); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::bind_scissor_rects, void, api::command_list *cmd_list, uint32_t first, uint32_t count, const api::rect *rects); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::push_constants, void, api::command_list *cmd_list, api::shader_stage stages, api::pipeline_layout layout, uint32_t layout_param, uint32_t first, uint32_t count, const void *values); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::push_descriptors, void, api::command_list *cmd_list, api::shader_stage stages, api::pipeline_layout layout, uint32_t layout_param, const api::descriptor_table_update &update); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::bind_descriptor_tables, void, api::command_list *cmd_list, api::shader_stage stages, api::pipeline_layout layout, uint32_t first, uint32_t count, const api::descriptor_table *tables); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::bind_index_buffer, void, api::command_list *cmd_list, api::resource buffer, uint64_t offset, uint32_t index_size); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::bind_vertex_buffers, void, api::command_list *cmd_list, uint32_t first, uint32_t count, const api::resource *buffers, const uint64_t *offsets, const uint32_t *strides); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::bind_stream_output_buffers, void, api::command_list *cmd_list, uint32_t first, uint32_t count, const api::resource *buffers, const uint64_t *offsets, const uint64_t *max_sizes, const api::resource *counter_buffers, const uint64_t *counter_offsets); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::draw, bool, api::command_list *cmd_list, uint32_t vertex_count, uint32_t instance_count, uint32_t first_vertex, uint32_t first_instance); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::draw_indexed, bool, api::command_list *cmd_list, uint32_t index_count, uint32_t instance_count, uint32_t first_index, int32_t vertex_offset, uint32_t first_instance); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::dispatch, bool, api::command_list *cmd_list, uint32_t group_count_x, uint32_t group_count_y, uint32_t group_count_z); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::draw_or_dispatch_indirect, bool, api::command_list *cmd_list, api::indirect_command type, api::resource buffer, uint64_t offset, uint32_t draw_count, uint32_t stride); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::copy_resource, bool, api::command_list *cmd_list, api::resource source, api::resource dest); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::copy_buffer_region, bool, api::command_list *cmd_list, api::resource source, uint64_t source_offset, api::resource dest, uint64_t dest_offset, uint64_t size); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::copy_buffer_to_texture, bool, api::command_list *cmd_list, api::resource source, uint64_t source_offset, uint32_t row_length, uint32_t slice_height, api::resource dest, uint32_t dest_subresource, const api::subresource_box *dest_box); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::copy_texture_region, bool, api::command_list *cmd_list, api::resource source, uint32_t source_subresource, const api::subresource_box *source_box, api::resource dest, uint32_t dest_subresource, const api::subresource_box *dest_box, api::filter_mode filter); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::copy_texture_to_buffer, bool, api::command_list *cmd_list, api::resource source, uint32_t source_subresource, const api::subresource_box *source_box, api::resource dest, uint64_t dest_offset, uint32_t row_length, uint32_t slice_height); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::resolve_texture_region, bool, api::command_list *cmd_list, api::resource source, uint32_t source_subresource, const api::subresource_box *source_box, api::resource dest, uint32_t dest_subresource, int32_t dest_x, int32_t dest_y, int32_t dest_z, api::format format); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::clear_depth_stencil_view, bool, api::command_list *cmd_list, api::resource_view dsv, const float *depth, const uint8_t *stencil, uint32_t rect_count, const api::rect *rects); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::clear_render_target_view, bool, api::command_list *cmd_list, api::resource_view rtv, const float color[4], uint32_t rect_count, const api::rect *rects); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::clear_unordered_access_view_uint, bool, api::command_list *cmd_list, api::resource_view uav, const uint32_t values[4], uint32_t rect_count, const api::rect *rects); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::clear_unordered_access_view_float, bool, api::command_list *cmd_list, api::resource_view uav, const float values[4], uint32_t rect_count, const api::rect *rects); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::generate_mipmaps, bool, api::command_list *cmd_list, api::resource_view srv); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::begin_query, bool, api::command_list *cmd_list, api::query_heap heap, api::query_type type, uint32_t index); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::end_query, bool, api::command_list *cmd_list, api::query_heap heap, api::query_type type, uint32_t index); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::copy_query_heap_results, bool, api::command_list *cmd_list, api::query_heap heap, api::query_type type, uint32_t first, uint32_t count, api::resource dest, uint64_t dest_offset, uint32_t stride); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::reset_command_list, void, api::command_list *cmd_list); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::close_command_list, void, api::command_list *cmd_list); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::execute_command_list, void, api::command_queue *queue, api::command_list *cmd_list); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::execute_secondary_command_list, void, api::command_list *cmd_list, api::command_list *secondary_cmd_list); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::present, void, api::command_queue *queue, api::swapchain *swapchain, const api::rect *source_rect, const api::rect *dest_rect, uint32_t dirty_rect_count, const api::rect *dirty_rects); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::reshade_present, void, api::effect_runtime *runtime); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::reshade_begin_effects, void, api::effect_runtime *runtime, api::command_list *cmd_list, api::resource_view rtv, api::resource_view rtv_srgb); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::reshade_finish_effects, void, api::effect_runtime *runtime, api::command_list *cmd_list, api::resource_view rtv, api::resource_view rtv_srgb); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::reshade_reloaded_effects, void, api::effect_runtime *runtime); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::reshade_set_uniform_value, bool, api::effect_runtime *runtime, api::effect_uniform_variable variable, const void *data, size_t size); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::reshade_set_technique_state, bool, api::effect_runtime *runtime, api::effect_technique technique, bool enabled); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::reshade_overlay, void, api::effect_runtime *runtime); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::reshade_screenshot, void, api::effect_runtime *runtime, const char *path); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::reshade_render_technique, void, api::effect_runtime *runtime, api::effect_technique technique, api::command_list *cmd_list, api::resource_view rtv, api::resource_view rtv_srgb); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::reshade_set_current_preset_path, void, api::effect_runtime *runtime, const char *path); RESHADE_DEFINE_ADDON_EVENT_TRAITS(addon_event::reshade_reorder_techniques, bool, api::effect_runtime *runtime, size_t count, api::effect_technique *techniques); }