mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-29 04:06:24 +01:00
[d3d11] Use new DxvkShaderCreateInfo struct to retrieve shader info
This commit is contained in:
parent
427f51eda7
commit
69817a84dc
@ -54,11 +54,13 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create shader constant buffer if necessary
|
// Create shader constant buffer if necessary
|
||||||
if (m_shader->shaderConstants().data() != nullptr) {
|
const DxvkShaderCreateInfo& shaderInfo = m_shader->info();
|
||||||
|
|
||||||
|
if (shaderInfo.uniformSize) {
|
||||||
DxvkBufferCreateInfo info;
|
DxvkBufferCreateInfo info;
|
||||||
info.size = m_shader->shaderConstants().sizeInBytes();
|
info.size = shaderInfo.uniformSize;
|
||||||
info.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
|
info.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
|
||||||
info.stages = util::pipelineStages(m_shader->stage());
|
info.stages = util::pipelineStages(shaderInfo.stage);
|
||||||
info.access = VK_ACCESS_UNIFORM_READ_BIT;
|
info.access = VK_ACCESS_UNIFORM_READ_BIT;
|
||||||
|
|
||||||
VkMemoryPropertyFlags memFlags
|
VkMemoryPropertyFlags memFlags
|
||||||
@ -67,10 +69,7 @@ namespace dxvk {
|
|||||||
| VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
|
| VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
|
||||||
|
|
||||||
m_buffer = pDevice->GetDXVKDevice()->createBuffer(info, memFlags);
|
m_buffer = pDevice->GetDXVKDevice()->createBuffer(info, memFlags);
|
||||||
|
std::memcpy(m_buffer->mapPtr(0), shaderInfo.uniformData, shaderInfo.uniformSize);
|
||||||
std::memcpy(m_buffer->mapPtr(0),
|
|
||||||
m_shader->shaderConstants().data(),
|
|
||||||
m_shader->shaderConstants().sizeInBytes());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pDevice->GetDXVKDevice()->registerShader(m_shader);
|
pDevice->GetDXVKDevice()->registerShader(m_shader);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user