mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[dxvk] Use new DxvkShaderCreateInfo struct to retrieve shader info
This commit is contained in:
parent
b0db58f098
commit
d0b52f3ac5
@ -4651,7 +4651,7 @@ namespace dxvk {
|
||||
|
||||
|
||||
void DxvkContext::updateTransformFeedbackBuffers() {
|
||||
auto gsOptions = m_state.gp.shaders.gs->shaderOptions();
|
||||
const auto& gsInfo = m_state.gp.shaders.gs->info();
|
||||
|
||||
VkBuffer xfbBuffers[MaxNumXfbBuffers];
|
||||
VkDeviceSize xfbOffsets[MaxNumXfbBuffers];
|
||||
@ -4669,7 +4669,7 @@ namespace dxvk {
|
||||
|
||||
if (physSlice.handle != VK_NULL_HANDLE) {
|
||||
const Rc<DxvkBuffer>& buffer = m_state.xfb.buffers[i].buffer();
|
||||
buffer->setXfbVertexStride(gsOptions.xfbStrides[i]);
|
||||
buffer->setXfbVertexStride(gsInfo.xfbStrides[i]);
|
||||
|
||||
m_cmd->trackResource<DxvkAccess::Write>(buffer);
|
||||
}
|
||||
|
@ -26,8 +26,8 @@ namespace dxvk {
|
||||
m_layout = new DxvkPipelineLayout(m_vkd,
|
||||
m_slotMapping, VK_PIPELINE_BIND_POINT_GRAPHICS);
|
||||
|
||||
m_vsIn = m_shaders.vs != nullptr ? m_shaders.vs->interfaceSlots().inputSlots : 0;
|
||||
m_fsOut = m_shaders.fs != nullptr ? m_shaders.fs->interfaceSlots().outputSlots : 0;
|
||||
m_vsIn = m_shaders.vs != nullptr ? m_shaders.vs->info().inputMask : 0;
|
||||
m_fsOut = m_shaders.fs != nullptr ? m_shaders.fs->info().outputMask : 0;
|
||||
|
||||
if (m_shaders.gs != nullptr && m_shaders.gs->flags().test(DxvkShaderFlag::HasTransformFeedback))
|
||||
m_flags.set(DxvkGraphicsPipelineFlag::HasTransformFeedback);
|
||||
@ -238,7 +238,7 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
int32_t rasterizedStream = m_shaders.gs != nullptr
|
||||
? m_shaders.gs->shaderOptions().rasterizedStream
|
||||
? m_shaders.gs->info().xfbRasterizedStream
|
||||
: 0;
|
||||
|
||||
// Compact vertex bindings so that we can more easily update vertex buffers
|
||||
@ -451,10 +451,11 @@ namespace dxvk {
|
||||
if (shader == nullptr)
|
||||
return DxvkShaderModule();
|
||||
|
||||
const DxvkShaderCreateInfo& shaderInfo = shader->info();
|
||||
DxvkShaderModuleCreateInfo info;
|
||||
|
||||
// Fix up fragment shader outputs for dual-source blending
|
||||
if (shader->stage() == VK_SHADER_STAGE_FRAGMENT_BIT) {
|
||||
if (shaderInfo.stage == VK_SHADER_STAGE_FRAGMENT_BIT) {
|
||||
info.fsDualSrcBlend = state.omBlend[0].blendEnable() && (
|
||||
util::isDualSourceBlendFactor(state.omBlend[0].srcColorBlendFactor()) ||
|
||||
util::isDualSourceBlendFactor(state.omBlend[0].dstColorBlendFactor()) ||
|
||||
@ -463,15 +464,15 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
// Deal with undefined shader inputs
|
||||
uint32_t consumedInputs = shader->interfaceSlots().inputSlots;
|
||||
uint32_t consumedInputs = shaderInfo.inputMask;
|
||||
uint32_t providedInputs = 0;
|
||||
|
||||
if (shader->stage() == VK_SHADER_STAGE_VERTEX_BIT) {
|
||||
if (shaderInfo.stage == VK_SHADER_STAGE_VERTEX_BIT) {
|
||||
for (uint32_t i = 0; i < state.il.attributeCount(); i++)
|
||||
providedInputs |= 1u << state.ilAttributes[i].location();
|
||||
} else if (shader->stage() != VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) {
|
||||
auto prevStage = getPrevStageShader(shader->stage());
|
||||
providedInputs = prevStage->interfaceSlots().outputSlots;
|
||||
} else if (shaderInfo.stage != VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT) {
|
||||
auto prevStage = getPrevStageShader(shaderInfo.stage);
|
||||
providedInputs = prevStage->info().outputMask;
|
||||
} else {
|
||||
// Technically not correct, but this
|
||||
// would need a lot of extra care
|
||||
|
Loading…
x
Reference in New Issue
Block a user