]> git.pld-linux.org Git - packages/Mesa.git/blob - i9x5-tex-ignore-the-diff-between-GL_TEXTURE_2D-and-GL_TEXTURE_RECTANGLE.patch
up to 21.0.0
[packages/Mesa.git] / i9x5-tex-ignore-the-diff-between-GL_TEXTURE_2D-and-GL_TEXTURE_RECTANGLE.patch
1 i965/tex: ignore the diff between GL_TEXTURE_2D and GL_TEXTURE_RECTANGLE
2
3 the difference between GL_TEXTURE_2D and GL_TEXTURE_RECTANGLE
4 doesn't matter as far as the miptree is concerned;
5 genX(update_sampler_state) only looks at the
6 gl_texture_object and not the miptree when determining whether or
7 not to use normalized coordinates.
8
9 Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
10
11 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107117
12 ---
13  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 10 +++++++++-
14  1 file changed, 9 insertions(+), 1 deletion(-)
15
16 diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
17 index 7d1fa96..dc45a06 100644
18 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
19 +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
20 @@ -58,6 +58,12 @@ static void *intel_miptree_map_raw(struct brw_context *brw,
21  
22  static void intel_miptree_unmap_raw(struct intel_mipmap_tree *mt);
23  
24 +static GLenum
25 +tex_rect_to_tex2d(GLenum val)
26 +{
27 +    return (GL_TEXTURE_RECTANGLE == val) ? GL_TEXTURE_2D : val;
28 +}
29 +
30  /**
31   * Return true if the format that will be used to access the miptree is
32   * CCS_E-compatible with the miptree's linear/non-sRGB format.
33 @@ -1320,13 +1326,15 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,
34  {
35     struct intel_texture_image *intelImage = intel_texture_image(image);
36     GLuint level = intelImage->base.Base.Level;
37 +   GLenum texObjTarget = tex_rect_to_tex2d(mt->target);
38 +   GLenum mipmapTreeTarget = tex_rect_to_tex2d(image->TexObject->Target);
39     int width, height, depth;
40  
41     /* glTexImage* choose the texture object based on the target passed in, and
42      * objects can't change targets over their lifetimes, so this should be
43      * true.
44      */
45 -   assert(image->TexObject->Target == mt->target);
46 +   assert(texObjTarget == mipmapTreeTarget);
47  
48     mesa_format mt_format = mt->format;
49     if (mt->format == MESA_FORMAT_Z24_UNORM_X8_UINT && mt->stencil_mt)
50 --- mesa-mesa-19.1.5/src/mesa/drivers/dri/i915/intel_mipmap_tree.c.orig 2019-08-26 23:37:27.779941449 +0200
51 +++ mesa-mesa-19.1.5/src/mesa/drivers/dri/i915/intel_mipmap_tree.c      2019-08-26 23:38:47.553273174 +0200
52 @@ -403,6 +403,12 @@
53     }
54  }
55  
56 +static GLenum
57 +tex_rect_to_tex2d(GLenum val)
58 +{
59 +    return (GL_TEXTURE_RECTANGLE == val) ? GL_TEXTURE_2D : val;
60 +}
61 +
62  /**
63   * Can the image be pulled into a unified mipmap tree?  This mirrors
64   * the completeness test in a lot of ways.
65 @@ -415,13 +421,15 @@
66  {
67     struct intel_texture_image *intelImage = intel_texture_image(image);
68     GLuint level = intelImage->base.Base.Level;
69 +   GLenum texObjTarget = tex_rect_to_tex2d(mt->target);
70 +   GLenum mipmapTreeTarget = tex_rect_to_tex2d(image->TexObject->Target);
71     int width, height, depth;
72  
73     /* glTexImage* choose the texture object based on the target passed in, and
74      * objects can't change targets over their lifetimes, so this should be
75      * true.
76      */
77 -   assert(target_to_target(image->TexObject->Target) == mt->target);
78 +   assert(texObjTarget == mipmapTreeTarget);
79  
80     mesa_format mt_format = mt->format;
81  
This page took 0.122609 seconds and 3 git commands to generate.