Commit d3c1b212 authored by Marek Olšák's avatar Marek Olšák

gallium: add PIPE_CAP_MAX_SHADER_BUFFER_SIZE

Tested-by: Dieter Nützel's avatarDieter Nützel <Dieter@nuetzel-hh.de>
parent f6ccd594
......@@ -454,6 +454,8 @@ subpixel precision bias in bits during conservative rasterization.
```set_sample_locations```.
* ``PIPE_CAP_MAX_GS_INVOCATIONS``: Maximum supported value of
TGSI_PROPERTY_GS_INVOCATIONS.
* ``PIPE_CAP_MAX_SHADER_BUFFER_SIZE``: Maximum supported size for binding
with set_shader_buffers.
.. _pipe_capf:
......
......@@ -288,6 +288,9 @@ etna_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 32;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
/* Stream output. */
case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
......
......@@ -375,6 +375,9 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 32;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
case PIPE_CAP_CONTEXT_PRIORITY_MASK:
return screen->priority_mask;
......
......@@ -340,6 +340,9 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 32;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
case PIPE_CAP_MAX_VIEWPORTS:
return 1;
......
......@@ -375,6 +375,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
return 0;
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 32;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
}
/* should only get here on unhandled cases */
debug_printf("Unexpected PIPE_CAP %d query\n", param);
......
......@@ -242,6 +242,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 32;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
case PIPE_CAP_VENDOR_ID:
return 0x10de;
case PIPE_CAP_DEVICE_ID: {
......
......@@ -296,6 +296,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 32;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
case PIPE_CAP_VENDOR_ID:
return 0x10de;
case PIPE_CAP_DEVICE_ID: {
......
......@@ -269,6 +269,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
return class_3d >= GM200_3D_CLASS;
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 32;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
case PIPE_CAP_CONSERVATIVE_RASTER_PRE_SNAP_TRIANGLES:
return class_3d >= GP100_3D_CLASS;
case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
......
......@@ -264,6 +264,8 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 32;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
/* SWTCL-only features. */
case PIPE_CAP_PRIMITIVE_RESTART:
......
......@@ -378,6 +378,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 32;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
/* Unsupported features. */
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
......
......@@ -189,6 +189,7 @@ static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
return 420;
case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return MIN2(sscreen->info.max_alloc_size, INT_MAX);
case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
......
......@@ -327,6 +327,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
return 0;
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 32;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
return 4;
}
......
......@@ -473,6 +473,8 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
return 0;
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 32;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
}
debug_printf("Unexpected PIPE_CAP_ query %u\n", param);
......
......@@ -364,6 +364,8 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap param)
return 0;
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 32;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
case PIPE_CAP_VENDOR_ID:
return 0xFFFFFFFF;
......
......@@ -279,6 +279,8 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 0;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
/* Texturing. */
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
......
......@@ -315,6 +315,8 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 0;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
/* Texturing. */
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
......
......@@ -310,6 +310,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
return 0;
case PIPE_CAP_MAX_GS_INVOCATIONS:
return 32;
case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
return 1 << 27;
case PIPE_CAP_VENDOR_ID:
return 0x1af4;
case PIPE_CAP_DEVICE_ID:
......
......@@ -816,6 +816,7 @@ enum pipe_cap
PIPE_CAP_CONSERVATIVE_RASTER_POST_DEPTH_COVERAGE,
PIPE_CAP_PROGRAMMABLE_SAMPLE_LOCATIONS,
PIPE_CAP_MAX_GS_INVOCATIONS,
PIPE_CAP_MAX_SHADER_BUFFER_SIZE,
};
/**
......
......@@ -468,7 +468,8 @@ void st_init_limits(struct pipe_screen *screen,
c->MaxCombinedAtomicBuffers;
c->MaxCombinedShaderOutputResources +=
c->MaxCombinedShaderStorageBlocks;
c->MaxShaderStorageBlockSize = 1 << 27;
c->MaxShaderStorageBlockSize =
screen->get_param(screen, PIPE_CAP_MAX_SHADER_BUFFER_SIZE);
extensions->ARB_shader_storage_buffer_object = GL_TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment