[SPIR-V] Apply nointerpolation to mesh output (#6260)
Mesh shader output variables may be decorated with the `nointerpolation` attribute, which should be translated to a `Flat` decoration in the SPIR-V backend. Fixes #6250
This commit is contained in:
Родитель
f59df3d3e8
Коммит
a6ac52720d
|
@ -3310,10 +3310,11 @@ SpirvVariable *DeclResultIdMapper::createSpirvInterfaceVariable(
|
|||
}
|
||||
}
|
||||
|
||||
// Decorate with interpolation modes for pixel shader input variables
|
||||
// or vertex shader output variables.
|
||||
// Decorate with interpolation modes for pixel shader input variables, vertex
|
||||
// shader output variables, or mesh shader output variables.
|
||||
if ((spvContext.isPS() && stageVarData.sigPoint->IsInput()) ||
|
||||
(spvContext.isVS() && stageVarData.sigPoint->IsOutput()))
|
||||
(spvContext.isVS() && stageVarData.sigPoint->IsOutput()) ||
|
||||
(spvContext.isMS() && stageVarData.sigPoint->IsOutput()))
|
||||
decorateInterpolationMode(stageVarData.decl, stageVarData.type, varInstr,
|
||||
*stageVarData.semantic);
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
// RUN: %dxc -T ms_6_5 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
struct MeshOutput {
|
||||
float4 PositionCS : SV_POSITION;
|
||||
// CHECK: OpDecorate %out_var_VERTEX_INDEX Flat
|
||||
nointerpolation uint VertexIndex : VERTEX_INDEX;
|
||||
};
|
||||
|
||||
[outputtopology("triangle")]
|
||||
[numthreads(128, 1, 1)]
|
||||
void main(
|
||||
uint gtid : SV_GroupThreadID,
|
||||
uint gid : SV_GroupID,
|
||||
out indices uint3 triangles[128],
|
||||
out vertices MeshOutput vertices[64]) {}
|
Загрузка…
Ссылка в новой задаче