summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2014-01-07 15:51:13 -0800
committerPaul Berry <[email protected]>2014-02-05 09:05:04 -0800
commit3bbf93045a494e676f3f79d278701f55a9a41e7a (patch)
tree54f3696bf919c6773c53a1505a0ac4cd1c7421b1
parent1fe274b3d7a8e70dc605e6076d29e00add292508 (diff)
i965/cs: Create the brw_compute_program struct, and the code to initialize it.
v2: Fix comment. Reviewed-by: Jordan Justen <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h8
-rw-r--r--src/mesa/drivers/dri/i965/brw_program.c11
2 files changed, 19 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index a0189b77bad..bee39fadee9 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -316,6 +316,14 @@ struct brw_fragment_program {
GLuint id; /**< serial no. to identify frag progs, never re-used */
};
+
+/** Subclass of Mesa compute program */
+struct brw_compute_program {
+ struct gl_compute_program program;
+ unsigned id; /**< serial no. to identify compute progs, never re-used */
+};
+
+
struct brw_shader {
struct gl_shader base;
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index a6a2403f538..1e35191a8ce 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -113,6 +113,17 @@ static struct gl_program *brwNewProgram( struct gl_context *ctx,
}
}
+ case GL_COMPUTE_PROGRAM_NV: {
+ struct brw_compute_program *prog = CALLOC_STRUCT(brw_compute_program);
+ if (prog) {
+ prog->id = get_new_program_id(brw->intelScreen);
+
+ return _mesa_init_compute_program(ctx, &prog->program, target, id);
+ } else {
+ return NULL;
+ }
+ }
+
default:
assert(!"Unsupported target in brwNewProgram()");
return NULL;