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
a637fda7
Commit
a637fda7
authored
Jul 07, 2008
by
H. Verbeet
Committed by
Alexandre Julliard
Jul 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store the current GLSL program in the backend's private data.
parent
95099404
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
15 deletions
+11
-15
glsl_shader.c
dlls/wined3d/glsl_shader.c
+10
-7
stateblock.c
dlls/wined3d/stateblock.c
+0
-5
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-3
No files found.
dlls/wined3d/glsl_shader.c
View file @
a637fda7
...
...
@@ -369,13 +369,14 @@ void shader_glsl_load_constants(
char
useVertexShader
)
{
IWineD3DDeviceImpl
*
deviceImpl
=
(
IWineD3DDeviceImpl
*
)
device
;
struct
shader_glsl_priv
*
priv
=
(
struct
shader_glsl_priv
*
)
deviceImpl
->
shader_priv
;
IWineD3DStateBlockImpl
*
stateBlock
=
deviceImpl
->
stateBlock
;
WineD3D_GL_Info
*
gl_info
=
&
deviceImpl
->
adapter
->
gl_info
;
GLhandleARB
*
constant_locations
;
struct
list
*
constant_list
;
GLhandleARB
programId
;
struct
glsl_shader_prog_link
*
prog
=
stateBlock
->
glsl_program
;
struct
glsl_shader_prog_link
*
prog
=
priv
->
glsl_program
;
unsigned
int
i
;
if
(
!
prog
)
{
...
...
@@ -3145,6 +3146,7 @@ static void hardcode_local_constants(IWineD3DBaseShaderImpl *shader, WineD3D_GL_
*/
static
void
set_glsl_shader_program
(
IWineD3DDevice
*
iface
,
BOOL
use_ps
,
BOOL
use_vs
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
struct
shader_glsl_priv
*
priv
=
(
struct
shader_glsl_priv
*
)
This
->
shader_priv
;
WineD3D_GL_Info
*
gl_info
=
&
This
->
adapter
->
gl_info
;
IWineD3DPixelShader
*
pshader
=
This
->
stateBlock
->
pixelShader
;
IWineD3DVertexShader
*
vshader
=
This
->
stateBlock
->
vertexShader
;
...
...
@@ -3158,7 +3160,7 @@ static void set_glsl_shader_program(IWineD3DDevice *iface, BOOL use_ps, BOOL use
GLhandleARB
pshader_id
=
use_ps
?
((
IWineD3DBaseShaderImpl
*
)
pshader
)
->
baseShader
.
prgId
:
0
;
entry
=
get_glsl_program_entry
(
This
,
vshader_id
,
pshader_id
);
if
(
entry
)
{
This
->
stateBlock
->
glsl_program
=
entry
;
priv
->
glsl_program
=
entry
;
return
;
}
...
...
@@ -3175,7 +3177,7 @@ static void set_glsl_shader_program(IWineD3DDevice *iface, BOOL use_ps, BOOL use
add_glsl_program_entry
(
This
,
entry
);
/* Set the current program */
This
->
stateBlock
->
glsl_program
=
entry
;
priv
->
glsl_program
=
entry
;
/* Attach GLSL vshader */
if
(
vshader_id
)
{
...
...
@@ -3356,16 +3358,17 @@ static GLhandleARB create_glsl_blt_shader(WineD3D_GL_Info *gl_info) {
static
void
shader_glsl_select
(
IWineD3DDevice
*
iface
,
BOOL
usePS
,
BOOL
useVS
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
struct
shader_glsl_priv
*
priv
=
(
struct
shader_glsl_priv
*
)
This
->
shader_priv
;
WineD3D_GL_Info
*
gl_info
=
&
This
->
adapter
->
gl_info
;
GLhandleARB
program_id
=
0
;
GLenum
old_vertex_color_clamp
,
current_vertex_color_clamp
;
old_vertex_color_clamp
=
This
->
stateBlock
->
glsl_program
?
This
->
stateBlock
->
glsl_program
->
vertex_color_clamp
:
GL_FIXED_ONLY_ARB
;
old_vertex_color_clamp
=
priv
->
glsl_program
?
priv
->
glsl_program
->
vertex_color_clamp
:
GL_FIXED_ONLY_ARB
;
if
(
useVS
||
usePS
)
set_glsl_shader_program
(
iface
,
usePS
,
useVS
);
else
This
->
stateBlock
->
glsl_program
=
NULL
;
else
priv
->
glsl_program
=
NULL
;
current_vertex_color_clamp
=
This
->
stateBlock
->
glsl_program
?
This
->
stateBlock
->
glsl_program
->
vertex_color_clamp
:
GL_FIXED_ONLY_ARB
;
current_vertex_color_clamp
=
priv
->
glsl_program
?
priv
->
glsl_program
->
vertex_color_clamp
:
GL_FIXED_ONLY_ARB
;
if
(
old_vertex_color_clamp
!=
current_vertex_color_clamp
)
{
if
(
GL_SUPPORT
(
ARB_COLOR_BUFFER_FLOAT
))
{
...
...
@@ -3376,7 +3379,7 @@ static void shader_glsl_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {
}
}
program_id
=
This
->
stateBlock
->
glsl_program
?
This
->
stateBlock
->
glsl_program
->
programId
:
0
;
program_id
=
priv
->
glsl_program
?
priv
->
glsl_program
->
programId
:
0
;
if
(
program_id
)
TRACE
(
"Using GLSL program %u
\n
"
,
program_id
);
GL_EXTCALL
(
glUseProgramObjectARB
(
program_id
));
checkGLcall
(
"glUseProgramObjectARB"
);
...
...
dlls/wined3d/stateblock.c
View file @
a637fda7
...
...
@@ -170,7 +170,6 @@ void stateblock_copy(
Dest
->
viewport
=
This
->
viewport
;
Dest
->
material
=
This
->
material
;
Dest
->
pixelShader
=
This
->
pixelShader
;
Dest
->
glsl_program
=
This
->
glsl_program
;
Dest
->
scissorRect
=
This
->
scissorRect
;
/* Lights */
...
...
@@ -1240,10 +1239,6 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat
This
->
textures
[
i
]
=
NULL
;
}
/* Set default GLSL program to NULL. We won't actually create one
* until the app sets a vertex or pixel shader */
This
->
glsl_program
=
NULL
;
TRACE
(
"-----------------------> Device defaults now set up...
\n
"
);
return
WINED3D_OK
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
a637fda7
...
...
@@ -312,6 +312,7 @@ extern const shader_backend_t none_shader_backend;
/* GLSL shader private data */
struct
shader_glsl_priv
{
struct
glsl_shader_prog_link
*
glsl_program
;
GLhandleARB
depth_blt_glsl_program_id
;
};
...
...
@@ -1610,9 +1611,6 @@ struct IWineD3DStateBlockImpl
/* Sampler States */
DWORD
samplerState
[
MAX_COMBINED_SAMPLERS
][
WINED3D_HIGHEST_SAMPLER_STATE
+
1
];
/* Current GLSL Shader Program */
struct
glsl_shader_prog_link
*
glsl_program
;
/* Scissor test rectangle */
RECT
scissorRect
;
...
...
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