Commit 6c23946c by Jamie Madill Committed by Shannon Woods

Properly recognize error cases for 'centroid out' and 'centroid in'.

TRAC #23268 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens Authored-by: Jamie Madill
parent b120eac2
......@@ -1399,11 +1399,21 @@ storage_qualifier
}
| CENTROID IN_QUAL {
ES3_ONLY("centroid in", $1.line, "storage qualifier");
if (context->shaderType == SH_VERTEX_SHADER)
{
context->error($1.line, "invalid storage qualifier", "it is an error to use 'centroid in' in the vertex shader");
context->recover();
}
$$.qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqCentroidIn : EvqVertexInput;
$$.line = $1.line;
}
| CENTROID OUT_QUAL {
ES3_ONLY("centroid out", $1.line, "storage qualifier");
if (context->shaderType == SH_FRAGMENT_SHADER)
{
context->error($1.line, "invalid storage qualifier", "it is an error to use 'centroid out' in the fragment shader");
context->recover();
}
$$.qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragmentOutput : EvqCentroidOut;
$$.line = $1.line;
}
......
......@@ -753,18 +753,18 @@ static const yytype_uint16 yyrline[] =
974, 979, 989, 992, 995, 998, 1004, 1011, 1014, 1036,
1054, 1078, 1101, 1105, 1123, 1131, 1163, 1183, 1272, 1281,
1287, 1291, 1298, 1304, 1311, 1320, 1329, 1332, 1368, 1375,
1379, 1386, 1390, 1395, 1400, 1405, 1410, 1419, 1429, 1436,
1439, 1442, 1448, 1455, 1458, 1464, 1467, 1470, 1476, 1479,
1494, 1498, 1502, 1506, 1510, 1514, 1519, 1524, 1529, 1534,
1539, 1544, 1549, 1554, 1559, 1564, 1569, 1574, 1580, 1586,
1592, 1597, 1602, 1607, 1612, 1617, 1622, 1627, 1632, 1641,
1650, 1655, 1668, 1668, 1671, 1671, 1677, 1680, 1695, 1698,
1706, 1710, 1716, 1724, 1740, 1744, 1748, 1749, 1755, 1756,
1757, 1758, 1759, 1763, 1764, 1764, 1764, 1774, 1775, 1779,
1779, 1780, 1780, 1785, 1788, 1798, 1801, 1807, 1808, 1812,
1820, 1824, 1834, 1839, 1856, 1856, 1861, 1861, 1868, 1868,
1876, 1879, 1885, 1888, 1894, 1898, 1905, 1912, 1919, 1926,
1937, 1946, 1950, 1957, 1960, 1966, 1966
1379, 1386, 1390, 1395, 1400, 1410, 1420, 1429, 1439, 1446,
1449, 1452, 1458, 1465, 1468, 1474, 1477, 1480, 1486, 1489,
1504, 1508, 1512, 1516, 1520, 1524, 1529, 1534, 1539, 1544,
1549, 1554, 1559, 1564, 1569, 1574, 1579, 1584, 1590, 1596,
1602, 1607, 1612, 1617, 1622, 1627, 1632, 1637, 1642, 1651,
1660, 1665, 1678, 1678, 1681, 1681, 1687, 1690, 1705, 1708,
1716, 1720, 1726, 1734, 1750, 1754, 1758, 1759, 1765, 1766,
1767, 1768, 1769, 1773, 1774, 1774, 1774, 1784, 1785, 1789,
1789, 1790, 1790, 1795, 1798, 1808, 1811, 1817, 1818, 1822,
1830, 1834, 1844, 1849, 1866, 1866, 1871, 1871, 1878, 1878,
1886, 1889, 1895, 1898, 1904, 1908, 1915, 1922, 1929, 1936,
1947, 1956, 1960, 1967, 1970, 1976, 1976
};
#endif
......@@ -3774,6 +3774,11 @@ yyreduce:
{
ES3_ONLY("centroid in", (yyvsp[(1) - (2)].lex).line, "storage qualifier");
if (context->shaderType == SH_VERTEX_SHADER)
{
context->error((yyvsp[(1) - (2)].lex).line, "invalid storage qualifier", "it is an error to use 'centroid in' in the vertex shader");
context->recover();
}
(yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqCentroidIn : EvqVertexInput;
(yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
}
......@@ -3783,6 +3788,11 @@ yyreduce:
{
ES3_ONLY("centroid out", (yyvsp[(1) - (2)].lex).line, "storage qualifier");
if (context->shaderType == SH_FRAGMENT_SHADER)
{
context->error((yyvsp[(1) - (2)].lex).line, "invalid storage qualifier", "it is an error to use 'centroid out' in the fragment shader");
context->recover();
}
(yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragmentOutput : EvqCentroidOut;
(yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment