Okay, ich habe es tatsächlich auf
D3D11_RASTERIZER_DESC::MultisampleEnable reduzieren können. Situation:
- Feature Levels 10.0/10.1/11.0 auf 11er-Hardware, keine Unterschiede
- Render Target & Depth Stencil Buffer sind multisampled (SAMPLE_DESC == { 4, 0 })
- MultisampleEnable == TRUE: Artefakte
- MultisampleEnable == FALSE: okay
Die MSDN zu
MultisampleEnable:
MSDN: D3D11_RASTERIZER_DESC hat geschrieben:Enable multisample antialiasing.
Ja, das ist es. Das ist die Dokumentation.
Nun kann ich mir nicht vorstellen, dass das alles sein soll, denn einerseits deckt sich das nicht mit dem Verhalten hier (ich habe auch MSAA, wenn ich es auf
FALSE setze, aber das Render Target multisampled ist!) und andererseits war das Flag unter D3D 10 viel komplexer:
MSDN: D3D10_RASTERIZER_DESC hat geschrieben:Specifies whether to use the quadrilateral or alpha line anti-aliasing algorithm on multisample antialiasing (MSAA) render targets. The default value is FALSE. Set to TRUE to use the quadrilateral line anti-aliasing algorithm and to FALSE to use the alpha line anti-aliasing algorithm. For more info about this member, see Remarks.
MSDN: Remarks dazu hat geschrieben:Note For feature levels 9.1, 9.2, 9.3, and 10.0, if you set MultisampleEnable to FALSE, the runtime renders all points, lines, and triangles without anti-aliasing even for render targets with a sample count greater than 1. For feature level 10.1, the setting of MultisampleEnable has no effect on points and triangles with regard to MSAA and impacts only the selection of the line-rendering algorithm […]
The settings of the MultisampleEnable and AntialiasedLineEnable members apply only to multisample antialiasing (MSAA) render targets (that is, render targets with sample counts greater than 1). Because of the differences in feature-level behavior and as long as you aren’t performing any line drawing or don’t mind that lines render as quadrilaterals, we recommend that you always set MultisampleEnable to TRUE whenever you render on MSAA render targets.
Aus diesem Grund war es bei mir
TRUE (verschiedene Feature Levels und ich zeichne keine Lines), aber
DANN WERDEN MEINE DREIECKE FALSCH RASTERISIERT. Und 11 scheint das 10.1-Verhalten fortzusetzen – 10.0, 10.1, und 11.0 erzeugen alle den selben Dreck, sobald
MultisampleEnable == TRUE, machen MSAA an/aus aber ausschließlich am Render Target fest.
Nachtrag: Die Beschreibung von
D3D11_1_DDI_RASTERIZER_DESC könnte auch zum Verständnis helfen, gilt aber für 11.1 (ich bin auf 11.0) und ist Treiber-intern:
A Boolean value that specifies whether the driver must follow multiple-sampled rasterization rules. TRUE indicates to follow the rules; FALSE indicates following the rules is not required. Multiple-sampled rasterization rules hold true even if render targets contain only a single sample.
Welche Regeln sollen das sein? Verhindert das Treiber-interne Optimierungen bei MSAA?
Bitte erklärt mir, was da falsch läuft!