mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[dxbc] User-defined shader interface cannot be an array due to interpolation modes
This commit is contained in:
parent
0843349d72
commit
bd8dc20fa2
@ -19,19 +19,6 @@ namespace dxvk {
|
|||||||
spv::FunctionControlMaskNone);
|
spv::FunctionControlMaskNone);
|
||||||
m_module.opLabel(m_module.allocateId());
|
m_module.opLabel(m_module.allocateId());
|
||||||
|
|
||||||
// Declare user input block
|
|
||||||
m_psIn = m_module.newVar(
|
|
||||||
m_module.defPointerType(
|
|
||||||
m_module.defArrayType(
|
|
||||||
m_module.defVectorType(
|
|
||||||
m_module.defFloatType(32), 4),
|
|
||||||
m_module.constu32(32)),
|
|
||||||
spv::StorageClassInput),
|
|
||||||
spv::StorageClassInput);
|
|
||||||
m_entryPointInterfaces.push_back(m_psIn);
|
|
||||||
m_module.decorateLocation(m_psIn, 0);
|
|
||||||
m_module.setDebugName(m_psIn, "ps_in");
|
|
||||||
|
|
||||||
// Declare outputs based on the input signature
|
// Declare outputs based on the input signature
|
||||||
for (auto e = osgn->begin(); e != osgn->end(); e++) {
|
for (auto e = osgn->begin(); e != osgn->end(); e++) {
|
||||||
if (e->systemValue == DxbcSystemValue::None) {
|
if (e->systemValue == DxbcSystemValue::None) {
|
||||||
@ -67,7 +54,8 @@ namespace dxvk {
|
|||||||
if (m_vRegs.at(regId).valueId == 0) {
|
if (m_vRegs.at(regId).valueId == 0) {
|
||||||
m_vRegs.at(regId) = this->defVar(
|
m_vRegs.at(regId) = this->defVar(
|
||||||
DxbcValueType(DxbcScalarType::Float32, 4),
|
DxbcValueType(DxbcScalarType::Float32, 4),
|
||||||
spv::StorageClassPrivate);
|
spv::StorageClassInput);
|
||||||
|
m_module.decorateLocation(m_vRegs.at(regId).valueId, regId);
|
||||||
m_module.setDebugName(m_vRegs.at(regId).valueId,
|
m_module.setDebugName(m_vRegs.at(regId).valueId,
|
||||||
str::format("v", regId).c_str());
|
str::format("v", regId).c_str());
|
||||||
}
|
}
|
||||||
@ -169,14 +157,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void DxbcPsCodeGen::prepareSvInputs() {
|
void DxbcPsCodeGen::prepareSvInputs() {
|
||||||
for (uint32_t i = 0; i < m_vRegs.size(); i++) {
|
|
||||||
if (m_vRegs.at(i).valueId != 0) {
|
|
||||||
this->regStore(
|
|
||||||
m_vRegs.at(i),
|
|
||||||
this->regLoad(this->getPsInPtr(i)),
|
|
||||||
DxbcComponentMask(true, true, true, true));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -194,18 +175,4 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DxbcPointer DxbcPsCodeGen::getPsInPtr(uint32_t id) {
|
|
||||||
const uint32_t memberId = m_module.constu32(id);
|
|
||||||
|
|
||||||
DxbcPointer result;
|
|
||||||
result.type = DxbcPointerType(
|
|
||||||
DxbcValueType(DxbcScalarType::Float32, 4),
|
|
||||||
spv::StorageClassInput);
|
|
||||||
result.valueId = m_module.opAccessChain(
|
|
||||||
this->defPointerType(result.type),
|
|
||||||
m_psIn, 1, &memberId);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -37,7 +37,6 @@ namespace dxvk {
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
uint32_t m_function = 0;
|
uint32_t m_function = 0;
|
||||||
uint32_t m_psIn = 0;
|
|
||||||
|
|
||||||
DxbcPointer m_svPosition;
|
DxbcPointer m_svPosition;
|
||||||
|
|
||||||
@ -50,8 +49,6 @@ namespace dxvk {
|
|||||||
void prepareSvInputs();
|
void prepareSvInputs();
|
||||||
void prepareSvOutputs();
|
void prepareSvOutputs();
|
||||||
|
|
||||||
DxbcPointer getPsInPtr(uint32_t id);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
@ -25,19 +25,6 @@ namespace dxvk {
|
|||||||
m_entryPointInterfaces.push_back(m_vsPerVertex);
|
m_entryPointInterfaces.push_back(m_vsPerVertex);
|
||||||
m_module.setDebugName(m_vsPerVertex, "vs_per_vertex");
|
m_module.setDebugName(m_vsPerVertex, "vs_per_vertex");
|
||||||
|
|
||||||
// Declare per-vertex user output block
|
|
||||||
m_vsOut = m_module.newVar(
|
|
||||||
m_module.defPointerType(
|
|
||||||
m_module.defArrayType(
|
|
||||||
m_module.defVectorType(
|
|
||||||
m_module.defFloatType(32), 4),
|
|
||||||
m_module.constu32(32)),
|
|
||||||
spv::StorageClassOutput),
|
|
||||||
spv::StorageClassOutput);
|
|
||||||
m_entryPointInterfaces.push_back(m_vsOut);
|
|
||||||
m_module.decorateLocation(m_vsOut, 0);
|
|
||||||
m_module.setDebugName(m_vsOut, "vs_out");
|
|
||||||
|
|
||||||
// Declare vertex inputs based on the input signature
|
// Declare vertex inputs based on the input signature
|
||||||
for (auto e = isgn->begin(); e != isgn->end(); e++) {
|
for (auto e = isgn->begin(); e != isgn->end(); e++) {
|
||||||
if (e->systemValue == DxbcSystemValue::None) {
|
if (e->systemValue == DxbcSystemValue::None) {
|
||||||
@ -88,7 +75,8 @@ namespace dxvk {
|
|||||||
if (m_oRegs.at(regId).valueId == 0) {
|
if (m_oRegs.at(regId).valueId == 0) {
|
||||||
m_oRegs.at(regId) = this->defVar(
|
m_oRegs.at(regId) = this->defVar(
|
||||||
DxbcValueType(DxbcScalarType::Float32, 4),
|
DxbcValueType(DxbcScalarType::Float32, 4),
|
||||||
spv::StorageClassPrivate);
|
spv::StorageClassOutput);
|
||||||
|
m_module.decorateLocation(m_oRegs.at(regId).valueId, regId);
|
||||||
m_module.setDebugName(m_oRegs.at(regId).valueId,
|
m_module.setDebugName(m_oRegs.at(regId).valueId,
|
||||||
str::format("o", regId).c_str());
|
str::format("o", regId).c_str());
|
||||||
}
|
}
|
||||||
@ -186,15 +174,6 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void DxbcVsCodeGen::prepareSvOutputs() {
|
void DxbcVsCodeGen::prepareSvOutputs() {
|
||||||
for (uint32_t i = 0; i < m_oRegs.size(); i++) {
|
|
||||||
if (m_oRegs.at(i).valueId != 0) {
|
|
||||||
this->regStore(
|
|
||||||
this->getVsOutPtr(i),
|
|
||||||
this->regLoad(m_oRegs.at(i)),
|
|
||||||
DxbcComponentMask(true, true, true, true));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto& mapping : m_svOut) {
|
for (const auto& mapping : m_svOut) {
|
||||||
DxbcValue srcValue = this->regLoad(m_oRegs.at(mapping.regId));
|
DxbcValue srcValue = this->regLoad(m_oRegs.at(mapping.regId));
|
||||||
|
|
||||||
@ -221,18 +200,4 @@ namespace dxvk {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DxbcPointer DxbcVsCodeGen::getVsOutPtr(uint32_t id) {
|
|
||||||
const uint32_t memberId = m_module.constu32(id);
|
|
||||||
|
|
||||||
DxbcPointer result;
|
|
||||||
result.type = DxbcPointerType(
|
|
||||||
DxbcValueType(DxbcScalarType::Float32, 4),
|
|
||||||
spv::StorageClassOutput);
|
|
||||||
result.valueId = m_module.opAccessChain(
|
|
||||||
this->defPointerType(result.type),
|
|
||||||
m_vsOut, 1, &memberId);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -38,7 +38,6 @@ namespace dxvk {
|
|||||||
|
|
||||||
uint32_t m_function = 0;
|
uint32_t m_function = 0;
|
||||||
uint32_t m_vsPerVertex = 0;
|
uint32_t m_vsPerVertex = 0;
|
||||||
uint32_t m_vsOut = 0;
|
|
||||||
|
|
||||||
std::array<DxbcPointer, 32> m_vsIn;
|
std::array<DxbcPointer, 32> m_vsIn;
|
||||||
std::array<DxbcPointer, 32> m_vRegs;
|
std::array<DxbcPointer, 32> m_vRegs;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user