summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/a2xx
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2014-02-21 14:36:11 -0500
committerRob Clark <[email protected]>2014-02-23 14:58:23 -0500
commitbb255fdf06caa7fcf9af7c65524beb28a3a4faf5 (patch)
treeb3967396f05f0ff78b3c5702961ddf0b647a58e7 /src/gallium/drivers/freedreno/a2xx
parent1c953b7cda8169c1132259d83efff4df7afbf74a (diff)
freedreno/a3xx: drop hand-coded blit/solid shaders
Instead in the common code, construct these shaders from TGSI. For now we let a2xx keep it's hand coded shaders, as it's compiler isn't quite up to the job yet. All the same it is a net drop in code size and gets rid of special cases. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a2xx')
-rw-r--r--src/gallium/drivers/freedreno/a2xx/fd2_context.c1
-rw-r--r--src/gallium/drivers/freedreno/a2xx/fd2_program.c35
-rw-r--r--src/gallium/drivers/freedreno/a2xx/fd2_program.h1
3 files changed, 4 insertions, 33 deletions
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_context.c b/src/gallium/drivers/freedreno/a2xx/fd2_context.c
index 239558b6f07..f51c5eead4f 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_context.c
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_context.c
@@ -40,7 +40,6 @@
static void
fd2_context_destroy(struct pipe_context *pctx)
{
- fd2_prog_fini(pctx);
fd_context_destroy(pctx);
}
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_program.c b/src/gallium/drivers/freedreno/a2xx/fd2_program.c
index c62a7f90b98..84b6ffec338 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_program.c
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_program.c
@@ -34,6 +34,8 @@
#include "tgsi/tgsi_dump.h"
#include "tgsi/tgsi_parse.h"
+#include "freedreno_program.h"
+
#include "fd2_program.h"
#include "fd2_compiler.h"
#include "fd2_texture.h"
@@ -141,15 +143,6 @@ fd2_fp_state_delete(struct pipe_context *pctx, void *hwcso)
delete_shader(so);
}
-static void
-fd2_fp_state_bind(struct pipe_context *pctx, void *hwcso)
-{
- struct fd_context *ctx = fd_context(pctx);
- ctx->prog.fp = hwcso;
- ctx->prog.dirty |= FD_SHADER_DIRTY_FP;
- ctx->dirty |= FD_DIRTY_PROG;
-}
-
static void *
fd2_vp_state_create(struct pipe_context *pctx,
const struct pipe_shader_state *cso)
@@ -169,15 +162,6 @@ fd2_vp_state_delete(struct pipe_context *pctx, void *hwcso)
}
static void
-fd2_vp_state_bind(struct pipe_context *pctx, void *hwcso)
-{
- struct fd_context *ctx = fd_context(pctx);
- ctx->prog.vp = hwcso;
- ctx->prog.dirty |= FD_SHADER_DIRTY_VP;
- ctx->dirty |= FD_DIRTY_PROG;
-}
-
-static void
patch_vtx_fetches(struct fd_context *ctx, struct fd2_shader_stateobj *so,
struct fd_vertex_stateobj *vtx)
{
@@ -481,26 +465,15 @@ fd2_prog_init(struct pipe_context *pctx)
struct fd_context *ctx = fd_context(pctx);
pctx->create_fs_state = fd2_fp_state_create;
- pctx->bind_fs_state = fd2_fp_state_bind;
pctx->delete_fs_state = fd2_fp_state_delete;
pctx->create_vs_state = fd2_vp_state_create;
- pctx->bind_vs_state = fd2_vp_state_bind;
pctx->delete_vs_state = fd2_vp_state_delete;
+ fd_prog_init(pctx);
+
ctx->solid_prog.fp = create_solid_fp();
ctx->solid_prog.vp = create_solid_vp();
ctx->blit_prog.fp = create_blit_fp();
ctx->blit_prog.vp = create_blit_vp();
}
-
-void
-fd2_prog_fini(struct pipe_context *pctx)
-{
- struct fd_context *ctx = fd_context(pctx);
-
- delete_shader(ctx->solid_prog.vp);
- delete_shader(ctx->solid_prog.fp);
- delete_shader(ctx->blit_prog.vp);
- delete_shader(ctx->blit_prog.fp);
-}
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_program.h b/src/gallium/drivers/freedreno/a2xx/fd2_program.h
index 393cb616f63..170b22abee0 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_program.h
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_program.h
@@ -77,6 +77,5 @@ void fd2_program_emit(struct fd_ringbuffer *ring,
void fd2_program_validate(struct fd_context *ctx);
void fd2_prog_init(struct pipe_context *pctx);
-void fd2_prog_fini(struct pipe_context *pctx);
#endif /* FD2_PROGRAM_H_ */