[Mesa-dev] [PATCH 2/2] r600, compute: Allow image resource creation

Zoltan Gilian zoltan.gilian at gmail.com
Mon Jun 8 04:20:25 PDT 2015


Allow creation and binding of compute image resources to be able to test the
currently working pieces of OpenCL image support.
---
 src/gallium/drivers/r600/evergreen_compute.c  | 2 +-
 src/gallium/drivers/r600/evergreen_state.c    | 4 ++++
 src/gallium/drivers/r600/r600_state_common.c  | 1 +
 src/gallium/drivers/radeon/r600_pipe_common.c | 2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
index 4c3c34c..ecad25c 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -666,7 +666,7 @@ void evergreen_set_cs_sampler_view(struct pipe_context *ctx_,
 		if (resource[i]) {
 			assert(i+1 < 12);
 			/* XXX: Implement */
-			assert(!"Compute samplers not implemented.");
+			//assert(!"Compute samplers not implemented.");
 			///FETCH0 = VTX0 (param buffer),
 			//FETCH1 = VTX1 (global buffer pool), FETCH2... = TEX
 		}
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index 4ddbc0b..5dba577 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -299,6 +299,10 @@ boolean evergreen_is_format_supported(struct pipe_screen *screen,
 	if (usage & PIPE_BIND_TRANSFER_WRITE)
 		retval |= PIPE_BIND_TRANSFER_WRITE;
 
+	// XXX: review if something is not supported as a compute resource
+	if (usage & PIPE_BIND_COMPUTE_RESOURCE)
+		retval |= PIPE_BIND_COMPUTE_RESOURCE;
+
 	return retval == usage;
 }
 
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
index 13dc9ee..0566d00 100644
--- a/src/gallium/drivers/r600/r600_state_common.c
+++ b/src/gallium/drivers/r600/r600_state_common.c
@@ -594,6 +594,7 @@ static void r600_set_sampler_views(struct pipe_context *pipe, unsigned shader,
 	assert(start == 0); /* XXX fix below */
 
 	if (shader == PIPE_SHADER_COMPUTE) {
+		/*XXX*/ if (!views) return;
 		evergreen_set_cs_sampler_view(pipe, start, count, views);
 		return;
 	}
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index 3def444..d14791e 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -631,7 +631,7 @@ static int r600_get_compute_param(struct pipe_screen *screen,
 	case PIPE_COMPUTE_CAP_IMAGES_SUPPORTED:
 		if (ret) {
 			uint32_t *images_supported = ret;
-			*images_supported = 0;
+			*images_supported = 1;
 		}
 		return sizeof(uint32_t);
 	case PIPE_COMPUTE_CAP_MAX_PRIVATE_SIZE:
-- 
2.4.2



More information about the mesa-dev mailing list