freedreno/computerator: support bindless sampler instructions
authorJonathan Marek <jonathan@marek.ca>
Sat, 11 Apr 2020 22:28:41 +0000 (18:28 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 13 Apr 2020 20:15:48 +0000 (20:15 +0000)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4526>

src/freedreno/computerator/ir3_lexer.l
src/freedreno/computerator/ir3_parser.y

index 44ccd47904c8e85b584b831935ebaee44efecca1..aca2d62b4dbb81eafd217cb605ec7720148081a8 100644 (file)
@@ -291,6 +291,7 @@ static int parse_reg(const char *str)
 "p"                               return 'p';
 "s2en"                            return TOKEN(T_S2EN);
 "s"                               return 's';
+"base"[0-9]+                      ir3_yylval.num = strtol(yytext+4, NULL, 10); return T_BASE;
 
 "="                               return '=';
 "("                               return '(';
index 1dfa2c0f6875b7a222296089c3f4e5c0429b5bc8..e4b02cca9ed6390f97ab7b865a95a7095d85be79 100644 (file)
@@ -458,6 +458,7 @@ static void print_token(FILE *file, int type, YYSTYPE value)
 %token <tok> T_S2EN
 %token <tok> T_SAMP
 %token <tok> T_TEX
+%token <tok> T_BASE
 
 %token <tok> T_NAN
 %token <tok> T_INF
@@ -719,11 +720,12 @@ cat5_flag:         '.' T_3D       { instr->flags |= IR3_INSTR_3D; }
 |                  '.' 'p'        { instr->flags |= IR3_INSTR_P; }
 |                  '.' 's'        { instr->flags |= IR3_INSTR_S; }
 |                  '.' T_S2EN     { instr->flags |= IR3_INSTR_S2EN; }
+|                  '.' T_BASE     { instr->flags |= IR3_INSTR_B; instr->cat5.tex_base = $2; }
 cat5_flags:
 |                  cat5_flag cat5_flags
 
 cat5_samp:         T_SAMP         { instr->cat5.samp = $1; }
-cat5_tex:          T_TEX          { instr->cat5.tex = $1; }
+cat5_tex:          T_TEX          { if (instr->flags & IR3_INSTR_B) instr->cat5.samp |= ($1 << 4); else instr->cat5.tex = $1; }
 cat5_type:         '(' type ')'   { instr->cat5.type = $2; }
 
 cat5_instr:        cat5_opc_dsxypp cat5_flags dst_reg ',' src_reg