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
74faebd6
Commit
74faebd6
authored
Aug 23, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store the current GLSL program per-context.
parent
98f3ecc3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
12 deletions
+40
-12
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+14
-4
context.c
dlls/wined3d/context.c
+8
-3
glsl_shader.c
dlls/wined3d/glsl_shader.c
+0
-0
shader.c
dlls/wined3d/shader.c
+13
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+5
-2
No files found.
dlls/wined3d/arb_program_shader.c
View file @
74faebd6
...
...
@@ -4779,7 +4779,7 @@ static void shader_arb_select(void *shader_priv, struct wined3d_context *context
/* Context activation is done by the caller. */
static
void
shader_arb_disable
(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
)
static
void
shader_arb_disable
(
void
*
shader_priv
,
struct
wined3d_context
*
context
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
struct
shader_arb_priv
*
priv
=
shader_priv
;
...
...
@@ -4806,6 +4806,10 @@ static void shader_arb_disable(void *shader_priv, const struct wined3d_context *
checkGLcall
(
"glClampColorARB"
);
priv
->
last_vs_color_unclamp
=
FALSE
;
}
context
->
shader_update_mask
=
(
1
<<
WINED3D_SHADER_TYPE_PIXEL
)
|
(
1
<<
WINED3D_SHADER_TYPE_VERTEX
)
|
(
1
<<
WINED3D_SHADER_TYPE_GEOMETRY
);
}
/* Context activation is done by the caller. */
...
...
@@ -5032,9 +5036,14 @@ static void shader_arb_free(struct wined3d_device *device)
HeapFree
(
GetProcessHeap
(),
0
,
device
->
shader_priv
);
}
static
void
shader_arb_context_destroyed
(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
)
static
BOOL
shader_arb_allocate_context_data
(
struct
wined3d_context
*
context
)
{
struct
shader_arb_priv
*
priv
=
shader_priv
;
return
TRUE
;
}
static
void
shader_arb_free_context_data
(
struct
wined3d_context
*
context
)
{
struct
shader_arb_priv
*
priv
=
context
->
swapchain
->
device
->
shader_priv
;
if
(
priv
->
last_context
==
context
)
priv
->
last_context
=
NULL
;
...
...
@@ -5712,7 +5721,8 @@ const struct wined3d_shader_backend_ops arb_program_shader_backend =
shader_arb_destroy
,
shader_arb_alloc
,
shader_arb_free
,
shader_arb_context_destroyed
,
shader_arb_allocate_context_data
,
shader_arb_free_context_data
,
shader_arb_get_caps
,
shader_arb_color_fixup_supported
,
shader_arb_has_ffp_proj_control
,
...
...
dlls/wined3d/context.c
View file @
74faebd6
...
...
@@ -1345,6 +1345,12 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
list_init
(
&
ret
->
fbo_list
);
list_init
(
&
ret
->
fbo_destroy_list
);
if
(
!
device
->
shader_backend
->
shader_allocate_context_data
(
ret
))
{
ERR
(
"Failed to allocate shader backend context data.
\n
"
);
goto
out
;
}
if
(
!
(
hdc
=
GetDC
(
swapchain
->
win_handle
)))
{
WARN
(
"Failed to retireve device context, trying swapchain backup.
\n
"
);
...
...
@@ -1639,6 +1645,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
return
ret
;
out:
device
->
shader_backend
->
shader_free_context_data
(
ret
);
HeapFree
(
GetProcessHeap
(),
0
,
ret
->
free_event_queries
);
HeapFree
(
GetProcessHeap
(),
0
,
ret
->
free_occlusion_queries
);
HeapFree
(
GetProcessHeap
(),
0
,
ret
->
draw_buffers
);
...
...
@@ -1671,6 +1678,7 @@ void context_destroy(struct wined3d_device *device, struct wined3d_context *cont
destroy
=
FALSE
;
}
device
->
shader_backend
->
shader_free_context_data
(
context
);
HeapFree
(
GetProcessHeap
(),
0
,
context
->
draw_buffers
);
HeapFree
(
GetProcessHeap
(),
0
,
context
->
blit_targets
);
device_context_remove
(
device
,
context
);
...
...
@@ -1903,9 +1911,6 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
/* Disable shaders */
device
->
shader_backend
->
shader_disable
(
device
->
shader_priv
,
context
);
context
->
shader_update_mask
=
(
1
<<
WINED3D_SHADER_TYPE_PIXEL
)
|
(
1
<<
WINED3D_SHADER_TYPE_VERTEX
)
|
(
1
<<
WINED3D_SHADER_TYPE_GEOMETRY
);
context
->
blit_w
=
rt_size
.
cx
;
context
->
blit_h
=
rt_size
.
cy
;
...
...
dlls/wined3d/glsl_shader.c
View file @
74faebd6
This diff is collapsed.
Click to expand it.
dlls/wined3d/shader.c
View file @
74faebd6
...
...
@@ -1512,7 +1512,7 @@ static void shader_none_update_float_pixel_constants(struct wined3d_device *devi
static
void
shader_none_load_constants
(
void
*
shader_priv
,
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
)
{}
static
void
shader_none_destroy
(
struct
wined3d_shader
*
shader
)
{}
static
void
shader_none_
context_destroyed
(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
)
{}
static
void
shader_none_
free_context_data
(
struct
wined3d_context
*
context
)
{}
/* Context activation is done by the caller. */
static
void
shader_none_select
(
void
*
shader_priv
,
struct
wined3d_context
*
context
,
...
...
@@ -1526,13 +1526,17 @@ static void shader_none_select(void *shader_priv, struct wined3d_context *contex
}
/* Context activation is done by the caller. */
static
void
shader_none_disable
(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
)
static
void
shader_none_disable
(
void
*
shader_priv
,
struct
wined3d_context
*
context
)
{
struct
shader_none_priv
*
priv
=
shader_priv
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
priv
->
vertex_pipe
->
vp_enable
(
gl_info
,
FALSE
);
priv
->
fragment_pipe
->
enable_extension
(
gl_info
,
FALSE
);
context
->
shader_update_mask
=
(
1
<<
WINED3D_SHADER_TYPE_PIXEL
)
|
(
1
<<
WINED3D_SHADER_TYPE_VERTEX
)
|
(
1
<<
WINED3D_SHADER_TYPE_GEOMETRY
);
}
static
HRESULT
shader_none_alloc
(
struct
wined3d_device
*
device
,
const
struct
wined3d_vertex_pipe_ops
*
vertex_pipe
,
...
...
@@ -1581,6 +1585,11 @@ static void shader_none_free(struct wined3d_device *device)
HeapFree
(
GetProcessHeap
(),
0
,
priv
);
}
static
BOOL
shader_none_allocate_context_data
(
struct
wined3d_context
*
context
)
{
return
TRUE
;
}
static
void
shader_none_get_caps
(
const
struct
wined3d_gl_info
*
gl_info
,
struct
shader_caps
*
caps
)
{
/* Set the shader caps to 0 for the none shader backend */
...
...
@@ -1620,7 +1629,8 @@ const struct wined3d_shader_backend_ops none_shader_backend =
shader_none_destroy
,
shader_none_alloc
,
shader_none_free
,
shader_none_context_destroyed
,
shader_none_allocate_context_data
,
shader_none_free_context_data
,
shader_none_get_caps
,
shader_none_color_fixup_supported
,
shader_none_has_ffp_proj_control
,
...
...
dlls/wined3d/wined3d_private.h
View file @
74faebd6
...
...
@@ -810,7 +810,7 @@ struct wined3d_shader_backend_ops
void
(
*
shader_handle_instruction
)(
const
struct
wined3d_shader_instruction
*
);
void
(
*
shader_select
)(
void
*
shader_priv
,
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
);
void
(
*
shader_disable
)(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
);
void
(
*
shader_disable
)(
void
*
shader_priv
,
struct
wined3d_context
*
context
);
void
(
*
shader_select_depth_blt
)(
void
*
shader_priv
,
const
struct
wined3d_gl_info
*
gl_info
,
enum
tex_types
tex_type
,
const
SIZE
*
ds_mask_size
);
void
(
*
shader_deselect_depth_blt
)(
void
*
shader_priv
,
const
struct
wined3d_gl_info
*
gl_info
);
...
...
@@ -822,7 +822,8 @@ struct wined3d_shader_backend_ops
HRESULT
(
*
shader_alloc_private
)(
struct
wined3d_device
*
device
,
const
struct
wined3d_vertex_pipe_ops
*
vertex_pipe
,
const
struct
fragment_pipeline
*
fragment_pipe
);
void
(
*
shader_free_private
)(
struct
wined3d_device
*
device
);
void
(
*
shader_context_destroyed
)(
void
*
shader_priv
,
const
struct
wined3d_context
*
context
);
BOOL
(
*
shader_allocate_context_data
)(
struct
wined3d_context
*
context
);
void
(
*
shader_free_context_data
)(
struct
wined3d_context
*
context
);
void
(
*
shader_get_caps
)(
const
struct
wined3d_gl_info
*
gl_info
,
struct
shader_caps
*
caps
);
BOOL
(
*
shader_color_fixup_supported
)(
struct
color_fixup_desc
fixup
);
BOOL
(
*
shader_has_ffp_proj_control
)(
void
*
shader_priv
);
...
...
@@ -1115,6 +1116,8 @@ struct wined3d_context
int
pixel_format
;
GLint
aux_buffers
;
void
*
shader_backend_data
;
/* FBOs */
UINT
fbo_entry_count
;
struct
list
fbo_list
;
...
...
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