diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 5a4734fc..748b378e 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -3375,7 +3375,7 @@ namespace dxvk { ctx->bindShader( Forwarder::move(cShader)); - ctx->bindResourceBuffer(stage, slotId, + ctx->bindUniformBuffer(stage, slotId, Forwarder::move(cBuffer)); }); } else { @@ -3386,7 +3386,7 @@ namespace dxvk { D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT); ctx->bindShader(nullptr); - ctx->bindResourceBuffer(stage, slotId, DxvkBufferSlice()); + ctx->bindUniformBuffer(stage, slotId, DxvkBufferSlice()); }); } } @@ -3598,7 +3598,7 @@ namespace dxvk { cBufferSlice = pBuffer->GetBufferSlice(16 * Offset, 16 * Length) ] (DxvkContext* ctx) mutable { VkShaderStageFlagBits stage = GetShaderStage(ShaderStage); - ctx->bindResourceBuffer(stage, cSlotId, + ctx->bindUniformBuffer(stage, cSlotId, Forwarder::move(cBufferSlice)); }); } else { @@ -3606,7 +3606,7 @@ namespace dxvk { cSlotId = Slot ] (DxvkContext* ctx) { VkShaderStageFlagBits stage = GetShaderStage(ShaderStage); - ctx->bindResourceBuffer(stage, cSlotId, DxvkBufferSlice()); + ctx->bindUniformBuffer(stage, cSlotId, DxvkBufferSlice()); }); } } @@ -3624,7 +3624,7 @@ namespace dxvk { cLength = 16 * Length ] (DxvkContext* ctx) { VkShaderStageFlagBits stage = GetShaderStage(ShaderStage); - ctx->bindResourceBufferRange(stage, cSlotId, cOffset, cLength); + ctx->bindUniformBufferRange(stage, cSlotId, cOffset, cLength); }); } @@ -4390,10 +4390,10 @@ namespace dxvk { // Unbind constant buffers, including the shader's ICB auto cbSlotId = computeConstantBufferBinding(programType, 0); - ctx->bindResourceBuffer(stage, cbSlotId + D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, DxvkBufferSlice()); + ctx->bindUniformBuffer(stage, cbSlotId + D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, DxvkBufferSlice()); for (uint32_t j = 0; j < cUsedBindings.stages[i].cbvCount; j++) - ctx->bindResourceBuffer(stage, cbSlotId + j, DxvkBufferSlice()); + ctx->bindUniformBuffer(stage, cbSlotId + j, DxvkBufferSlice()); // Unbind shader resource views auto srvSlotId = computeSrvBinding(programType, 0); diff --git a/src/d3d11/d3d11_video.cpp b/src/d3d11/d3d11_video.cpp index e9821033..e4d76359 100644 --- a/src/d3d11/d3d11_video.cpp +++ b/src/d3d11/d3d11_video.cpp @@ -1202,7 +1202,7 @@ namespace dxvk { ctx->bindRenderTargets(std::move(rt), 0u); ctx->bindShader(Rc(m_vs)); ctx->bindShader(Rc(m_fs)); - ctx->bindResourceBuffer(VK_SHADER_STAGE_FRAGMENT_BIT, 0, DxvkBufferSlice(m_ubo)); + ctx->bindUniformBuffer(VK_SHADER_STAGE_FRAGMENT_BIT, 0, DxvkBufferSlice(m_ubo)); DxvkInputAssemblyState iaState; iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; @@ -1318,7 +1318,7 @@ namespace dxvk { ctx->bindShader(nullptr); ctx->bindShader(nullptr); - ctx->bindResourceBuffer(VK_SHADER_STAGE_FRAGMENT_BIT, 0, DxvkBufferSlice()); + ctx->bindUniformBuffer(VK_SHADER_STAGE_FRAGMENT_BIT, 0, DxvkBufferSlice()); }); } diff --git a/src/d3d9/d3d9_constant_buffer.cpp b/src/d3d9/d3d9_constant_buffer.cpp index a88935b0..523f5391 100644 --- a/src/d3d9/d3d9_constant_buffer.cpp +++ b/src/d3d9/d3d9_constant_buffer.cpp @@ -65,7 +65,7 @@ namespace dxvk { cOffset = m_offset, cLength = size ] (DxvkContext* ctx) { - ctx->bindResourceBufferRange(cStages, cBinding, cOffset, cLength); + ctx->bindUniformBufferRange(cStages, cBinding, cOffset, cLength); }); void* mapPtr = reinterpret_cast(m_slice.mapPtr) + m_offset; @@ -118,7 +118,7 @@ namespace dxvk { cBinding = m_binding, cSlice = DxvkBufferSlice(m_buffer) ] (DxvkContext* ctx) mutable { - ctx->bindResourceBuffer(cStages, cBinding, std::move(cSlice)); + ctx->bindUniformBuffer(cStages, cBinding, std::move(cSlice)); }); } diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 7634848a..93554d0e 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -2718,11 +2718,11 @@ namespace dxvk { ctx->bindShader(nullptr); ctx->bindShader(std::move(shader)); - ctx->bindResourceBuffer(VK_SHADER_STAGE_GEOMETRY_BIT, getSWVPBufferSlot(), std::move(cBufferSlice)); + ctx->bindUniformBuffer(VK_SHADER_STAGE_GEOMETRY_BIT, getSWVPBufferSlot(), std::move(cBufferSlice)); ctx->draw( drawInfo.vertexCount, drawInfo.instanceCount, cStartIndex, 0); - ctx->bindResourceBuffer(VK_SHADER_STAGE_GEOMETRY_BIT, getSWVPBufferSlot(), DxvkBufferSlice()); + ctx->bindUniformBuffer(VK_SHADER_STAGE_GEOMETRY_BIT, getSWVPBufferSlot(), DxvkBufferSlice()); ctx->bindShader(nullptr); }); diff --git a/src/dxvk/dxvk_context.h b/src/dxvk/dxvk_context.h index aa42ef79..2da97d97 100644 --- a/src/dxvk/dxvk_context.h +++ b/src/dxvk/dxvk_context.h @@ -169,14 +169,16 @@ namespace dxvk { } /** - * \brief Binds buffer as a shader resource + * \brief Binds buffer to the UBO set * - * Can be used for uniform and storage buffers. + * Can be used for uniform and storage buffers bound that + * are used within the UBO descriptor set. Storage buffers + * within the view set must be bound via a view. * \param [in] stages Shader stages that access the binding * \param [in] slot Resource binding slot * \param [in] buffer Buffer to bind */ - void bindResourceBuffer( + void bindUniformBuffer( VkShaderStageFlags stages, uint32_t slot, DxvkBufferSlice&& buffer) { @@ -191,12 +193,12 @@ namespace dxvk { } /** - * \brief Changes bound range of a resource buffer + * \brief Changes bound range of a uniform buffer * * Can be used to quickly bind a new sub-range of * a buffer rather than re-binding the entire buffer. */ - void bindResourceBufferRange( + void bindUniformBufferRange( VkShaderStageFlags stages, uint32_t slot, VkDeviceSize offset,