Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
de11f800
Commit
de11f800
authored
Jun 11, 2012
by
Matteo Bruni
Committed by
Alexandre Julliard
Jun 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Parse vector and matrix declarations.
parent
b2af5e1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
hlsl.l
dlls/d3dcompiler_43/hlsl.l
+0
-2
hlsl.y
dlls/d3dcompiler_43/hlsl.y
+38
-2
No files found.
dlls/d3dcompiler_43/hlsl.l
View file @
de11f800
...
...
@@ -148,8 +148,6 @@ while {return KW_WHILE; }
\.\.\. {return OP_ELLIPSIS; }
\<= {return OP_LE; }
\>= {return OP_GE; }
\< {return OP_LT; }
\> {return OP_GT; }
!= {return OP_NE; }
\+= {return OP_ADDASSIGN; }
\-= {return OP_SUBASSIGN; }
...
...
dlls/d3dcompiler_43/hlsl.y
View file @
de11f800
...
...
@@ -213,8 +213,6 @@ static DWORD add_modifier(DWORD modifiers, DWORD mod)
%token OP_ELLIPSIS
%token OP_LE
%token OP_GE
%token OP_LT
%token OP_GT
%token OP_NE
%token OP_ADDASSIGN
%token OP_SUBASSIGN
...
...
@@ -302,6 +300,44 @@ type: base_type
{
$$ = $1;
}
| KW_VECTOR '<' base_type ',' C_INTEGER '>'
{
if ($3->type != HLSL_CLASS_SCALAR)
{
hlsl_message("Line %u: vectors of non-scalar types are not allowed.\n",
hlsl_ctx.line_no);
set_parse_status(&hlsl_ctx.status, PARSE_ERR);
return 1;
}
if ($5 < 1 || $5 > 4)
{
hlsl_message("Line %u: vector size must be between 1 and 4.\n",
hlsl_ctx.line_no);
set_parse_status(&hlsl_ctx.status, PARSE_ERR);
return 1;
}
$$ = new_hlsl_type(NULL, HLSL_CLASS_VECTOR, $3->base_type, $5, 1);
}
| KW_MATRIX '<' base_type ',' C_INTEGER ',' C_INTEGER '>'
{
if ($3->type != HLSL_CLASS_SCALAR)
{
hlsl_message("Line %u: matrices of non-scalar types are not allowed.\n",
hlsl_ctx.line_no);
set_parse_status(&hlsl_ctx.status, PARSE_ERR);
return 1;
}
if ($5 < 1 || $5 > 4 || $7 < 1 || $7 > 4)
{
hlsl_message("Line %u: matrix dimensions must be between 1 and 4.\n",
hlsl_ctx.line_no);
set_parse_status(&hlsl_ctx.status, PARSE_ERR);
return 1;
}
$$ = new_hlsl_type(NULL, HLSL_CLASS_MATRIX, $3->base_type, $5, $7);
}
base_type: KW_VOID
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment