mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-01 10:54:14 +01:00
[dxbc] Do not emit per-vertex input block
Instead, we can let the normal input registers do their thing.
This commit is contained in:
parent
0ab27aa4e3
commit
4ce64bd886
@ -585,7 +585,12 @@ namespace dxvk {
|
|||||||
m_interfaceSlots.inputSlots |= 1u << regIdx;
|
m_interfaceSlots.inputSlots |= 1u << regIdx;
|
||||||
} else if (sv != DxbcSystemValue::None) {
|
} else if (sv != DxbcSystemValue::None) {
|
||||||
// Add a new system value mapping if needed
|
// Add a new system value mapping if needed
|
||||||
m_vMappings.push_back({ regIdx, regMask, sv });
|
bool skipSv = sv == DxbcSystemValue::Position
|
||||||
|
|| sv == DxbcSystemValue::ClipDistance
|
||||||
|
|| sv == DxbcSystemValue::CullDistance;
|
||||||
|
|
||||||
|
if (!skipSv || m_version.type() == DxbcProgramType::PixelShader)
|
||||||
|
m_vMappings.push_back({ regIdx, regMask, sv });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1071,11 +1076,7 @@ namespace dxvk {
|
|||||||
m_gs.inputPrimitive = ins.controls.primitive;
|
m_gs.inputPrimitive = ins.controls.primitive;
|
||||||
m_module.setExecutionMode(m_entryPointId, mode);
|
m_module.setExecutionMode(m_entryPointId, mode);
|
||||||
|
|
||||||
const uint32_t vertexCount
|
emitDclInputArray(primitiveVertexCount(m_gs.inputPrimitive));
|
||||||
= primitiveVertexCount(m_gs.inputPrimitive);
|
|
||||||
|
|
||||||
emitDclInputArray(vertexCount);
|
|
||||||
emitDclInputPerVertex(vertexCount, "gs_vertex_in");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4919,33 +4920,8 @@ namespace dxvk {
|
|||||||
DxbcSystemValue sv,
|
DxbcSystemValue sv,
|
||||||
DxbcRegMask mask,
|
DxbcRegMask mask,
|
||||||
uint32_t vertexId) {
|
uint32_t vertexId) {
|
||||||
switch (sv) {
|
throw DxvkError(str::format(
|
||||||
case DxbcSystemValue::Position: {
|
"DxbcCompiler: Unhandled GS SV input: ", sv));
|
||||||
const std::array<uint32_t, 2> indices = {
|
|
||||||
m_module.consti32(vertexId),
|
|
||||||
m_module.consti32(PerVertex_Position),
|
|
||||||
};
|
|
||||||
|
|
||||||
DxbcRegisterPointer ptrIn;
|
|
||||||
ptrIn.type.ctype = DxbcScalarType::Float32;
|
|
||||||
ptrIn.type.ccount = 4;
|
|
||||||
|
|
||||||
ptrIn.id = m_module.opAccessChain(
|
|
||||||
m_module.defPointerType(
|
|
||||||
getVectorTypeId(ptrIn.type),
|
|
||||||
spv::StorageClassInput),
|
|
||||||
m_perVertexIn,
|
|
||||||
indices.size(),
|
|
||||||
indices.data());
|
|
||||||
|
|
||||||
return emitRegisterExtract(
|
|
||||||
emitValueLoad(ptrIn), mask);
|
|
||||||
} break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
throw DxvkError(str::format(
|
|
||||||
"DxbcCompiler: Unhandled GS SV input: ", sv));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -5538,25 +5514,6 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxbcCompiler::emitDclInputPerVertex(
|
|
||||||
uint32_t vertexCount,
|
|
||||||
const char* varName) {
|
|
||||||
uint32_t typeId = getPerVertexBlockId();
|
|
||||||
|
|
||||||
if (vertexCount != 0) {
|
|
||||||
typeId = m_module.defArrayType(typeId,
|
|
||||||
m_module.constu32(vertexCount));
|
|
||||||
}
|
|
||||||
|
|
||||||
const uint32_t ptrTypeId = m_module.defPointerType(
|
|
||||||
typeId, spv::StorageClassInput);
|
|
||||||
|
|
||||||
m_perVertexIn = m_module.newVar(
|
|
||||||
ptrTypeId, spv::StorageClassInput);
|
|
||||||
m_module.setDebugName(m_perVertexIn, varName);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
DxbcCompilerHsControlPointPhase DxbcCompiler::emitNewHullShaderControlPointPhase() {
|
DxbcCompilerHsControlPointPhase DxbcCompiler::emitNewHullShaderControlPointPhase() {
|
||||||
uint32_t funTypeId = m_module.defFunctionType(
|
uint32_t funTypeId = m_module.defFunctionType(
|
||||||
m_module.defVoidType(), 0, nullptr);
|
m_module.defVoidType(), 0, nullptr);
|
||||||
|
@ -390,7 +390,6 @@ namespace dxvk {
|
|||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
// Per-vertex input and output blocks. Depending on
|
// Per-vertex input and output blocks. Depending on
|
||||||
// the shader stage, these may be declared as arrays.
|
// the shader stage, these may be declared as arrays.
|
||||||
uint32_t m_perVertexIn = 0;
|
|
||||||
uint32_t m_perVertexOut = 0;
|
uint32_t m_perVertexOut = 0;
|
||||||
|
|
||||||
//////////////////////////////////////////////////
|
//////////////////////////////////////////////////
|
||||||
@ -931,10 +930,6 @@ namespace dxvk {
|
|||||||
void emitDclInputArray(
|
void emitDclInputArray(
|
||||||
uint32_t vertexCount);
|
uint32_t vertexCount);
|
||||||
|
|
||||||
void emitDclInputPerVertex(
|
|
||||||
uint32_t vertexCount,
|
|
||||||
const char* varName);
|
|
||||||
|
|
||||||
DxbcCompilerHsControlPointPhase emitNewHullShaderControlPointPhase();
|
DxbcCompilerHsControlPointPhase emitNewHullShaderControlPointPhase();
|
||||||
|
|
||||||
DxbcCompilerHsControlPointPhase emitNewHullShaderPassthroughPhase();
|
DxbcCompilerHsControlPointPhase emitNewHullShaderPassthroughPhase();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user