Commit 60e4722b authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Trigger constant update when an SRV requiring NPOT fixup is bound.

Ported from state_sampler(). This is currently relevant to the case where a d3d11 device is created with a 9.x feature level—this will have resources bound via SRVs [and will therefore go through wined3d_context_gl_bind_shader_resources() rather than state_sampler()] but need not support ARB_texture_non_power_of_two. The NPOT non-requirement is explicitly called out in the d3d11 documentation, and because we need some degree of emulation for conditional NPOT textures, we need to hook that up for feature level 9.x d3d11 devices as well. Looking forward, d3d 1-9 will be normalized to creating internal SRVs and binding those through the d3d10+ path, so this will also be necessary for that reason.
parent 831a41ee
...@@ -4290,12 +4290,6 @@ static BOOL context_apply_draw_state(struct wined3d_context *context, ...@@ -4290,12 +4290,6 @@ static BOOL context_apply_draw_state(struct wined3d_context *context,
context->shader_update_mask &= 1u << WINED3D_SHADER_TYPE_COMPUTE; context->shader_update_mask &= 1u << WINED3D_SHADER_TYPE_COMPUTE;
} }
if (context->constant_update_mask)
{
device->shader_backend->shader_load_constants(device->shader_priv, context, state);
context->constant_update_mask = 0;
}
if (context->update_shader_resource_bindings) if (context->update_shader_resource_bindings)
{ {
for (i = 0; i < WINED3D_SHADER_TYPE_GRAPHICS_COUNT; ++i) for (i = 0; i < WINED3D_SHADER_TYPE_GRAPHICS_COUNT; ++i)
...@@ -4317,6 +4311,12 @@ static BOOL context_apply_draw_state(struct wined3d_context *context, ...@@ -4317,6 +4311,12 @@ static BOOL context_apply_draw_state(struct wined3d_context *context,
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) if (wined3d_settings.offscreen_rendering_mode == ORM_FBO)
wined3d_context_gl_check_fbo_status(context_gl, GL_FRAMEBUFFER); wined3d_context_gl_check_fbo_status(context_gl, GL_FRAMEBUFFER);
if (context->constant_update_mask)
{
device->shader_backend->shader_load_constants(device->shader_priv, context, state);
context->constant_update_mask = 0;
}
context->last_was_blit = FALSE; context->last_was_blit = FALSE;
context->last_was_ffp_blit = FALSE; context->last_was_ffp_blit = FALSE;
......
...@@ -1266,6 +1266,10 @@ void wined3d_shader_resource_view_gl_bind(struct wined3d_shader_resource_view_gl ...@@ -1266,6 +1266,10 @@ void wined3d_shader_resource_view_gl_bind(struct wined3d_shader_resource_view_gl
texture_gl = wined3d_texture_gl(wined3d_texture_from_resource(view_gl->v.resource)); texture_gl = wined3d_texture_gl(wined3d_texture_from_resource(view_gl->v.resource));
wined3d_texture_gl_bind(texture_gl, context_gl, FALSE); wined3d_texture_gl_bind(texture_gl, context_gl, FALSE);
wined3d_sampler_gl_bind(sampler_gl, unit, texture_gl, context_gl); wined3d_sampler_gl_bind(sampler_gl, unit, texture_gl, context_gl);
/* Trigger shader constant reloading (for NP2 texcoord fixup) */
if (!(texture_gl->t.flags & WINED3D_TEXTURE_POW2_MAT_IDENT))
context_gl->c.constant_update_mask |= WINED3D_SHADER_CONST_PS_NP2_FIXUP;
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment