Module: wine
Branch: master
Commit: 01e668b00747be4a359e7a74f17bb40e2490d006
URL: http://source.winehq.org/git/wine.git/?a=commit;h=01e668b00747be4a359e7a74f…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Tue Jun 7 11:06:26 2011 +0200
wined3d: Use GL_DEPTH_COMPONENT as internal format for depth_blt_texture.
This also changes the texture level to always be zero while we're at it. In
practice depth/stencil textures should rarely have multiple levels, if ever,
but only 0 makes sense here.
---
dlls/wined3d/surface.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index c5c526b..ad217fc 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -5707,7 +5707,14 @@ void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_co
bind_target = GL_TEXTURE_2D;
}
glBindTexture(bind_target, device->depth_blt_texture);
- glCopyTexImage2D(bind_target, surface->texture_level, surface->resource.format->glInternal, 0, 0, w, h, 0);
+ /* We use GL_DEPTH_COMPONENT instead of the surface's specific
+ * internal format, because the internal format might include stencil
+ * data. In principle we should copy stencil data as well, but unless
+ * the driver supports stencil export it's hard to do, and doesn't
+ * seem to be needed in practice. If the hardware doesn't support
+ * writing stencil data, the glCopyTexImage2D() call might trigger
+ * software fallbacks. */
+ glCopyTexImage2D(bind_target, 0, GL_DEPTH_COMPONENT, 0, 0, w, h, 0);
glTexParameteri(bind_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(bind_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(bind_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
Module: wine
Branch: master
Commit: 95bd0ec61cafc2d848e00badc793db15d0b73b01
URL: http://source.winehq.org/git/wine.git/?a=commit;h=95bd0ec61cafc2d848e00badc…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Tue Jun 7 11:06:25 2011 +0200
wined3d: Just enable ARB_shader_texture_lod if it's available.
---
dlls/wined3d/glsl_shader.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 9b8cd5b..1cf7f22 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -3182,8 +3182,9 @@ static void shader_glsl_texldl(const struct wined3d_shader_instruction *ins)
if (!gl_info->supported[ARB_SHADER_TEXTURE_LOD] && !gl_info->supported[EXT_GPU_SHADER4]
&& shader_is_pshader_version(ins->ctx->reg_maps->shader_version.type))
{
- /* The GLSL spec claims the Lod sampling functions are only supported in vertex shaders.
- * However, they seem to work just fine in fragment shaders as well. */
+ /* Plain GLSL only supports Lod sampling functions in vertex shaders.
+ * However, the NVIDIA drivers allow them in fragment shaders as well,
+ * even without the appropriate extension. */
WARN("Using %s in fragment shader.\n", sample_function.name);
}
shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, swizzle, NULL, NULL, lod_param.param_str,
@@ -3993,7 +3994,7 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context
shader_addline(buffer, "#version 120\n");
- if (gl_info->supported[ARB_SHADER_TEXTURE_LOD] && reg_maps->usestexldd)
+ if (gl_info->supported[ARB_SHADER_TEXTURE_LOD])
{
shader_addline(buffer, "#extension GL_ARB_shader_texture_lod : enable\n");
}