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
868f5bfc
Commit
868f5bfc
authored
May 05, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
May 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Handle reading the shader header in the frontend.
In SM 1-3 this is just the version, in SM4 this also includes the token count.
parent
ef074cdd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
20 deletions
+23
-20
baseshader.c
dlls/wined3d/baseshader.c
+6
-20
shader_sm1.c
dlls/wined3d/shader_sm1.c
+7
-0
shader_sm4.c
dlls/wined3d/shader_sm4.c
+9
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/baseshader.c
View file @
868f5bfc
...
...
@@ -342,13 +342,8 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
shader_delete_constant_list
(
&
This
->
baseShader
.
constantsB
);
shader_delete_constant_list
(
&
This
->
baseShader
.
constantsI
);
/* The version token is supposed to be the first token */
if
(
!
shader_is_version_token
(
*
pToken
))
{
FIXME
(
"First token is not a version token, invalid shader.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
reg_maps
->
shader_version
=
shader_version
=
*
pToken
++
;
fe
->
shader_read_header
(
&
pToken
,
&
shader_version
);
reg_maps
->
shader_version
=
shader_version
;
pshader
=
shader_is_pshader_version
(
shader_version
);
while
(
!
fe
->
shader_is_end
(
&
pToken
))
...
...
@@ -868,7 +863,6 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER *buffer,
IWineD3DDeviceImpl
*
device
=
(
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
;
/* To access shader backend callbacks */
const
SHADER_OPCODE
*
opcode_table
=
This
->
baseShader
.
shader_ins
;
const
SHADER_HANDLER
*
handler_table
=
device
->
shader_backend
->
shader_instruction_handler_table
;
DWORD
shader_version
=
reg_maps
->
shader_version
;
struct
wined3d_shader_src_param
src_rel_addr
[
4
];
struct
wined3d_shader_src_param
src_param
[
4
];
struct
wined3d_shader_src_param
dst_rel_addr
;
...
...
@@ -877,6 +871,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER *buffer,
struct
wined3d_shader_context
ctx
;
const
DWORD
*
pToken
=
pFunction
;
SHADER_HANDLER
hw_fct
;
DWORD
shader_version
;
DWORD
i
;
/* Initialize current parsing state */
...
...
@@ -889,11 +884,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER *buffer,
ins
.
src
=
src_param
;
This
->
baseShader
.
parse_state
.
current_row
=
0
;
if
(
!
shader_is_version_token
(
*
pToken
++
))
{
ERR
(
"First token is not a version token, invalid shader.
\n
"
);
return
;
}
fe
->
shader_read_header
(
&
pToken
,
&
shader_version
);
while
(
!
fe
->
shader_is_end
(
&
pToken
))
{
...
...
@@ -995,13 +986,8 @@ void shader_trace_init(const struct wined3d_shader_frontend *fe,
TRACE
(
"Parsing %p
\n
"
,
pFunction
);
/* The version token is supposed to be the first token */
if
(
!
shader_is_version_token
(
*
pToken
))
{
FIXME
(
"First token is not a version token, invalid shader.
\n
"
);
return
;
}
shader_version
=
*
pToken
++
;
fe
->
shader_read_header
(
&
pToken
,
&
shader_version
);
TRACE
(
"%s_%u_%u
\n
"
,
shader_is_pshader_version
(
shader_version
)
?
"ps"
:
"vs"
,
WINED3DSHADER_VERSION_MAJOR
(
shader_version
),
WINED3DSHADER_VERSION_MINOR
(
shader_version
));
...
...
dlls/wined3d/shader_sm1.c
View file @
868f5bfc
...
...
@@ -221,6 +221,12 @@ static int shader_skip_unrecognized(const DWORD *ptr, DWORD shader_version)
return
tokens_read
;
}
static
void
shader_sm1_read_header
(
const
DWORD
**
ptr
,
DWORD
*
shader_version
)
{
TRACE
(
"version: 0x%08x
\n
"
,
**
ptr
);
*
shader_version
=
*
(
*
ptr
)
++
;
}
static
void
shader_sm1_read_opcode
(
const
DWORD
**
ptr
,
struct
wined3d_shader_instruction
*
ins
,
UINT
*
param_size
,
const
SHADER_OPCODE
*
opcode_table
,
DWORD
shader_version
)
{
...
...
@@ -318,6 +324,7 @@ static BOOL shader_sm1_is_end(const DWORD **ptr)
const
struct
wined3d_shader_frontend
sm1_shader_frontend
=
{
shader_sm1_read_header
,
shader_sm1_read_opcode
,
shader_sm1_read_src_param
,
shader_sm1_read_dst_param
,
...
...
dlls/wined3d/shader_sm4.c
View file @
868f5bfc
...
...
@@ -23,6 +23,14 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d_shader
);
static
void
shader_sm4_read_header
(
const
DWORD
**
ptr
,
DWORD
*
shader_version
)
{
TRACE
(
"version: 0x%08x
\n
"
,
**
ptr
);
*
shader_version
=
*
(
*
ptr
)
++
;
TRACE
(
"token count: %u
\n
"
,
**
ptr
);
++
(
*
ptr
);
}
static
void
shader_sm4_read_opcode
(
const
DWORD
**
ptr
,
struct
wined3d_shader_instruction
*
ins
,
UINT
*
param_size
,
const
SHADER_OPCODE
*
opcode_table
,
DWORD
shader_version
)
{
...
...
@@ -63,6 +71,7 @@ static BOOL shader_sm4_is_end(const DWORD **ptr)
const
struct
wined3d_shader_frontend
sm4_shader_frontend
=
{
shader_sm4_read_header
,
shader_sm4_read_opcode
,
shader_sm4_read_src_param
,
shader_sm4_read_dst_param
,
...
...
dlls/wined3d/wined3d_private.h
View file @
868f5bfc
...
...
@@ -674,6 +674,7 @@ struct wined3d_shader_semantic
struct
wined3d_shader_frontend
{
void
(
*
shader_read_header
)(
const
DWORD
**
ptr
,
DWORD
*
shader_version
);
void
(
*
shader_read_opcode
)(
const
DWORD
**
ptr
,
struct
wined3d_shader_instruction
*
ins
,
UINT
*
param_size
,
const
SHADER_OPCODE
*
opcode_table
,
DWORD
shader_version
);
void
(
*
shader_read_src_param
)(
const
DWORD
**
ptr
,
struct
wined3d_shader_src_param
*
src_param
,
...
...
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