Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
ee9b1311
Commit
ee9b1311
authored
Aug 18, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Separate loading shader resources and updating their binding points.
parent
8f6f9096
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
11 deletions
+38
-11
context.c
dlls/wined3d/context.c
+38
-11
No files found.
dlls/wined3d/context.c
View file @
ee9b1311
...
...
@@ -3044,6 +3044,42 @@ static void context_preload_textures(struct wined3d_context *context, const stru
}
}
static
void
context_load_shader_resources
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
)
{
struct
wined3d_shader_sampler_map_entry
*
entry
;
struct
wined3d_shader_resource_view
*
view
;
struct
wined3d_shader
*
shader
;
unsigned
int
i
,
j
;
for
(
i
=
0
;
i
<
WINED3D_SHADER_TYPE_COUNT
;
++
i
)
{
if
(
!
(
shader
=
state
->
shader
[
i
]))
continue
;
for
(
j
=
0
;
j
<
WINED3D_MAX_CBS
;
++
j
)
{
if
(
state
->
cb
[
i
][
j
])
buffer_internal_preload
(
state
->
cb
[
i
][
j
],
context
,
state
);
}
for
(
j
=
0
;
j
<
shader
->
reg_maps
.
sampler_map
.
count
;
++
j
)
{
entry
=
&
shader
->
reg_maps
.
sampler_map
.
entries
[
j
];
if
(
!
(
view
=
state
->
shader_resource_view
[
i
][
entry
->
resource_idx
]))
{
WARN
(
"No resource view bound at index %u, %u.
\n
"
,
i
,
entry
->
resource_idx
);
continue
;
}
if
(
view
->
resource
->
type
==
WINED3D_RTYPE_BUFFER
)
buffer_internal_preload
(
buffer_from_resource
(
view
->
resource
),
context
,
state
);
else
wined3d_texture_load
(
wined3d_texture_from_resource
(
view
->
resource
),
context
,
FALSE
);
}
}
}
static
void
context_bind_shader_resources
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
...
...
@@ -3102,7 +3138,6 @@ static void context_bind_shader_resources(struct wined3d_context *context, const
}
texture
=
wined3d_texture_from_resource
(
view
->
resource
);
wined3d_texture_load
(
texture
,
context
,
FALSE
);
context_active_texture
(
context
,
gl_info
,
shader_types
[
i
].
base_idx
+
entry
->
bind_idx
);
wined3d_texture_bind
(
texture
,
context
,
FALSE
);
...
...
@@ -3118,7 +3153,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de
const
struct
wined3d_state
*
state
=
&
device
->
state
;
const
struct
StateEntry
*
state_table
=
context
->
state_table
;
const
struct
wined3d_fb_state
*
fb
=
state
->
fb
;
unsigned
int
i
,
j
;
unsigned
int
i
;
WORD
map
;
if
(
!
context_validate_rt_config
(
context
->
gl_info
->
limits
.
buffers
,
...
...
@@ -3135,6 +3170,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de
* updating a resource location. */
context_update_tex_unit_map
(
context
,
state
);
context_preload_textures
(
context
,
state
);
context_load_shader_resources
(
context
,
state
);
/* TODO: Right now the dependency on the vertex shader is necessary
* since context_stream_info_from_declaration depends on the reg_maps of
* the current VS but maybe it's possible to relax the coupling in some
...
...
@@ -3160,15 +3196,6 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de
buffer_get_sysmem
(
state
->
index_buffer
,
context
);
}
for
(
i
=
0
;
i
<
WINED3D_SHADER_TYPE_COUNT
;
++
i
)
{
for
(
j
=
0
;
j
<
WINED3D_MAX_CBS
;
++
j
)
{
if
(
state
->
cb
[
i
][
j
])
buffer_internal_preload
(
state
->
cb
[
i
][
j
],
context
,
state
);
}
}
for
(
i
=
0
;
i
<
context
->
numDirtyEntries
;
++
i
)
{
DWORD
rep
=
context
->
dirtyArray
[
i
];
...
...
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