[Mesa-dev] [PATCH 33/92] radeonsi: implement pipe_screen::get_struct_param

Nicolai Hähnle nhaehnle at gmail.com
Mon Jun 26 14:10:12 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

---
 src/gallium/drivers/radeonsi/si_pipe.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index e69f38f..aa62c1b 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -807,20 +807,37 @@ static const struct nir_shader_compiler_options nir_options = {
 
 static const void *
 si_get_compiler_options(struct pipe_screen *screen,
 			enum pipe_shader_ir ir,
 			enum pipe_shader_type shader)
 {
 	assert(ir == PIPE_SHADER_IR_NIR);
 	return &nir_options;
 }
 
+static const struct nir_lower_tex_options si_nir_lower_tex_options = {
+	.lower_txp = ~0u,
+};
+
+static const void *
+si_get_struct_param(struct pipe_screen *screen, enum pipe_struct_cap param)
+{
+	switch (param) {
+	case PIPE_STRUCT_CAP_NIR_LOWER_TEX_OPTIONS:
+		return &si_nir_lower_tex_options;
+
+	default:
+		assert(false);
+		return NULL;
+	}
+}
+
 static void si_destroy_screen(struct pipe_screen* pscreen)
 {
 	struct si_screen *sscreen = (struct si_screen *)pscreen;
 	struct si_shader_part *parts[] = {
 		sscreen->vs_prologs,
 		sscreen->tcs_epilogs,
 		sscreen->gs_prologs,
 		sscreen->ps_prologs,
 		sscreen->ps_epilogs
 	};
@@ -958,20 +975,21 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
 
 	if (!sscreen) {
 		return NULL;
 	}
 
 	/* Set functions first. */
 	sscreen->b.b.context_create = si_pipe_create_context;
 	sscreen->b.b.destroy = si_destroy_screen;
 	sscreen->b.b.get_param = si_get_param;
 	sscreen->b.b.get_shader_param = si_get_shader_param;
+	sscreen->b.b.get_struct_param = si_get_struct_param;
 	sscreen->b.b.get_compiler_options = si_get_compiler_options;
 	sscreen->b.b.resource_create = r600_resource_create_common;
 
 	si_init_screen_state_functions(sscreen);
 
 	if (!r600_common_screen_init(&sscreen->b, ws, flags) ||
 	    !si_init_gs_info(sscreen) ||
 	    !si_init_shader_cache(sscreen)) {
 		FREE(sscreen);
 		return NULL;
-- 
2.9.3



More information about the mesa-dev mailing list