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
5859d877
Commit
5859d877
authored
Jun 25, 2009
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement function calls with NV exts.
parent
031401a0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
7 deletions
+40
-7
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+33
-4
baseshader.c
dlls/wined3d/baseshader.c
+5
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-1
No files found.
dlls/wined3d/arb_program_shader.c
View file @
5859d877
...
...
@@ -2797,6 +2797,35 @@ static void shader_hw_texldl(const struct wined3d_shader_instruction *ins)
shader_hw_sample
(
ins
,
sampler_idx
,
reg_dest
,
reg_coord
,
flags
,
NULL
,
NULL
);
}
static
void
shader_hw_label
(
const
struct
wined3d_shader_instruction
*
ins
)
{
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
struct
shader_arb_ctx_priv
*
priv
=
ins
->
ctx
->
backend_data
;
/* Call instructions activate the NV extensions, not labels and rets. If there is an uncalled
* subroutine, don't generate a label that will make GL complain
*/
if
(
priv
->
target_version
==
ARB
)
return
;
shader_addline
(
buffer
,
"l%u:
\n
"
,
ins
->
src
[
0
].
reg
.
idx
);
}
static
void
shader_hw_ret
(
const
struct
wined3d_shader_instruction
*
ins
)
{
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
struct
shader_arb_ctx_priv
*
priv
=
ins
->
ctx
->
backend_data
;
if
(
priv
->
target_version
==
ARB
)
return
;
shader_addline
(
buffer
,
"RET;
\n
"
);
}
static
void
shader_hw_call
(
const
struct
wined3d_shader_instruction
*
ins
)
{
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
shader_addline
(
buffer
,
"CAL l%u;
\n
"
,
ins
->
src
[
0
].
reg
.
idx
);
}
/* GL locking is done by the caller */
static
GLuint
create_arb_blt_vertex_program
(
const
WineD3D_GL_Info
*
gl_info
)
{
...
...
@@ -3079,7 +3108,7 @@ static GLuint shader_arb_generate_pshader(IWineD3DPixelShaderImpl *This,
* So enable the best we can get.
*/
if
(
reg_maps
->
usesdsx
||
reg_maps
->
usesdsy
||
reg_maps
->
loop_depth
>
0
||
reg_maps
->
usestexldd
||
reg_maps
->
usestexldl
||
reg_maps
->
usesfacing
||
reg_maps
->
usesifc
)
reg_maps
->
usestexldl
||
reg_maps
->
usesfacing
||
reg_maps
->
usesifc
||
reg_maps
->
usescall
)
{
want_nv_prog
=
TRUE
;
}
...
...
@@ -4388,7 +4417,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_BREAK */
shader_hw_break
,
/* WINED3DSIH_BREAKC */
shader_hw_breakc
,
/* WINED3DSIH_BREAKP */
NULL
,
/* WINED3DSIH_CALL */
NULL
,
/* WINED3DSIH_CALL */
shader_hw_call
,
/* WINED3DSIH_CALLNZ */
NULL
,
/* WINED3DSIH_CMP */
pshader_hw_cmp
,
/* WINED3DSIH_CND */
pshader_hw_cnd
,
...
...
@@ -4412,7 +4441,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_FRC */
shader_hw_map2gl
,
/* WINED3DSIH_IF */
NULL
/* Hardcoded into the shader */
,
/* WINED3DSIH_IFC */
shader_hw_ifc
,
/* WINED3DSIH_LABEL */
NULL
,
/* WINED3DSIH_LABEL */
shader_hw_label
,
/* WINED3DSIH_LIT */
shader_hw_map2gl
,
/* WINED3DSIH_LOG */
shader_hw_log_pow
,
/* WINED3DSIH_LOGP */
shader_hw_log_pow
,
...
...
@@ -4435,7 +4464,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
/* WINED3DSIH_POW */
shader_hw_log_pow
,
/* WINED3DSIH_RCP */
shader_hw_rsq_rcp
,
/* WINED3DSIH_REP */
shader_hw_rep
,
/* WINED3DSIH_RET */
NULL
,
/* WINED3DSIH_RET */
shader_hw_ret
,
/* WINED3DSIH_RSQ */
shader_hw_rsq_rcp
,
/* WINED3DSIH_SETP */
NULL
,
/* WINED3DSIH_SGE */
shader_hw_map2gl
,
...
...
dlls/wined3d/baseshader.c
View file @
5859d877
...
...
@@ -709,6 +709,10 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
{
reg_maps
->
usesifc
=
1
;
}
else
if
(
ins
.
handler_idx
==
WINED3DSIH_CALL
)
{
reg_maps
->
usescall
=
1
;
}
limit
=
ins
.
src_count
+
(
ins
.
predicate
?
1
:
0
);
for
(
i
=
0
;
i
<
limit
;
++
i
)
...
...
@@ -1089,8 +1093,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER *buffer,
||
ins
.
handler_idx
==
WINED3DSIH_DEF
||
ins
.
handler_idx
==
WINED3DSIH_DEFI
||
ins
.
handler_idx
==
WINED3DSIH_DEFB
||
ins
.
handler_idx
==
WINED3DSIH_PHASE
||
ins
.
handler_idx
==
WINED3DSIH_RET
)
||
ins
.
handler_idx
==
WINED3DSIH_PHASE
)
{
pToken
+=
param_size
;
continue
;
...
...
dlls/wined3d/wined3d_private.h
View file @
5859d877
...
...
@@ -641,7 +641,8 @@ typedef struct shader_reg_maps
unsigned
fog
:
1
;
unsigned
usestexldl
:
1
;
unsigned
usesifc
:
1
;
unsigned
padding
:
5
;
unsigned
usescall
:
1
;
unsigned
padding
:
4
;
/* Whether or not loops are used in this shader, and nesting depth */
unsigned
loop_depth
;
...
...
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