~mmach/netext73/mesa-ryzen

« back to all changes in this revision

Viewing changes to src/gallium/drivers/svga/svga_state_sampler.c

  • 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:
63
63
 * This helper function returns TRUE if the specified resource collides with
64
64
 * any of the resources bound to any of the currently bound sampler views.
65
65
 */
66
 
boolean
 
66
bool
67
67
svga_check_sampler_view_resource_collision(const struct svga_context *svga,
68
68
                                           const struct svga_winsys_surface *res,
69
69
                                           enum pipe_shader_type shader)
72
72
   unsigned i;
73
73
 
74
74
   if (svga_screen(screen)->debug.no_surface_view) {
75
 
      return FALSE;
 
75
      return false;
76
76
   }
77
77
 
78
78
   for (i = 0; i < svga->curr.num_sampler_views[shader]; i++) {
80
80
         svga_pipe_sampler_view(svga->curr.sampler_views[shader][i]);
81
81
 
82
82
      if (sv && res == svga_resource_handle(sv->base.texture)) {
83
 
         return TRUE;
 
83
         return true;
84
84
      }
85
85
   }
86
86
 
87
 
   return FALSE;
 
87
   return false;
88
88
}
89
89
 
90
90
 
92
92
 * Check if there are any resources that are both bound to a render target
93
93
 * and bound as a shader resource for the given type of shader.
94
94
 */
95
 
boolean
 
95
bool
96
96
svga_check_sampler_framebuffer_resource_collision(struct svga_context *svga,
97
97
                                                  enum pipe_shader_type shader)
98
98
{
104
104
      if (surf &&
105
105
          svga_check_sampler_view_resource_collision(svga, surf->handle,
106
106
                                                     shader)) {
107
 
         return TRUE;
 
107
         return true;
108
108
      }
109
109
   }
110
110
 
111
111
   surf = svga_surface(svga->curr.framebuffer.zsbuf);
112
112
   if (surf &&
113
113
       svga_check_sampler_view_resource_collision(svga, surf->handle, shader)) {
114
 
      return TRUE;
 
114
      return true;
115
115
   }
116
116
 
117
 
   return FALSE;
 
117
   return false;
118
118
}
119
119
 
120
120
 
300
300
             * shader resource list.
301
301
             */
302
302
            for (i = 0; i < nviews; i++) {
303
 
                boolean emit;
 
303
                bool emit;
304
304
 
305
305
                emit = sampler_views[i] ==
306
306
                       svga->state.hw_draw.sampler_views[shader][i];
309
309
                   /* Include the last sampler view in the next emit
310
310
                    * if it is different.
311
311
                    */
312
 
                   emit = TRUE;
 
312
                   emit = true;
313
313
                   numSR++;
314
314
                   i++;
315
315
                }
401
401
      SVGA3dSamplerId ids[PIPE_MAX_SAMPLERS*2];
402
402
      unsigned i;
403
403
      unsigned nsamplers = 0;
404
 
      boolean sampler_state_mapping =
 
404
      bool sampler_state_mapping =
405
405
         svga_use_sampler_state_mapping(svga, count);
406
406
 
407
407
      for (i = 0; i < count; i++) {
598
598
          * shader resource list.
599
599
          */
600
600
         for (i = 0; i < nviews; i++) {
601
 
            boolean emit;
 
601
            bool emit;
602
602
 
603
603
            emit = sampler_views[i] ==
604
604
                   svga->state.hw_draw.sampler_views[shader][i];
607
607
               /* Include the last sampler view in the next emit
608
608
                * if it is different.
609
609
                */
610
 
               emit = TRUE;
 
610
               emit = true;
611
611
               numSR++;
612
612
               i++;
613
613
            }