~mmach/netext73/mesa-ryzen

« back to all changes in this revision

Viewing changes to src/gallium/drivers/svga/svga_resource_texture.h

  • Committer: mmach
  • Date: 2023-11-02 21:31:35 UTC
  • Revision ID: netbit73@gmail.com-20231102213135-18d4tzh7tj0uz752
2023-11-02 22:11:57

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#define SVGA_TEXTURE_H
28
28
 
29
29
 
30
 
#include "pipe/p_compiler.h"
 
30
#include "util/compiler.h"
31
31
#include "pipe/p_state.h"
32
32
#include "util/u_inlines.h"
33
33
#include "util/u_memory.h"
48
48
{
49
49
   struct pipe_resource b;
50
50
 
51
 
   ushort *defined;
 
51
   uint16_t *defined;
52
52
 
53
53
   struct svga_sampler_view *cached_view;
54
54
 
55
55
   unsigned view_age[SVGA_MAX_TEXTURE_LEVELS];
56
56
   unsigned age;
57
57
 
58
 
   boolean views_modified;
 
58
   bool views_modified;
59
59
 
60
60
   /**
61
61
    * Creation key for the host surface handle.
78
78
    * Whether the host side surface is imported and not created by this
79
79
    * driver.
80
80
    */
81
 
   boolean imported;
 
81
   bool imported;
82
82
 
83
83
   /**
84
84
    * Whether texture upload buffer can be used on this texture
85
85
    */
86
 
   boolean can_use_upload;
 
86
   bool can_use_upload;
87
87
 
88
88
   /**
89
89
    * Whether texture is modified.  Set if any of the dirty bits is set.
90
90
    */
91
 
   boolean modified;
 
91
   bool modified;
92
92
 
93
93
   unsigned size;  /**< Approximate size in bytes */
94
94
 
95
95
   /** array indexed by cube face or 3D/array slice, one bit per mipmap level */
96
 
   ushort *rendered_to;
 
96
   uint16_t *rendered_to;
97
97
 
98
98
   /** array indexed by cube face or 3D/array slice, one bit per mipmap level.
99
99
    *  Set if the level is marked as dirty.
100
100
    */
101
 
   ushort *dirty;
 
101
   uint16_t *dirty;
102
102
 
103
103
   enum svga_surface_state surface_state;
104
104
 
136
136
   /* True if guest backed surface is supported and we can directly map
137
137
    * to the surface for this transfer.
138
138
    */
139
 
   boolean use_direct_map;
 
139
   bool use_direct_map;
140
140
 
141
141
   struct {
142
142
      struct pipe_resource *buf;  /* points to the upload buffer if this
235
235
   tex->surface_state = SVGA_SURFACE_STATE_UPDATED;
236
236
}
237
237
 
238
 
static inline boolean
 
238
static inline bool
239
239
svga_was_texture_rendered_to(const struct svga_texture *tex)
240
240
{
241
241
   return (tex->surface_state == SVGA_SURFACE_STATE_RENDERED);
247
247
{
248
248
   check_face_level(tex, face, level);
249
249
   tex->dirty[face] |= 1 << level;
250
 
   tex->modified = TRUE;
 
250
   tex->modified = true;
251
251
}
252
252
 
253
253
static inline void
257
257
   for (i = 0; i < tex->b.depth0 * tex->b.array_size; i++) {
258
258
      tex->dirty[i] = 0;
259
259
   }
260
 
   tex->modified = FALSE;
 
260
   tex->modified = false;
261
261
}
262
262
 
263
 
static inline boolean
 
263
static inline bool
264
264
svga_is_texture_level_dirty(const struct svga_texture *tex,
265
265
                            unsigned face, unsigned level)
266
266
{
268
268
   return !!(tex->dirty[face] & (1 << level));
269
269
}
270
270
 
271
 
static inline boolean
 
271
static inline bool
272
272
svga_is_texture_dirty(const struct svga_texture *tex)
273
273
{
274
274
   return tex->modified;
299
299
                             unsigned first_layer,
300
300
                             unsigned last_layer);
301
301
 
302
 
boolean
 
302
bool
303
303
svga_texture_transfer_map_upload_create(struct svga_context *svga);
304
304
 
305
305
void
306
306
svga_texture_transfer_map_upload_destroy(struct svga_context *svga);
307
307
 
308
 
boolean
 
308
bool
309
309
svga_texture_transfer_map_can_upload(const struct svga_screen *svgascreen,
310
310
                                     const struct pipe_resource *pt);
311
311
 
317
317
svga_texture_transfer_unmap_upload(struct svga_context *svga,
318
318
                                   struct svga_transfer *st);
319
319
 
320
 
boolean
 
320
bool
321
321
svga_texture_device_format_has_alpha(struct pipe_resource *texture);
322
322
 
323
323
void *