r600g,radeonsi: properly expose texture buffer formats
authorMarek Olšák <marek.olsak@amd.com>
Thu, 31 Oct 2013 14:32:30 +0000 (15:32 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 4 Nov 2013 18:07:57 +0000 (19:07 +0100)
This exposes GL_ARB_texture_buffer_object_rgb32.

src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/radeonsi/si_state.c

index 4535d219dd136ee50ce7a8e6d7efbce4f4e93c70..a4a4e3e94512b3430a968b8ac2220bb22e304f6c 100644 (file)
@@ -711,9 +711,14 @@ boolean evergreen_is_format_supported(struct pipe_screen *screen,
                }
        }
 
-       if ((usage & PIPE_BIND_SAMPLER_VIEW) &&
-           r600_is_sampler_format_supported(screen, format)) {
-               retval |= PIPE_BIND_SAMPLER_VIEW;
+       if (usage & PIPE_BIND_SAMPLER_VIEW) {
+               if (target == PIPE_BUFFER) {
+                       if (r600_is_vertex_format_supported(format))
+                               retval |= PIPE_BIND_SAMPLER_VIEW;
+               } else {
+                       if (r600_is_sampler_format_supported(screen, format))
+                               retval |= PIPE_BIND_SAMPLER_VIEW;
+               }
        }
 
        if ((usage & (PIPE_BIND_RENDER_TARGET |
index f1480526587e24fbda654a38a552a9dd264c33dc..41e9c5dfbdb64cb47f042f0aabc6a73e5df8728a 100644 (file)
@@ -649,9 +649,14 @@ boolean r600_is_format_supported(struct pipe_screen *screen,
                }
        }
 
-       if ((usage & PIPE_BIND_SAMPLER_VIEW) &&
-           r600_is_sampler_format_supported(screen, format)) {
-               retval |= PIPE_BIND_SAMPLER_VIEW;
+       if (usage & PIPE_BIND_SAMPLER_VIEW) {
+               if (target == PIPE_BUFFER) {
+                       if (r600_is_vertex_format_supported(format))
+                               retval |= PIPE_BIND_SAMPLER_VIEW;
+               } else {
+                       if (r600_is_sampler_format_supported(screen, format))
+                               retval |= PIPE_BIND_SAMPLER_VIEW;
+               }
        }
 
        if ((usage & (PIPE_BIND_RENDER_TARGET |
index 36aff008057007043575912762d5b151d7017299..0d743445f7bd6e084d92025f938c60674e719616 100644 (file)
@@ -1497,9 +1497,14 @@ boolean si_is_format_supported(struct pipe_screen *screen,
                }
        }
 
-       if ((usage & PIPE_BIND_SAMPLER_VIEW) &&
-           si_is_sampler_format_supported(screen, format)) {
-               retval |= PIPE_BIND_SAMPLER_VIEW;
+       if (usage & PIPE_BIND_SAMPLER_VIEW) {
+               if (target == PIPE_BUFFER) {
+                       if (si_is_vertex_format_supported(screen, format))
+                               retval |= PIPE_BIND_SAMPLER_VIEW;
+               } else {
+                       if (si_is_sampler_format_supported(screen, format))
+                               retval |= PIPE_BIND_SAMPLER_VIEW;
+               }
        }
 
        if ((usage & (PIPE_BIND_RENDER_TARGET |