Adaptive multisampling based on vertex attributes
Systems, apparatuses and methods may provide for technology that selects an anti-aliasing mode for a vertex of a primitive based on a parameter associated with the vertex and generates a coverage mask based on the selected anti-aliasing mode. Additionally, one or more pixels corresponding to the vertex may be shaded based at least partly on the coverage mask, wherein the selected anti-aliasing mode varies across a plurality of vertices in the primitive.
1. A computing system comprising:
a graphics processor;
a central processing unit; and
a memory including a set of instructions, which when executed by one or more of the graphics processor or the central processing unit, cause the computing system to:
identify a first parameter associated with a first vertex of a primitive, wherein the first parameter indicates a first number of samples to be taken for a first pixel corresponding to the first vertex;
identify a second parameter associated with a second vertex of the primitive, wherein the second parameter indicates a second number of samples to be taken for a second pixel corresponding to the second vertex;
generate a first coverage mask based on a first anti-aliasing mode associated with the first parameter;
shade the first pixel based on the first parameter and the first coverage mask; and
shade the second pixel based on the second parameter.
2. The system of claim 1 , wherein the instructions, when executed, cause the computing system to:
retrieve sample offset data from a lookup table based on the first and second parameters.
3. The system of claim 1 , wherein the instructions, when executed, cause the computing system to:
select the first anti-aliasing mode based on the first parameter.
4. The system of claim 3 , wherein the first coverage mask indicates a sample coverage percentage of the first pixel.
5. The system of claim 3 , wherein the instructions, when executed, cause the computing system to:
select a second anti-aliasing mode for the second vertex based on the second parameter, wherein the second anti-aliasing mode is different from the first anti-aliasing mode;
generate a second coverage mask based on the second anti-aliasing mode, wherein the second coverage mask is different from the first coverage mask; and
shade the second pixel based on the second coverage mask.
6. The system of claim 1 , wherein the first parameter is different from the second parameter, and the first number of samples is different from the second number of samples.
7. A semiconductor apparatus comprising:
one or more substrates;
logic coupled to the one or more substrates, wherein the logic is implemented at least partly in one or more of configurable logic or fixed-functionality logic hardware, the logic coupled to the one or more substrates to:
identify a first parameter associated with a first vertex of a primitive, wherein the first parameter indicates a first number of samples to be taken for a first pixel corresponding to the first vertex;
identify a second parameter associated with a second vertex of the primitive, wherein the second parameter indicates a second number of samples to be taken for a second pixel corresponding to the second vertex;
generate a first coverage mask based on a first anti-aliasing mode associated with the first parameter;
shade the first pixel based on the first parameter and the first coverage mask; and
shade the second pixel based on the second parameter.
8. The apparatus of claim 7 , wherein the logic is to retrieve sample offset data from a lookup table based on the first and second parameters.
9. The apparatus of claim 7 , wherein the logic is to:
select the first anti-aliasing mode based on the first parameter.
10. The apparatus of claim 9 , wherein the first coverage mask indicates a sample coverage percentage of the first pixel.
11. The apparatus of claim 9 , wherein the logic is to:
select a second anti-aliasing mode for the second vertex based on the second parameter, wherein the second anti-aliasing mode is different from the first anti-aliasing mode;
generate a second coverage mask based on the second anti-aliasing mode, wherein the second coverage mask is different from the first coverage mask; and
shade the second pixel based on the second coverage mask.
12. The apparatus of claim 7 , wherein the first parameter is different from the second parameter, and the first number of samples is different from the second number of samples.
13. At least one computer readable storage medium comprising a set of instructions, which when executed by a computing device, cause the computing device to:
identify a first parameter associated with a first vertex of a primitive, wherein the first parameter indicates a first number of samples to be taken for a first pixel corresponding to the first vertex;
identify a second parameter associated with a second vertex of the primitive, wherein the second parameter indicates a second number of samples to be taken for a second pixel corresponding to the second vertex;
generate a first coverage mask based on a first anti-aliasing mode associated with the first parameter;
shade the first pixel based on the first parameter and the first coverage mask; and
shade the second pixel based on the second parameter.
14. The at least one computer readable storage medium of claim 13 , wherein the instructions, when executed, cause the computing device to retrieve sample offset data from a lookup table based on the first and second parameters.
15. The at least one computer readable storage medium of claim 13 , wherein the instructions, when executed, cause the computing device to:
select the first anti-aliasing mode based on the first parameter.
16. The at least one computer readable storage medium of claim 15 , wherein the first coverage mask indicates a sample coverage percentage of the first pixel.
17. The at least one computer readable storage medium of claim 15 , wherein the instructions, when executed, cause the computing device to:
select a second anti-aliasing mode for the second vertex based on the second parameter, wherein the second anti-aliasing mode is different from the first anti-aliasing mode;
generate a second coverage mask based on the second anti-aliasing mode, wherein the second coverage mask is different from the first coverage mask; and
shade the second pixel based on the second coverage mask.
18. The at least one computer readable storage medium of claim 13 , wherein the first parameter is different from the second parameter, and the first number of samples is different from the second number of samples.
19. A method comprising:
identifying a first parameter associated with a first vertex of a primitive, wherein the first parameter indicates a first number of samples that will be taken for a first pixel corresponding to the first vertex;
identifying a second parameter associated with a second vertex of the primitive, wherein the second parameter indicates a second number of samples that will be taken for a second pixel corresponding to the second vertex;
generating a first coverage mask based on a first anti-aliasing mode associated with the first parameter;
shading the first pixel based on the first parameter and the first coverage mask; and
shading the second pixel based on the second parameter.
20. The method of claim 19 , further comprising retrieving sample offset data from a lookup table based on the first and second parameters.
21. The method of claim 19 , further comprising:
selecting the first anti-aliasing mode based on the first parameter.
22. The method of claim 21 , wherein the first coverage mask indicates a sample coverage percentage of the first pixel.
23. The method of claim 21 , further comprising:
selecting a second anti-aliasing mode for the second vertex based on the second parameter, wherein the second anti-aliasing mode is different from the first anti-aliasing mode;
generating a second coverage mask based on the second anti-aliasing mode, wherein the second coverage mask is different from the first coverage mask; and
shading the second pixel based on the second coverage mask.
24. The method of claim 19 , wherein the first parameter is different from the second parameter, and the first number of samples is different from the second number of samples.