mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-04 16:24:29 +01:00
[dxvk] Rename bindResourceBuffer to bindUniformBuffer
This commit is contained in:
parent
a8f9fdb21d
commit
d35bf455d9
@ -3375,7 +3375,7 @@ namespace dxvk {
|
||||
|
||||
ctx->bindShader<stage>(
|
||||
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<stage>(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);
|
||||
|
@ -1202,7 +1202,7 @@ namespace dxvk {
|
||||
ctx->bindRenderTargets(std::move(rt), 0u);
|
||||
ctx->bindShader<VK_SHADER_STAGE_VERTEX_BIT>(Rc<DxvkShader>(m_vs));
|
||||
ctx->bindShader<VK_SHADER_STAGE_FRAGMENT_BIT>(Rc<DxvkShader>(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<VK_SHADER_STAGE_VERTEX_BIT>(nullptr);
|
||||
ctx->bindShader<VK_SHADER_STAGE_FRAGMENT_BIT>(nullptr);
|
||||
|
||||
ctx->bindResourceBuffer(VK_SHADER_STAGE_FRAGMENT_BIT, 0, DxvkBufferSlice());
|
||||
ctx->bindUniformBuffer(VK_SHADER_STAGE_FRAGMENT_BIT, 0, DxvkBufferSlice());
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -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<char*>(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));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -2718,11 +2718,11 @@ namespace dxvk {
|
||||
ctx->bindShader<VK_SHADER_STAGE_FRAGMENT_BIT>(nullptr);
|
||||
|
||||
ctx->bindShader<VK_SHADER_STAGE_GEOMETRY_BIT>(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<VK_SHADER_STAGE_GEOMETRY_BIT>(nullptr);
|
||||
});
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user