From 10eabb34dad61cf9e432288ec786e49be01212fe Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 2 Jun 2022 19:36:58 +0200 Subject: [PATCH] [dxvk] Add shader stage parameter to binding methods --- src/dxvk/dxvk_context.cpp | 25 +++++++++++++++++++++++++ src/dxvk/dxvk_context.h | 19 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 7b5fe321..2fa3011b 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -147,6 +147,14 @@ namespace dxvk { } + void DxvkContext::bindResourceBuffer( + VkShaderStageFlags stages, + uint32_t slot, + const DxvkBufferSlice& buffer) { + bindResourceBuffer(slot, buffer); + } + + void DxvkContext::bindResourceBuffer( uint32_t slot, const DxvkBufferSlice& buffer) { @@ -171,6 +179,15 @@ namespace dxvk { } + void DxvkContext::bindResourceView( + VkShaderStageFlags stages, + uint32_t slot, + const Rc& imageView, + const Rc& bufferView) { + bindResourceView(slot, imageView, bufferView); + } + + void DxvkContext::bindResourceView( uint32_t slot, const Rc& imageView, @@ -188,6 +205,14 @@ namespace dxvk { } + void DxvkContext::bindResourceSampler( + VkShaderStageFlags stages, + uint32_t slot, + const Rc& sampler) { + bindResourceSampler(slot, sampler); + } + + void DxvkContext::bindResourceSampler( uint32_t slot, const Rc& sampler) { diff --git a/src/dxvk/dxvk_context.h b/src/dxvk/dxvk_context.h index 39c5b989..9e77003e 100644 --- a/src/dxvk/dxvk_context.h +++ b/src/dxvk/dxvk_context.h @@ -109,9 +109,15 @@ namespace dxvk { * \brief Binds buffer as a shader resource * * Can be used for uniform and storage buffers. + * \param [in] stages Shader stages that access the binding * \param [in] slot Resource binding slot * \param [in] buffer Buffer to bind */ + void bindResourceBuffer( + VkShaderStageFlags stages, + uint32_t slot, + const DxvkBufferSlice& buffer); + void bindResourceBuffer( uint32_t slot, const DxvkBufferSlice& buffer); @@ -122,10 +128,17 @@ namespace dxvk { * Can be used for sampled images with a dedicated * sampler and for storage images, as well as for * uniform texel buffers and storage texel buffers. + * \param [in] stages Shader stages that access the binding * \param [in] slot Resource binding slot * \param [in] imageView Image view to bind * \param [in] bufferView Buffer view to bind */ + void bindResourceView( + VkShaderStageFlags stages, + uint32_t slot, + const Rc& imageView, + const Rc& bufferView); + void bindResourceView( uint32_t slot, const Rc& imageView, @@ -136,9 +149,15 @@ namespace dxvk { * * Binds a sampler that can be used together with * an image in order to read from a texture. + * \param [in] stages Shader stages that access the binding * \param [in] slot Resource binding slot * \param [in] sampler Sampler view to bind */ + void bindResourceSampler( + VkShaderStageFlags stages, + uint32_t slot, + const Rc& sampler); + void bindResourceSampler( uint32_t slot, const Rc& sampler);