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
311a1e01
Commit
311a1e01
authored
Oct 14, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 15, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Handle SM1 comments in the frontend.
parent
5626e165
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
69 deletions
+44
-69
shader.c
dlls/wined3d/shader.c
+0
-43
shader_sm1.c
dlls/wined3d/shader_sm1.c
+44
-18
shader_sm4.c
dlls/wined3d/shader_sm4.c
+0
-7
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-1
No files found.
dlls/wined3d/shader.c
View file @
311a1e01
...
...
@@ -494,12 +494,6 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
while
(
!
fe
->
shader_is_end
(
fe_data
,
&
ptr
))
{
struct
wined3d_shader_instruction
ins
;
const
char
*
comment
;
UINT
comment_size
;
/* Skip comments. */
fe
->
shader_read_comment
(
&
ptr
,
&
comment
,
&
comment_size
);
if
(
comment
)
continue
;
/* Fetch opcode. */
fe
->
shader_read_instruction
(
fe_data
,
&
ptr
,
&
ins
);
...
...
@@ -1214,13 +1208,6 @@ void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_sh
while
(
!
fe
->
shader_is_end
(
fe_data
,
&
ptr
))
{
const
char
*
comment
;
UINT
comment_size
;
/* Skip comment tokens. */
fe
->
shader_read_comment
(
&
ptr
,
&
comment
,
&
comment_size
);
if
(
comment
)
continue
;
/* Read opcode. */
fe
->
shader_read_instruction
(
fe_data
,
&
ptr
,
&
ins
);
...
...
@@ -1342,36 +1329,6 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
while
(
!
fe
->
shader_is_end
(
fe_data
,
&
ptr
))
{
struct
wined3d_shader_instruction
ins
;
const
char
*
comment
;
UINT
comment_size
;
/* comment */
fe
->
shader_read_comment
(
&
ptr
,
&
comment
,
&
comment_size
);
if
(
comment
)
{
if
(
comment_size
>
4
&&
*
(
const
DWORD
*
)
comment
==
WINEMAKEFOURCC
(
'T'
,
'E'
,
'X'
,
'T'
))
{
const
char
*
end
=
comment
+
comment_size
;
const
char
*
ptr
=
comment
+
4
;
const
char
*
line
=
ptr
;
TRACE
(
"// TEXT
\n
"
);
while
(
ptr
!=
end
)
{
if
(
*
ptr
==
'\n'
)
{
UINT
len
=
ptr
-
line
;
if
(
len
&&
*
(
ptr
-
1
)
==
'\r'
)
--
len
;
TRACE
(
"// %s
\n
"
,
debugstr_an
(
line
,
len
));
line
=
++
ptr
;
}
else
++
ptr
;
}
if
(
line
!=
ptr
)
TRACE
(
"// %s
\n
"
,
debugstr_an
(
line
,
ptr
-
line
));
}
else
TRACE
(
"// %s
\n
"
,
debugstr_an
(
comment
,
comment_size
));
continue
;
}
fe
->
shader_read_instruction
(
fe_data
,
&
ptr
,
&
ins
);
if
(
ins
.
handler_idx
==
WINED3DSIH_TABLE_SIZE
)
...
...
dlls/wined3d/shader_sm1.c
View file @
311a1e01
...
...
@@ -642,6 +642,48 @@ static void shader_sm1_read_immconst(const DWORD **ptr, struct wined3d_shader_sr
*
ptr
+=
count
;
}
static
void
shader_sm1_read_comment
(
const
DWORD
**
ptr
)
{
DWORD
token
=
**
ptr
;
const
char
*
comment
;
UINT
size
;
while
((
token
&
WINED3DSI_OPCODE_MASK
)
==
WINED3D_SM1_OP_COMMENT
)
{
size
=
(
token
&
WINED3DSI_COMMENTSIZE_MASK
)
>>
WINED3DSI_COMMENTSIZE_SHIFT
;
comment
=
(
const
char
*
)
++
(
*
ptr
);
*
ptr
+=
size
;
if
(
size
>
1
&&
*
(
const
DWORD
*
)
comment
==
WINEMAKEFOURCC
(
'T'
,
'E'
,
'X'
,
'T'
))
{
const
char
*
end
=
comment
+
size
*
sizeof
(
token
);
const
char
*
p
=
comment
+
sizeof
(
token
);
const
char
*
line
=
p
;
TRACE
(
"// TEXT
\n
"
);
while
(
p
!=
end
)
{
if
(
*
p
==
'\n'
)
{
UINT
len
=
p
-
line
;
if
(
len
&&
*
(
p
-
1
)
==
'\r'
)
--
len
;
TRACE
(
"// %s
\n
"
,
debugstr_an
(
line
,
len
));
line
=
++
p
;
}
else
++
p
;
}
if
(
line
!=
p
)
TRACE
(
"// %s
\n
"
,
debugstr_an
(
line
,
p
-
line
));
}
else
if
(
size
)
TRACE
(
"// %s
\n
"
,
debugstr_an
(
comment
,
size
*
sizeof
(
token
)));
else
break
;
token
=
**
ptr
;
}
}
static
void
shader_sm1_read_instruction
(
void
*
data
,
const
DWORD
**
ptr
,
struct
wined3d_shader_instruction
*
ins
)
{
const
struct
wined3d_sm1_opcode_info
*
opcode_info
;
...
...
@@ -650,6 +692,8 @@ static void shader_sm1_read_instruction(void *data, const DWORD **ptr, struct wi
unsigned
int
i
;
const
DWORD
*
p
;
shader_sm1_read_comment
(
ptr
);
opcode_token
=
*
(
*
ptr
)
++
;
if
(
!
(
opcode_info
=
shader_get_opcode
(
priv
,
opcode_token
)))
{
...
...
@@ -708,23 +752,6 @@ static void shader_sm1_read_instruction(void *data, const DWORD **ptr, struct wi
}
}
static
void
shader_sm1_read_comment
(
const
DWORD
**
ptr
,
const
char
**
comment
,
UINT
*
comment_size
)
{
DWORD
token
=
**
ptr
;
UINT
size
;
if
((
token
&
WINED3DSI_OPCODE_MASK
)
!=
WINED3D_SM1_OP_COMMENT
)
{
*
comment
=
NULL
;
return
;
}
size
=
(
token
&
WINED3DSI_COMMENTSIZE_MASK
)
>>
WINED3DSI_COMMENTSIZE_SHIFT
;
*
comment
=
(
const
char
*
)
++
(
*
ptr
);
*
comment_size
=
size
*
sizeof
(
DWORD
);
*
ptr
+=
size
;
}
static
BOOL
shader_sm1_is_end
(
void
*
data
,
const
DWORD
**
ptr
)
{
if
(
**
ptr
==
WINED3DSP_END
)
...
...
@@ -742,6 +769,5 @@ const struct wined3d_shader_frontend sm1_shader_frontend =
shader_sm1_free
,
shader_sm1_read_header
,
shader_sm1_read_instruction
,
shader_sm1_read_comment
,
shader_sm1_is_end
,
};
dlls/wined3d/shader_sm4.c
View file @
311a1e01
...
...
@@ -789,12 +789,6 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi
}
}
static
void
shader_sm4_read_comment
(
const
DWORD
**
ptr
,
const
char
**
comment
,
UINT
*
comment_size
)
{
FIXME
(
"ptr %p, comment %p, comment_size %p stub!
\n
"
,
ptr
,
comment
,
comment_size
);
*
comment
=
NULL
;
}
static
BOOL
shader_sm4_is_end
(
void
*
data
,
const
DWORD
**
ptr
)
{
struct
wined3d_sm4_data
*
priv
=
data
;
...
...
@@ -807,6 +801,5 @@ const struct wined3d_shader_frontend sm4_shader_frontend =
shader_sm4_free
,
shader_sm4_read_header
,
shader_sm4_read_instruction
,
shader_sm4_read_comment
,
shader_sm4_is_end
,
};
dlls/wined3d/wined3d_private.h
View file @
311a1e01
...
...
@@ -702,7 +702,6 @@ struct wined3d_shader_frontend
void
(
*
shader_free
)(
void
*
data
);
void
(
*
shader_read_header
)(
void
*
data
,
const
DWORD
**
ptr
,
struct
wined3d_shader_version
*
shader_version
);
void
(
*
shader_read_instruction
)(
void
*
data
,
const
DWORD
**
ptr
,
struct
wined3d_shader_instruction
*
ins
);
void
(
*
shader_read_comment
)(
const
DWORD
**
ptr
,
const
char
**
comment
,
UINT
*
comment_size
);
BOOL
(
*
shader_is_end
)(
void
*
data
,
const
DWORD
**
ptr
);
};
...
...
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