wined3d: Avoid going through the texture units mapping when unnecessary.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2015-11-12 23:06:41 +01:00 committed by Alexandre Julliard
parent e449f90b20
commit 750dc790b7
1 changed files with 14 additions and 2 deletions

View File

@ -2616,11 +2616,16 @@ static void context_update_fixed_function_usage_map(struct wined3d_context *cont
static void context_map_fixed_function_samplers(struct wined3d_context *context,
const struct wined3d_state *state)
{
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
const struct wined3d_gl_info *gl_info = context->gl_info;
unsigned int i, tex;
WORD ffu_map;
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
context_update_fixed_function_usage_map(context, state);
if (gl_info->limits.combined_samplers >= MAX_COMBINED_SAMPLERS)
return;
ffu_map = context->fixed_function_usage_map;
if (d3d_info->limits.ffp_textures == d3d_info->limits.ffp_blend_stages
@ -2661,10 +2666,14 @@ static void context_map_fixed_function_samplers(struct wined3d_context *context,
static void context_map_psamplers(struct wined3d_context *context, const struct wined3d_state *state)
{
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
const struct wined3d_gl_info *gl_info = context->gl_info;
const struct wined3d_shader_resource_info *resource_info =
state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.resource_info;
unsigned int i;
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
if (gl_info->limits.combined_samplers >= MAX_COMBINED_SAMPLERS)
return;
for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i)
{
@ -2715,6 +2724,9 @@ static void context_map_vsamplers(struct wined3d_context *context, BOOL ps, cons
int start = min(MAX_COMBINED_SAMPLERS, gl_info->limits.combined_samplers) - 1;
int i;
if (gl_info->limits.combined_samplers >= MAX_COMBINED_SAMPLERS)
return;
/* Note that we only care if a resource is used or not, not the
* resource's specific type. Otherwise we'd need to call
* shader_update_samplers() here for 1.x pixelshaders. */