Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2b2b8501
Commit
2b2b8501
authored
Jul 12, 2012
by
Matteo Bruni
Committed by
Alexandre Julliard
Jul 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Use location information in add_modifier().
parent
a84784e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
30 deletions
+30
-30
hlsl.y
dlls/d3dcompiler_43/hlsl.y
+30
-30
No files found.
dlls/d3dcompiler_43/hlsl.y
View file @
2b2b8501
...
...
@@ -146,25 +146,7 @@ static BOOL declare_variable(struct hlsl_ir_var *decl, BOOL local)
return TRUE;
}
static DWORD add_modifier(DWORD modifiers, DWORD mod)
{
if (modifiers & mod)
{
hlsl_message("Line %u: modifier '%s' already specified.\n",
hlsl_ctx.line_no, debug_modifiers(mod));
set_parse_status(&hlsl_ctx.status, PARSE_ERR);
return modifiers;
}
if (mod & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR)
&& modifiers & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR))
{
hlsl_message("Line %u: more than one matrix majority keyword.\n",
hlsl_ctx.line_no);
set_parse_status(&hlsl_ctx.status, PARSE_ERR);
return modifiers;
}
return modifiers | mod;
}
static DWORD add_modifier(DWORD modifiers, DWORD mod, const struct YYLTYPE *loc);
static unsigned int components_count_expr_list(struct list *list)
{
...
...
@@ -691,47 +673,47 @@ var_modifiers: /* Empty */
}
| KW_EXTERN var_modifiers
{
$$ = add_modifier($2, HLSL_STORAGE_EXTERN);
$$ = add_modifier($2, HLSL_STORAGE_EXTERN
, &@1
);
}
| KW_NOINTERPOLATION var_modifiers
{
$$ = add_modifier($2, HLSL_STORAGE_NOINTERPOLATION);
$$ = add_modifier($2, HLSL_STORAGE_NOINTERPOLATION
, &@1
);
}
| KW_PRECISE var_modifiers
{
$$ = add_modifier($2, HLSL_MODIFIER_PRECISE);
$$ = add_modifier($2, HLSL_MODIFIER_PRECISE
, &@1
);
}
| KW_SHARED var_modifiers
{
$$ = add_modifier($2, HLSL_STORAGE_SHARED);
$$ = add_modifier($2, HLSL_STORAGE_SHARED
, &@1
);
}
| KW_GROUPSHARED var_modifiers
{
$$ = add_modifier($2, HLSL_STORAGE_GROUPSHARED);
$$ = add_modifier($2, HLSL_STORAGE_GROUPSHARED
, &@1
);
}
| KW_STATIC var_modifiers
{
$$ = add_modifier($2, HLSL_STORAGE_STATIC);
$$ = add_modifier($2, HLSL_STORAGE_STATIC
, &@1
);
}
| KW_UNIFORM var_modifiers
{
$$ = add_modifier($2, HLSL_STORAGE_UNIFORM);
$$ = add_modifier($2, HLSL_STORAGE_UNIFORM
, &@1
);
}
| KW_VOLATILE var_modifiers
{
$$ = add_modifier($2, HLSL_STORAGE_VOLATILE);
$$ = add_modifier($2, HLSL_STORAGE_VOLATILE
, &@1
);
}
| KW_CONST var_modifiers
{
$$ = add_modifier($2, HLSL_MODIFIER_CONST);
$$ = add_modifier($2, HLSL_MODIFIER_CONST
, &@1
);
}
| KW_ROW_MAJOR var_modifiers
{
$$ = add_modifier($2, HLSL_MODIFIER_ROW_MAJOR);
$$ = add_modifier($2, HLSL_MODIFIER_ROW_MAJOR
, &@1
);
}
| KW_COLUMN_MAJOR var_modifiers
{
$$ = add_modifier($2, HLSL_MODIFIER_COLUMN_MAJOR);
$$ = add_modifier($2, HLSL_MODIFIER_COLUMN_MAJOR
, &@1
);
}
complex_initializer: initializer_expr
...
...
@@ -995,6 +977,24 @@ static void set_location(struct source_location *loc, const struct YYLTYPE *l)
loc->col = l->first_column;
}
static DWORD add_modifier(DWORD modifiers, DWORD mod, const struct YYLTYPE *loc)
{
if (modifiers & mod)
{
hlsl_report_message(hlsl_ctx.source_file, loc->first_line, loc->first_column, HLSL_LEVEL_ERROR,
"modifier '%s' already specified", debug_modifiers(mod));
return modifiers;
}
if (mod & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR)
&& modifiers & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR))
{
hlsl_report_message(hlsl_ctx.source_file, loc->first_line, loc->first_column, HLSL_LEVEL_ERROR,
"more than one matrix majority keyword");
return modifiers;
}
return modifiers | mod;
}
struct bwriter_shader *parse_hlsl(enum shader_type type, DWORD major, DWORD minor,
const char *entrypoint, char **messages)
{
...
...
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