[Mesa-dev] [PATCH v1 2/4] freedreno/a2xx: Check for fd2_program_validate failures.

robert.foss at collabora.com robert.foss at collabora.com
Tue Jun 7 09:33:37 UTC 2016


From: Robert Foss <robert.foss at collabora.com>

Make sure that fd2_program_validate does not fail. If it does fail, some of
shader data structes may be de-allocated.

Also fd2_draw_vbo to return booleans to indicate failure.

coverity: 1362467
Signed-off-by: Robert Foss <robert.foss at collabora.com>
---
 src/gallium/drivers/freedreno/a2xx/fd2_emit.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_emit.c b/src/gallium/drivers/freedreno/a2xx/fd2_emit.c
index 4f667ab..edf0e7e 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_emit.c
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_emit.c
@@ -179,7 +179,7 @@ fd2_emit_vertex_bufs(struct fd_ringbuffer *ring, uint32_t val,
 	}
 }
 
-void
+bool
 fd2_emit_state(struct fd_context *ctx, uint32_t dirty)
 {
 	struct fd2_blend_stateobj *blend = fd2_blend_stateobj(ctx->blend);
@@ -278,7 +278,8 @@ fd2_emit_state(struct fd_context *ctx, uint32_t dirty)
 	}
 
 	if (dirty & (FD_DIRTY_PROG | FD_DIRTY_VTXSTATE | FD_DIRTY_TEXSTATE)) {
-		fd2_program_validate(ctx);
+		if (fd2_program_validate(ctx) == false)
+			return false;
 		fd2_program_emit(ring, &ctx->prog);
 	}
 
-- 
2.7.4



More information about the mesa-dev mailing list