summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-11-02 04:53:47 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-11-02 04:53:47 +0000
commitb44518130b33cadb5c1d619e9e936ae0e0dbf7cb (patch)
tree6069eb03c39fbc79808a7d94f857118cce75cbe3 /lib/mesa/src/gallium/drivers/softpipe
parent32aeb3c41fedbbd7b11aacfec48e8f699d16bff0 (diff)
Merge Mesa 23.1.9
Diffstat (limited to 'lib/mesa/src/gallium/drivers/softpipe')
-rw-r--r--lib/mesa/src/gallium/drivers/softpipe/sp_compute.c7
-rw-r--r--lib/mesa/src/gallium/drivers/softpipe/sp_context.c7
-rw-r--r--lib/mesa/src/gallium/drivers/softpipe/sp_screen.c24
-rw-r--r--lib/mesa/src/gallium/drivers/softpipe/sp_tex_sample.c26
4 files changed, 38 insertions, 26 deletions
diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_compute.c b/lib/mesa/src/gallium/drivers/softpipe/sp_compute.c
index 221ef7ec7..2b70fb977 100644
--- a/lib/mesa/src/gallium/drivers/softpipe/sp_compute.c
+++ b/lib/mesa/src/gallium/drivers/softpipe/sp_compute.c
@@ -184,8 +184,9 @@ softpipe_launch_grid(struct pipe_context *context,
fill_grid_size(context, info, grid_size);
- if (cs->shader.req_local_mem) {
- local_mem = CALLOC(1, cs->shader.req_local_mem);
+ uint32_t shared_mem_size = cs->shader.static_shared_mem + info->variable_shared_mem;
+ if (shared_mem_size) {
+ local_mem = CALLOC(1, shared_mem_size);
}
machines = CALLOC(sizeof(struct tgsi_exec_machine *), num_threads_in_group);
@@ -202,7 +203,7 @@ softpipe_launch_grid(struct pipe_context *context,
machines[idx] = tgsi_exec_machine_create(PIPE_SHADER_COMPUTE);
machines[idx]->LocalMem = local_mem;
- machines[idx]->LocalMemSize = cs->shader.req_local_mem;
+ machines[idx]->LocalMemSize = shared_mem_size;
machines[idx]->NonHelperMask = (1 << (MIN2(TGSI_QUAD_SIZE, bwidth - local_x))) - 1;
cs_prepare(cs, machines[idx],
local_x, local_y, local_z,
diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_context.c b/lib/mesa/src/gallium/drivers/softpipe/sp_context.c
index ee668330e..ef3c9e160 100644
--- a/lib/mesa/src/gallium/drivers/softpipe/sp_context.c
+++ b/lib/mesa/src/gallium/drivers/softpipe/sp_context.c
@@ -54,6 +54,8 @@
#include "sp_tex_sample.h"
#include "sp_image.h"
+#include "nir.h"
+
static void
softpipe_destroy( struct pipe_context *pipe )
{
@@ -81,11 +83,10 @@ softpipe_destroy( struct pipe_context *pipe )
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
sp_destroy_tile_cache(softpipe->cbuf_cache[i]);
- pipe_surface_reference(&softpipe->framebuffer.cbufs[i], NULL);
}
sp_destroy_tile_cache(softpipe->zsbuf_cache);
- pipe_surface_reference(&softpipe->framebuffer.zsbuf, NULL);
+ util_unreference_framebuffer_state(&softpipe->framebuffer);
for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) {
for (i = 0; i < ARRAY_SIZE(softpipe->tex_cache[0]); i++) {
@@ -321,7 +322,7 @@ softpipe_create_context(struct pipe_screen *screen,
/* plug in AA line/point stages */
draw_install_aaline_stage(softpipe->draw, &softpipe->pipe);
- draw_install_aapoint_stage(softpipe->draw, &softpipe->pipe);
+ draw_install_aapoint_stage(softpipe->draw, &softpipe->pipe, nir_type_bool32);
/* Do polygon stipple w/ texture map + frag prog. */
draw_install_pstipple_stage(softpipe->draw, &softpipe->pipe);
diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_screen.c b/lib/mesa/src/gallium/drivers/softpipe/sp_screen.c
index e6941de09..74ff914a0 100644
--- a/lib/mesa/src/gallium/drivers/softpipe/sp_screen.c
+++ b/lib/mesa/src/gallium/drivers/softpipe/sp_screen.c
@@ -27,6 +27,7 @@
#include "compiler/nir/nir.h"
+#include "util/u_helpers.h"
#include "util/u_memory.h"
#include "util/format/u_format.h"
#include "util/format/u_format_s3tc.h"
@@ -64,7 +65,7 @@ DEBUG_GET_ONCE_FLAGS_OPTION(sp_debug, "SOFTPIPE_DEBUG", sp_debug_options, 0)
static const char *
softpipe_get_vendor(struct pipe_screen *screen)
{
- return "Mesa/X.org";
+ return "Mesa";
}
@@ -282,6 +283,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
}
case PIPE_CAP_UMA:
return 0;
+ case PIPE_CAP_QUERY_MEMORY_INFO:
+ return 1;
case PIPE_CAP_CONDITIONAL_RENDER_INVERTED:
return 1;
case PIPE_CAP_CLIP_HALFZ:
@@ -487,12 +490,6 @@ softpipe_is_format_supported( struct pipe_screen *screen,
static void
softpipe_destroy_screen( struct pipe_screen *screen )
{
- struct softpipe_screen *sp_screen = softpipe_screen(screen);
- struct sw_winsys *winsys = sp_screen->winsys;
-
- if(winsys->destroy)
- winsys->destroy(winsys);
-
FREE(screen);
}
@@ -569,6 +566,17 @@ softpipe_get_compute_param(struct pipe_screen *_screen,
return 0;
}
+static int
+softpipe_screen_get_fd(struct pipe_screen *screen)
+{
+ struct sw_winsys *winsys = softpipe_screen(screen)->winsys;
+
+ if (winsys->get_fd)
+ return winsys->get_fd(winsys);
+ else
+ return -1;
+}
+
/**
* Create a new pipe_screen object
* Note: we're not presently subclassing pipe_screen (no softpipe_screen).
@@ -590,10 +598,12 @@ softpipe_create_screen(struct sw_winsys *winsys)
screen->base.get_name = softpipe_get_name;
screen->base.get_vendor = softpipe_get_vendor;
screen->base.get_device_vendor = softpipe_get_vendor; // TODO should be the CPU vendor
+ screen->base.get_screen_fd = softpipe_screen_get_fd;
screen->base.get_param = softpipe_get_param;
screen->base.get_shader_param = softpipe_get_shader_param;
screen->base.get_paramf = softpipe_get_paramf;
screen->base.get_timestamp = u_default_get_timestamp;
+ screen->base.query_memory_info = util_sw_query_memory_info;
screen->base.is_format_supported = softpipe_is_format_supported;
screen->base.context_create = softpipe_create_context;
screen->base.flush_frontbuffer = softpipe_flush_frontbuffer;
diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_tex_sample.c b/lib/mesa/src/gallium/drivers/softpipe/sp_tex_sample.c
index e250ed9f7..ae71de53c 100644
--- a/lib/mesa/src/gallium/drivers/softpipe/sp_tex_sample.c
+++ b/lib/mesa/src/gallium/drivers/softpipe/sp_tex_sample.c
@@ -1190,7 +1190,7 @@ img_filter_2d_linear_repeat_POT(const struct sp_sampler_view *sp_sview,
}
if (DEBUG_TEX) {
- print_sample(__FUNCTION__, rgba);
+ print_sample(__func__, rgba);
}
}
@@ -1225,7 +1225,7 @@ img_filter_2d_nearest_repeat_POT(const struct sp_sampler_view *sp_sview,
rgba[TGSI_NUM_CHANNELS*c] = out[c];
if (DEBUG_TEX) {
- print_sample(__FUNCTION__, rgba);
+ print_sample(__func__, rgba);
}
}
@@ -1268,7 +1268,7 @@ img_filter_2d_nearest_clamp_POT(const struct sp_sampler_view *sp_sview,
rgba[TGSI_NUM_CHANNELS*c] = out[c];
if (DEBUG_TEX) {
- print_sample(__FUNCTION__, rgba);
+ print_sample(__func__, rgba);
}
}
@@ -1299,7 +1299,7 @@ img_filter_1d_nearest(const struct sp_sampler_view *sp_sview,
rgba[TGSI_NUM_CHANNELS*c] = out[c];
if (DEBUG_TEX) {
- print_sample(__FUNCTION__, rgba);
+ print_sample(__func__, rgba);
}
}
@@ -1331,7 +1331,7 @@ img_filter_1d_array_nearest(const struct sp_sampler_view *sp_sview,
rgba[TGSI_NUM_CHANNELS*c] = out[c];
if (DEBUG_TEX) {
- print_sample(__FUNCTION__, rgba);
+ print_sample(__func__, rgba);
}
}
@@ -1365,7 +1365,7 @@ img_filter_2d_nearest(const struct sp_sampler_view *sp_sview,
rgba[TGSI_NUM_CHANNELS*c] = out[c];
if (DEBUG_TEX) {
- print_sample(__FUNCTION__, rgba);
+ print_sample(__func__, rgba);
}
}
@@ -1400,7 +1400,7 @@ img_filter_2d_array_nearest(const struct sp_sampler_view *sp_sview,
rgba[TGSI_NUM_CHANNELS*c] = out[c];
if (DEBUG_TEX) {
- print_sample(__FUNCTION__, rgba);
+ print_sample(__func__, rgba);
}
}
@@ -1444,7 +1444,7 @@ img_filter_cube_nearest(const struct sp_sampler_view *sp_sview,
rgba[TGSI_NUM_CHANNELS*c] = out[c];
if (DEBUG_TEX) {
- print_sample(__FUNCTION__, rgba);
+ print_sample(__func__, rgba);
}
}
@@ -1479,7 +1479,7 @@ img_filter_cube_array_nearest(const struct sp_sampler_view *sp_sview,
rgba[TGSI_NUM_CHANNELS*c] = out[c];
if (DEBUG_TEX) {
- print_sample(__FUNCTION__, rgba);
+ print_sample(__func__, rgba);
}
}
@@ -2137,7 +2137,7 @@ mip_filter_linear(const struct sp_sampler_view *sp_sview,
}
if (DEBUG_TEX) {
- print_sample_4(__FUNCTION__, rgba);
+ print_sample_4(__func__, rgba);
}
}
@@ -2204,7 +2204,7 @@ mip_filter_nearest(const struct sp_sampler_view *sp_sview,
}
if (DEBUG_TEX) {
- print_sample_4(__FUNCTION__, rgba);
+ print_sample_4(__func__, rgba);
}
}
@@ -2653,7 +2653,7 @@ mip_filter_linear_aniso(const struct sp_sampler_view *sp_sview,
}
if (DEBUG_TEX) {
- print_sample_4(__FUNCTION__, rgba);
+ print_sample_4(__func__, rgba);
}
}
@@ -2728,7 +2728,7 @@ mip_filter_linear_2d_linear_repeat_POT(
}
if (DEBUG_TEX) {
- print_sample_4(__FUNCTION__, rgba);
+ print_sample_4(__func__, rgba);
}
}