glsl: Add frontend support for sample
auxiliary storage qualifier
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
@@ -357,6 +357,7 @@ struct ast_type_qualifier {
|
||||
unsigned in:1;
|
||||
unsigned out:1;
|
||||
unsigned centroid:1;
|
||||
unsigned sample:1;
|
||||
unsigned uniform:1;
|
||||
unsigned smooth:1;
|
||||
unsigned flat:1;
|
||||
|
@@ -90,7 +90,8 @@ ast_type_qualifier::has_storage() const
|
||||
bool
|
||||
ast_type_qualifier::has_auxiliary_storage() const
|
||||
{
|
||||
return this->flags.q.centroid;
|
||||
return this->flags.q.centroid
|
||||
|| this->flags.q.sample;
|
||||
}
|
||||
|
||||
const char*
|
||||
|
@@ -520,7 +520,7 @@ readonly KEYWORD(0, 300, 0, 0, READONLY);
|
||||
writeonly KEYWORD(0, 300, 0, 0, WRITEONLY);
|
||||
resource KEYWORD(0, 300, 0, 0, RESOURCE);
|
||||
patch KEYWORD(0, 300, 0, 0, PATCH);
|
||||
sample KEYWORD(0, 300, 0, 0, SAMPLE);
|
||||
sample KEYWORD_WITH_ALT(400, 300, 400, 0, yyextra->ARB_gpu_shader5_enable, SAMPLE);
|
||||
subroutine KEYWORD(0, 300, 0, 0, SUBROUTINE);
|
||||
|
||||
|
||||
|
@@ -1521,7 +1521,7 @@ type_qualifier:
|
||||
{
|
||||
if ($2.has_auxiliary_storage()) {
|
||||
_mesa_glsl_error(&@1, state,
|
||||
"duplicate auxiliary storage qualifier (centroid)");
|
||||
"duplicate auxiliary storage qualifier (centroid or sample)");
|
||||
}
|
||||
|
||||
if (!state->ARB_shading_language_420pack_enable &&
|
||||
@@ -1571,7 +1571,12 @@ auxiliary_storage_qualifier:
|
||||
memset(& $$, 0, sizeof($$));
|
||||
$$.flags.q.centroid = 1;
|
||||
}
|
||||
/* TODO: "sample" and "patch" also go here someday. */
|
||||
| SAMPLE
|
||||
{
|
||||
memset(& $$, 0, sizeof($$));
|
||||
$$.flags.q.sample = 1;
|
||||
}
|
||||
/* TODO: "patch" also goes here someday. */
|
||||
|
||||
storage_qualifier:
|
||||
CONST_TOK
|
||||
|
@@ -878,6 +878,8 @@ _mesa_ast_type_qualifier_print(const struct ast_type_qualifier *q)
|
||||
|
||||
if (q->flags.q.centroid)
|
||||
printf("centroid ");
|
||||
if (q->flags.q.sample)
|
||||
printf("sample ");
|
||||
if (q->flags.q.uniform)
|
||||
printf("uniform ");
|
||||
if (q->flags.q.smooth)
|
||||
|
Reference in New Issue
Block a user