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
19d223ca
Commit
19d223ca
authored
Feb 27, 2007
by
H. Verbeet
Committed by
Alexandre Julliard
Feb 28, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store multiple constant indices per list entry.
parent
2c85e5e8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
37 deletions
+62
-37
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+19
-10
device.c
dlls/wined3d/device.c
+12
-6
glsl_shader.c
dlls/wined3d/glsl_shader.c
+24
-15
stateblock.c
dlls/wined3d/stateblock.c
+3
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-3
No files found.
dlls/wined3d/arb_program_shader.c
View file @
19d223ca
...
...
@@ -50,21 +50,30 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_constants);
*/
static
void
shader_arb_load_constantsF
(
IWineD3DBaseShaderImpl
*
This
,
WineD3D_GL_Info
*
gl_info
,
GLuint
target_type
,
unsigned
int
max_constants
,
float
*
constants
,
struct
list
*
constant_list
)
{
constant_entry
*
constant
;
constant
s
_entry
*
constant
;
local_constant
*
lconst
;
int
i
;
DWORD
i
,
j
;
DWORD
*
idx
;
if
(
TRACE_ON
(
d3d_shader
))
{
LIST_FOR_EACH_ENTRY
(
constant
,
constant_list
,
constant_entry
,
entry
)
{
i
=
constant
->
idx
;
TRACE_
(
d3d_constants
)(
"Loading constants %i: %f, %f, %f, %f
\n
"
,
i
,
constants
[
i
*
4
+
0
],
constants
[
i
*
4
+
1
],
constants
[
i
*
4
+
2
],
constants
[
i
*
4
+
3
]);
LIST_FOR_EACH_ENTRY
(
constant
,
constant_list
,
constants_entry
,
entry
)
{
idx
=
constant
->
idx
;
j
=
constant
->
count
;
while
(
j
--
)
{
i
=
*
idx
++
;
TRACE_
(
d3d_constants
)(
"Loading constants %i: %f, %f, %f, %f
\n
"
,
i
,
constants
[
i
*
4
+
0
],
constants
[
i
*
4
+
1
],
constants
[
i
*
4
+
2
],
constants
[
i
*
4
+
3
]);
}
}
}
LIST_FOR_EACH_ENTRY
(
constant
,
constant_list
,
constant_entry
,
entry
)
{
i
=
constant
->
idx
;
GL_EXTCALL
(
glProgramEnvParameter4fvARB
(
target_type
,
i
,
constants
+
(
i
*
4
)));
LIST_FOR_EACH_ENTRY
(
constant
,
constant_list
,
constants_entry
,
entry
)
{
idx
=
constant
->
idx
;
j
=
constant
->
count
;
while
(
j
--
)
{
i
=
*
idx
++
;
GL_EXTCALL
(
glProgramEnvParameter4fvARB
(
target_type
,
i
,
constants
+
(
i
*
4
)));
}
}
checkGLcall
(
"glProgramEnvParameter4fvARB()"
);
...
...
dlls/wined3d/device.c
View file @
19d223ca
...
...
@@ -2958,9 +2958,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShaderConstantF(
for
(
i
=
start
;
i
<
count
+
start
;
++
i
)
{
if
(
!
This
->
updateStateBlock
->
set
.
vertexShaderConstantsF
[
i
])
{
constant_entry
*
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
constant_entry
));
ptr
->
idx
=
i
;
list_add_head
(
&
This
->
updateStateBlock
->
set_vconstantsF
,
&
ptr
->
entry
);
constants_entry
*
ptr
=
LIST_ENTRY
(
list_head
(
&
This
->
updateStateBlock
->
set_vconstantsF
),
constants_entry
,
entry
);
if
(
!
ptr
||
ptr
->
count
>=
sizeof
(
ptr
->
idx
)
/
sizeof
(
*
ptr
->
idx
))
{
ptr
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
constants_entry
));
list_add_head
(
&
This
->
updateStateBlock
->
set_vconstantsF
,
&
ptr
->
entry
);
}
ptr
->
idx
[
ptr
->
count
++
]
=
i
;
This
->
updateStateBlock
->
set
.
vertexShaderConstantsF
[
i
]
=
TRUE
;
}
This
->
updateStateBlock
->
changed
.
vertexShaderConstantsF
[
i
]
=
TRUE
;
...
...
@@ -3238,9 +3241,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantF(
for
(
i
=
start
;
i
<
count
+
start
;
++
i
)
{
if
(
!
This
->
updateStateBlock
->
set
.
pixelShaderConstantsF
[
i
])
{
constant_entry
*
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
constant_entry
));
ptr
->
idx
=
i
;
list_add_head
(
&
This
->
updateStateBlock
->
set_pconstantsF
,
&
ptr
->
entry
);
constants_entry
*
ptr
=
LIST_ENTRY
(
list_head
(
&
This
->
updateStateBlock
->
set_pconstantsF
),
constants_entry
,
entry
);
if
(
!
ptr
||
ptr
->
count
>=
sizeof
(
ptr
->
idx
)
/
sizeof
(
*
ptr
->
idx
))
{
ptr
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
constants_entry
));
list_add_head
(
&
This
->
updateStateBlock
->
set_pconstantsF
,
&
ptr
->
entry
);
}
ptr
->
idx
[
ptr
->
count
++
]
=
i
;
This
->
updateStateBlock
->
set
.
pixelShaderConstantsF
[
i
]
=
TRUE
;
}
This
->
updateStateBlock
->
changed
.
pixelShaderConstantsF
[
i
]
=
TRUE
;
...
...
dlls/wined3d/glsl_shader.c
View file @
19d223ca
...
...
@@ -105,28 +105,37 @@ void shader_glsl_load_psamplers(
static
void
shader_glsl_load_constantsF
(
IWineD3DBaseShaderImpl
*
This
,
WineD3D_GL_Info
*
gl_info
,
unsigned
int
max_constants
,
float
*
constants
,
GLhandleARB
*
constant_locations
,
struct
list
*
constant_list
)
{
constant_entry
*
constant
;
constant
s
_entry
*
constant
;
local_constant
*
lconst
;
GLhandleARB
tmp_loc
;
int
i
;
DWORD
i
,
j
;
DWORD
*
idx
;
if
(
TRACE_ON
(
d3d_shader
))
{
LIST_FOR_EACH_ENTRY
(
constant
,
constant_list
,
constant_entry
,
entry
)
{
i
=
constant
->
idx
;
tmp_loc
=
constant_locations
[
i
];
if
(
tmp_loc
!=
-
1
)
{
TRACE_
(
d3d_constants
)(
"Loading constants %i: %f, %f, %f, %f
\n
"
,
i
,
constants
[
i
*
4
+
0
],
constants
[
i
*
4
+
1
],
constants
[
i
*
4
+
2
],
constants
[
i
*
4
+
3
]);
LIST_FOR_EACH_ENTRY
(
constant
,
constant_list
,
constants_entry
,
entry
)
{
idx
=
constant
->
idx
;
j
=
constant
->
count
;
while
(
j
--
)
{
i
=
*
idx
++
;
tmp_loc
=
constant_locations
[
i
];
if
(
tmp_loc
!=
-
1
)
{
TRACE_
(
d3d_constants
)(
"Loading constants %i: %f, %f, %f, %f
\n
"
,
i
,
constants
[
i
*
4
+
0
],
constants
[
i
*
4
+
1
],
constants
[
i
*
4
+
2
],
constants
[
i
*
4
+
3
]);
}
}
}
}
LIST_FOR_EACH_ENTRY
(
constant
,
constant_list
,
constant_entry
,
entry
)
{
i
=
constant
->
idx
;
tmp_loc
=
constant_locations
[
i
];
if
(
tmp_loc
!=
-
1
)
{
/* We found this uniform name in the program - go ahead and send the data */
GL_EXTCALL
(
glUniform4fvARB
(
tmp_loc
,
1
,
constants
+
(
i
*
4
)));
LIST_FOR_EACH_ENTRY
(
constant
,
constant_list
,
constants_entry
,
entry
)
{
idx
=
constant
->
idx
;
j
=
constant
->
count
;
while
(
j
--
)
{
i
=
*
idx
++
;
tmp_loc
=
constant_locations
[
i
];
if
(
tmp_loc
!=
-
1
)
{
/* We found this uniform name in the program - go ahead and send the data */
GL_EXTCALL
(
glUniform4fvARB
(
tmp_loc
,
1
,
constants
+
(
i
*
4
)));
}
}
}
checkGLcall
(
"glUniform4fvARB()"
);
...
...
dlls/wined3d/stateblock.c
View file @
19d223ca
...
...
@@ -249,7 +249,7 @@ static ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) {
TRACE
(
"(%p) : Releasing from %d
\n
"
,
This
,
refCount
+
1
);
if
(
!
refCount
)
{
constant_entry
*
constant
,
*
constant2
;
constant
s
_entry
*
constant
,
*
constant2
;
int
counter
;
/* type 0 represents the primary stateblock, so free all the resources */
...
...
@@ -284,11 +284,11 @@ static ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) {
HeapFree
(
GetProcessHeap
(),
0
,
This
->
set
.
pixelShaderConstantsF
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
changed
.
pixelShaderConstantsF
);
LIST_FOR_EACH_ENTRY_SAFE
(
constant
,
constant2
,
&
This
->
set_vconstantsF
,
constant_entry
,
entry
)
{
LIST_FOR_EACH_ENTRY_SAFE
(
constant
,
constant2
,
&
This
->
set_vconstantsF
,
constant
s
_entry
,
entry
)
{
HeapFree
(
GetProcessHeap
(),
0
,
constant
);
}
LIST_FOR_EACH_ENTRY_SAFE
(
constant
,
constant2
,
&
This
->
set_pconstantsF
,
constant_entry
,
entry
)
{
LIST_FOR_EACH_ENTRY_SAFE
(
constant
,
constant2
,
&
This
->
set_pconstantsF
,
constant
s
_entry
,
entry
)
{
HeapFree
(
GetProcessHeap
(),
0
,
constant
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
19d223ca
...
...
@@ -1194,9 +1194,10 @@ typedef struct SAVEDSTATES {
}
SAVEDSTATES
;
typedef
struct
{
struct
list
entry
;
int
idx
;
}
constant_entry
;
struct
list
entry
;
DWORD
count
;
DWORD
idx
[
13
];
}
constants_entry
;
struct
IWineD3DStateBlockImpl
{
...
...
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