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
9d9dae0c
Commit
9d9dae0c
authored
Jun 07, 2012
by
Matteo Bruni
Committed by
Alexandre Julliard
Jun 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Distinguish between scalars, vectors and matrices.
parent
a8839cd1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
14 deletions
+28
-14
d3dcompiler_private.h
dlls/d3dcompiler_43/d3dcompiler_private.h
+14
-3
hlsl.y
dlls/d3dcompiler_43/hlsl.y
+3
-3
utils.c
dlls/d3dcompiler_43/utils.c
+11
-8
No files found.
dlls/d3dcompiler_43/d3dcompiler_private.h
View file @
9d9dae0c
...
...
@@ -614,6 +614,17 @@ void SlDeleteShader(struct bwriter_shader *shader) DECLSPEC_HIDDEN;
* DEALINGS IN THE SOFTWARE.
*/
enum
hlsl_type_class
{
HLSL_CLASS_SCALAR
,
HLSL_CLASS_VECTOR
,
HLSL_CLASS_MATRIX
,
HLSL_CLASS_LAST_NUMERIC
=
HLSL_CLASS_MATRIX
,
HLSL_CLASS_STRUCT
,
HLSL_CLASS_ARRAY
,
HLSL_CLASS_OBJECT
,
};
enum
hlsl_base_type
{
HLSL_TYPE_FLOAT
,
...
...
@@ -628,8 +639,6 @@ enum hlsl_base_type
HLSL_TYPE_PIXELSHADER
,
HLSL_TYPE_VERTEXSHADER
,
HLSL_TYPE_STRING
,
HLSL_TYPE_STRUCT
,
HLSL_TYPE_ARRAY
,
HLSL_TYPE_VOID
,
};
...
...
@@ -643,6 +652,7 @@ struct hlsl_type
{
struct
list
entry
;
struct
list
scope_entry
;
enum
hlsl_type_class
type
;
enum
hlsl_base_type
base_type
;
const
char
*
name
;
unsigned
int
modifiers
;
...
...
@@ -737,7 +747,8 @@ void hlsl_message(const char *fmt, ...) PRINTF_ATTR(1,2) DECLSPEC_HIDDEN;
BOOL
add_declaration
(
struct
hlsl_scope
*
scope
,
struct
hlsl_ir_var
*
decl
,
BOOL
local_var
)
DECLSPEC_HIDDEN
;
struct
hlsl_ir_var
*
get_variable
(
struct
hlsl_scope
*
scope
,
const
char
*
name
)
DECLSPEC_HIDDEN
;
void
free_declaration
(
struct
hlsl_ir_var
*
decl
)
DECLSPEC_HIDDEN
;
struct
hlsl_type
*
new_hlsl_type
(
const
char
*
name
,
enum
hlsl_base_type
base_type
,
unsigned
dimx
,
unsigned
dimy
)
DECLSPEC_HIDDEN
;
struct
hlsl_type
*
new_hlsl_type
(
const
char
*
name
,
enum
hlsl_type_class
type_class
,
enum
hlsl_base_type
base_type
,
unsigned
dimx
,
unsigned
dimy
)
DECLSPEC_HIDDEN
;
struct
hlsl_type
*
new_array_type
(
struct
hlsl_type
*
basic_type
,
unsigned
int
array_size
)
DECLSPEC_HIDDEN
;
struct
hlsl_type
*
get_type
(
struct
hlsl_scope
*
scope
,
const
char
*
name
,
BOOL
recursive
)
DECLSPEC_HIDDEN
;
BOOL
find_function
(
const
char
*
name
)
DECLSPEC_HIDDEN
;
...
...
dlls/d3dcompiler_43/hlsl.y
View file @
9d9dae0c
...
...
@@ -240,7 +240,7 @@ type: base_type
base_type: KW_VOID
{
$$ = new_hlsl_type("void", HLSL_TYPE_VOID, 1, 1);
$$ = new_hlsl_type("void", HLSL_
CLASS_SCALAR, HLSL_
TYPE_VOID, 1, 1);
}
| TYPE_IDENTIFIER
{
...
...
@@ -257,9 +257,9 @@ base_type: KW_VOID
TRACE("Struct type %s.\n", $2);
type = get_type(hlsl_ctx.cur_scope, $2, TRUE);
if (type->
base_type != HLSL_TYPE
_STRUCT)
if (type->
type != HLSL_CLASS
_STRUCT)
{
hlsl_message("Line %u:
R
edefining %s as a structure.\n",
hlsl_message("Line %u:
r
edefining %s as a structure.\n",
hlsl_ctx.line_no, $2);
set_parse_status(&hlsl_ctx.status, PARSE_ERR);
}
...
...
dlls/d3dcompiler_43/utils.c
View file @
9d9dae0c
...
...
@@ -804,7 +804,8 @@ void free_declaration(struct hlsl_ir_var *decl)
d3dcompiler_free
(
decl
);
}
struct
hlsl_type
*
new_hlsl_type
(
const
char
*
name
,
enum
hlsl_base_type
base_type
,
unsigned
dimx
,
unsigned
dimy
)
struct
hlsl_type
*
new_hlsl_type
(
const
char
*
name
,
enum
hlsl_type_class
type_class
,
enum
hlsl_base_type
base_type
,
unsigned
dimx
,
unsigned
dimy
)
{
struct
hlsl_type
*
type
;
...
...
@@ -815,6 +816,7 @@ struct hlsl_type *new_hlsl_type(const char *name, enum hlsl_base_type base_type,
return
NULL
;
}
type
->
name
=
name
;
type
->
type
=
type_class
;
type
->
base_type
=
base_type
;
type
->
dimx
=
dimx
;
type
->
dimy
=
dimy
;
...
...
@@ -879,8 +881,6 @@ const char *debug_base_type(const struct hlsl_type *type)
case
HLSL_TYPE_INT
:
name
=
"int"
;
break
;
case
HLSL_TYPE_UINT
:
name
=
"uint"
;
break
;
case
HLSL_TYPE_BOOL
:
name
=
"bool"
;
break
;
case
HLSL_TYPE_STRUCT
:
name
=
"struct"
;
break
;
case
HLSL_TYPE_ARRAY
:
name
=
"array"
;
break
;
default:
FIXME
(
"Unhandled case %u
\n
"
,
type
->
base_type
);
}
...
...
@@ -894,15 +894,18 @@ const char *debug_hlsl_type(const struct hlsl_type *type)
if
(
type
->
name
)
return
debugstr_a
(
type
->
name
);
if
(
type
->
base_type
==
HLSL_TYPE
_STRUCT
)
if
(
type
->
type
==
HLSL_CLASS
_STRUCT
)
name
=
"<anonymous struct>"
;
else
name
=
debug_base_type
(
type
);
if
(
type
->
dimx
==
1
&&
type
->
dimy
==
1
)
if
(
type
->
type
==
HLSL_CLASS_SCALAR
)
return
wine_dbg_sprintf
(
"%s"
,
name
);
if
(
type
->
dimy
==
1
)
if
(
type
->
type
==
HLSL_CLASS_VECTOR
)
return
wine_dbg_sprintf
(
"vector<%s, %u>"
,
name
,
type
->
dimx
);
return
wine_dbg_sprintf
(
"matrix<%s, %u, %u>"
,
name
,
type
->
dimx
,
type
->
dimy
);
if
(
type
->
type
==
HLSL_CLASS_MATRIX
)
return
wine_dbg_sprintf
(
"matrix<%s, %u, %u>"
,
name
,
type
->
dimx
,
type
->
dimy
);
return
"unexpected_type"
;
}
const
char
*
debug_node_type
(
enum
hlsl_ir_node_type
type
)
...
...
@@ -924,7 +927,7 @@ void free_hlsl_type(struct hlsl_type *type)
struct
hlsl_struct_field
*
field
,
*
next_field
;
d3dcompiler_free
((
void
*
)
type
->
name
);
if
(
type
->
base_type
==
HLSL_TYPE
_STRUCT
)
if
(
type
->
type
==
HLSL_CLASS
_STRUCT
)
{
LIST_FOR_EACH_ENTRY_SAFE
(
field
,
next_field
,
type
->
e
.
elements
,
struct
hlsl_struct_field
,
entry
)
{
...
...
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