radeonsi: clean up si_get_param
authorMarek Olšák <marek.olsak@amd.com>
Sat, 11 Feb 2017 16:21:04 +0000 (17:21 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 14 Feb 2017 20:47:51 +0000 (21:47 +0100)
has_streamout is always true

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_pipe.c

index 853d850ffab978879742c04e5adfb56770228daa..880602745c3fdb4d944d23c2c66d2d3aea833ac1 100644 (file)
@@ -334,6 +334,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
 
        switch (param) {
        /* Supported features (boolean caps). */
+       case PIPE_CAP_ACCELERATED:
        case PIPE_CAP_TWO_SIDED_STENCIL:
        case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
        case PIPE_CAP_ANISOTROPIC_FILTER:
@@ -414,6 +415,8 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
        case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
        case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
+       case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
+       case PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS:
                return 1;
 
        case PIPE_CAP_DOUBLES:
@@ -443,7 +446,10 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
        case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
        case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS:
+       case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
+       case PIPE_CAP_MAX_VERTEX_STREAMS:
                return 4;
+
        case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
                return HAVE_LLVM >= 0x0309 ? 4 : 0;
 
@@ -456,10 +462,8 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
                return MIN2(sscreen->b.info.max_alloc_size, INT_MAX);
 
-       case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
-               return 0;
-
        /* Unsupported features. */
+       case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
        case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
        case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
        case PIPE_CAP_USER_VERTEX_BUFFERS:
@@ -472,6 +476,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_NATIVE_FENCE_FD:
        case PIPE_CAP_TGSI_FS_FBFETCH:
        case PIPE_CAP_TGSI_MUL_ZERO_WINS:
+       case PIPE_CAP_UMA:
                return 0;
 
        case PIPE_CAP_QUERY_BUFFER_OBJECT:
@@ -489,22 +494,15 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
                return PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_R600;
 
        /* Stream output. */
-       case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
-               return sscreen->b.has_streamout ? 4 : 0;
-       case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
-       case PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS:
-               return sscreen->b.has_streamout ? 1 : 0;
        case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
        case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
-               return sscreen->b.has_streamout ? 32*4 : 0;
+               return 32*4;
 
        /* Geometry shader output. */
        case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
                return 1024;
        case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
                return 4095;
-       case PIPE_CAP_MAX_VERTEX_STREAMS:
-               return 4;
 
        case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
                return 2048;
@@ -520,13 +518,11 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
                /* textures support 8192, but layered rendering supports 2048 */
                return 2048;
 
-       /* Render targets. */
-       case PIPE_CAP_MAX_RENDER_TARGETS:
-               return 8;
-
+       /* Viewports and render targets. */
        case PIPE_CAP_MAX_VIEWPORTS:
                return R600_MAX_VIEWPORTS;
        case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
+       case PIPE_CAP_MAX_RENDER_TARGETS:
                return 8;
 
        /* Timer queries, present when the clock frequency is non zero. */
@@ -549,12 +545,8 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
                return ATI_VENDOR_ID;
        case PIPE_CAP_DEVICE_ID:
                return sscreen->b.info.pci_id;
-       case PIPE_CAP_ACCELERATED:
-               return 1;
        case PIPE_CAP_VIDEO_MEMORY:
                return sscreen->b.info.vram_size >> 20;
-       case PIPE_CAP_UMA:
-               return 0;
        case PIPE_CAP_PCI_GROUP:
                return sscreen->b.info.pci_domain;
        case PIPE_CAP_PCI_BUS: