mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-13 07:08:50 +01:00
[d3d9] Pass shader stage when binding shader resources
This commit is contained in:
parent
0fb1227792
commit
4cc559d690
@ -2653,11 +2653,11 @@ namespace dxvk {
|
|||||||
ctx->bindShader(VK_SHADER_STAGE_FRAGMENT_BIT, nullptr);
|
ctx->bindShader(VK_SHADER_STAGE_FRAGMENT_BIT, nullptr);
|
||||||
|
|
||||||
ctx->bindShader(VK_SHADER_STAGE_GEOMETRY_BIT, shader);
|
ctx->bindShader(VK_SHADER_STAGE_GEOMETRY_BIT, shader);
|
||||||
ctx->bindResourceBuffer(getSWVPBufferSlot(), cBufferSlice);
|
ctx->bindResourceBuffer(VK_SHADER_STAGE_GEOMETRY_BIT, getSWVPBufferSlot(), cBufferSlice);
|
||||||
ctx->draw(
|
ctx->draw(
|
||||||
drawInfo.vertexCount, drawInfo.instanceCount,
|
drawInfo.vertexCount, drawInfo.instanceCount,
|
||||||
cStartIndex, 0);
|
cStartIndex, 0);
|
||||||
ctx->bindResourceBuffer(getSWVPBufferSlot(), DxvkBufferSlice());
|
ctx->bindResourceBuffer(VK_SHADER_STAGE_GEOMETRY_BIT, getSWVPBufferSlot(), DxvkBufferSlice());
|
||||||
ctx->bindShader(VK_SHADER_STAGE_GEOMETRY_BIT, nullptr);
|
ctx->bindShader(VK_SHADER_STAGE_GEOMETRY_BIT, nullptr);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -4889,10 +4889,11 @@ namespace dxvk {
|
|||||||
BufferType);
|
BufferType);
|
||||||
|
|
||||||
EmitCs([
|
EmitCs([
|
||||||
cSlotId = slotId,
|
cShaderStage = GetShaderStage(ShaderStage),
|
||||||
cBuffer = buffer
|
cSlotId = slotId,
|
||||||
|
cBuffer = buffer
|
||||||
] (DxvkContext* ctx) {
|
] (DxvkContext* ctx) {
|
||||||
ctx->bindResourceBuffer(cSlotId,
|
ctx->bindResourceBuffer(cShaderStage, cSlotId,
|
||||||
DxvkBufferSlice(cBuffer, 0, cBuffer->info().size));
|
DxvkBufferSlice(cBuffer, 0, cBuffer->info().size));
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -5072,7 +5073,9 @@ namespace dxvk {
|
|||||||
cSlotId = slotId,
|
cSlotId = slotId,
|
||||||
cSize = bufferSize
|
cSize = bufferSize
|
||||||
] (DxvkContext* ctx) {
|
] (DxvkContext* ctx) {
|
||||||
ctx->bindResourceBuffer(cSlotId,
|
VkShaderStageFlagBits stage = GetShaderStage(ShaderStage);
|
||||||
|
|
||||||
|
ctx->bindResourceBuffer(stage, cSlotId,
|
||||||
DxvkBufferSlice(cBuffer, 0, cSize));
|
DxvkBufferSlice(cBuffer, 0, cSize));
|
||||||
});
|
});
|
||||||
boundConstantBufferSize = bufferSize;
|
boundConstantBufferSize = bufferSize;
|
||||||
@ -5929,9 +5932,11 @@ namespace dxvk {
|
|||||||
cSlot = slot,
|
cSlot = slot,
|
||||||
cKey = key
|
cKey = key
|
||||||
] (DxvkContext* ctx) {
|
] (DxvkContext* ctx) {
|
||||||
|
VkShaderStageFlags stage = VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||||
|
|
||||||
auto pair = m_samplers.find(cKey);
|
auto pair = m_samplers.find(cKey);
|
||||||
if (pair != m_samplers.end()) {
|
if (pair != m_samplers.end()) {
|
||||||
ctx->bindResourceSampler(cSlot, pair->second);
|
ctx->bindResourceSampler(stage, cSlot, pair->second);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5971,7 +5976,7 @@ namespace dxvk {
|
|||||||
auto sampler = m_dxvkDevice->createSampler(info);
|
auto sampler = m_dxvkDevice->createSampler(info);
|
||||||
|
|
||||||
m_samplers.insert(std::make_pair(cKey, sampler));
|
m_samplers.insert(std::make_pair(cKey, sampler));
|
||||||
ctx->bindResourceSampler(cSlot, std::move(sampler));
|
ctx->bindResourceSampler(stage, cSlot, std::move(sampler));
|
||||||
|
|
||||||
m_samplerCount++;
|
m_samplerCount++;
|
||||||
}
|
}
|
||||||
@ -5998,7 +6003,8 @@ namespace dxvk {
|
|||||||
cSlot = slot,
|
cSlot = slot,
|
||||||
cImageView = commonTex->GetSampleView(srgb)
|
cImageView = commonTex->GetSampleView(srgb)
|
||||||
](DxvkContext* ctx) {
|
](DxvkContext* ctx) {
|
||||||
ctx->bindResourceView(cSlot, cImageView, nullptr);
|
VkShaderStageFlags stage = VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||||
|
ctx->bindResourceView(stage, cSlot, cImageView, nullptr);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6013,7 +6019,8 @@ namespace dxvk {
|
|||||||
uint32_t slot = computeResourceSlotId(shaderSampler.first,
|
uint32_t slot = computeResourceSlotId(shaderSampler.first,
|
||||||
DxsoBindingType::Image, uint32_t(shaderSampler.second));
|
DxsoBindingType::Image, uint32_t(shaderSampler.second));
|
||||||
|
|
||||||
ctx->bindResourceView(slot, nullptr, nullptr);
|
VkShaderStageFlags stage = VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||||
|
ctx->bindResourceView(stage, slot, nullptr, nullptr);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -7251,10 +7258,12 @@ namespace dxvk {
|
|||||||
EmitCs([
|
EmitCs([
|
||||||
cSize = m_state.textures.size()
|
cSize = m_state.textures.size()
|
||||||
](DxvkContext* ctx) {
|
](DxvkContext* ctx) {
|
||||||
|
VkShaderStageFlags stage = VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < cSize; i++) {
|
for (uint32_t i = 0; i < cSize; i++) {
|
||||||
auto samplerInfo = RemapStateSamplerShader(DWORD(i));
|
auto samplerInfo = RemapStateSamplerShader(DWORD(i));
|
||||||
uint32_t slot = computeResourceSlotId(samplerInfo.first, DxsoBindingType::Image, uint32_t(samplerInfo.second));
|
uint32_t slot = computeResourceSlotId(samplerInfo.first, DxsoBindingType::Image, uint32_t(samplerInfo.second));
|
||||||
ctx->bindResourceView(slot, nullptr, nullptr);
|
ctx->bindResourceView(stage, slot, nullptr, nullptr);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user