Subversion Repositories Kolibri OS

Rev

Rev 4358 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4358 Rev 4401
Line 92... Line 92...
92
   return 4;
92
   return 4;
93
}
93
}
Line 94... Line 94...
94
 
94
 
95
static unsigned int
95
static unsigned int
96
intel_vertical_texture_alignment_unit(struct brw_context *brw,
96
intel_vertical_texture_alignment_unit(struct brw_context *brw,
97
                                     gl_format format)
97
                                      gl_format format, bool multisampled)
98
{
98
{
99
   /**
99
   /**
100
    * From the "Alignment Unit Size" section of various specs, namely:
100
    * From the "Alignment Unit Size" section of various specs, namely:
101
    * - Gen3 Spec: "Memory Data Formats" Volume,         Section 1.20.1.4
101
    * - Gen3 Spec: "Memory Data Formats" Volume,         Section 1.20.1.4
Line 116... Line 116...
116
    * | All Others                             |  2  |  2  |  2  |  2  |  2  |
116
    * | All Others                             |  2  |  2  |  2  |  2  |  2  |
117
    * +----------------------------------------------------------------------+
117
    * +----------------------------------------------------------------------+
118
    *
118
    *
119
    * On SNB+, non-special cases can be overridden by setting the SURFACE_STATE
119
    * On SNB+, non-special cases can be overridden by setting the SURFACE_STATE
120
    * "Surface Vertical Alignment" field to VALIGN_2 or VALIGN_4.
120
    * "Surface Vertical Alignment" field to VALIGN_2 or VALIGN_4.
121
    *
-
 
122
    * We currently don't support multisampling.
-
 
123
    */
121
    */
124
   if (_mesa_is_format_compressed(format))
122
   if (_mesa_is_format_compressed(format))
125
      return 4;
123
      return 4;
Line 126... Line 124...
126
 
124
 
127
   if (format == MESA_FORMAT_S8)
125
   if (format == MESA_FORMAT_S8)
Line -... Line 126...
-
 
126
      return brw->gen >= 7 ? 8 : 4;
-
 
127
 
-
 
128
   if (multisampled)
128
      return brw->gen >= 7 ? 8 : 4;
129
      return 4;
Line 129... Line 130...
129
 
130
 
130
   GLenum base_format = _mesa_get_format_base_format(format);
131
   GLenum base_format = _mesa_get_format_base_format(format);
131
 
132
 
Line 282... Line 283...
282
}
283
}
Line 283... Line 284...
283
 
284
 
284
void
285
void
285
brw_miptree_layout(struct brw_context *brw, struct intel_mipmap_tree *mt)
286
brw_miptree_layout(struct brw_context *brw, struct intel_mipmap_tree *mt)
-
 
287
{
286
{
288
   bool multisampled = mt->num_samples > 1;
-
 
289
   mt->align_w = intel_horizontal_texture_alignment_unit(brw, mt->format);
287
   mt->align_w = intel_horizontal_texture_alignment_unit(brw, mt->format);
290
   mt->align_h =
Line 288... Line 291...
288
   mt->align_h = intel_vertical_texture_alignment_unit(brw, mt->format);
291
      intel_vertical_texture_alignment_unit(brw, mt->format, multisampled);
289
 
292
 
290
   switch (mt->target) {
293
   switch (mt->target) {
291
   case GL_TEXTURE_CUBE_MAP:
294
   case GL_TEXTURE_CUBE_MAP: