summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2016-03-15 14:58:20 +0100
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>2016-03-19 00:09:09 +0100
commit5ed387675d61e739b548fde9ff40d284160d6269 (patch)
treef681a7150accb314f17d519bdbf5fce5031ffee9 /src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
parenta07ebc1993069306a1c80db8de726a8981e62092 (diff)
downloadexternal_mesa3d-5ed387675d61e739b548fde9ff40d284160d6269.zip
external_mesa3d-5ed387675d61e739b548fde9ff40d284160d6269.tar.gz
external_mesa3d-5ed387675d61e739b548fde9ff40d284160d6269.tar.bz2
nv50: rework nv50_compute_validate_program()
Reduce the amount of duplicated code by re-using nv50_program_validate(). While we are at it, change the prototype to return void. We don't check anymore if the translation fails but improving the state validation is a long process. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Pierre Moreau <pierre.morrow@free.fr> Tested-by: Pierre Moreau <pierre.morrow@free.fr>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50/nv50_shader_state.c')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_shader_state.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
index 693920e..56a3df9 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c
@@ -29,6 +29,8 @@
#include "nv50/nv50_context.h"
#include "nv50/nv50_query_hw.h"
+#include "nv50/nv50_compute.xml.h"
+
void
nv50_constbufs_validate(struct nv50_context *nv50)
{
@@ -238,6 +240,19 @@ nv50_gmtyprog_validate(struct nv50_context *nv50)
/* GP_ENABLE is updated in linkage validation */
}
+void
+nv50_compprog_validate(struct nv50_context *nv50)
+{
+ struct nouveau_pushbuf *push = nv50->base.pushbuf;
+ struct nv50_program *cp = nv50->compprog;
+
+ if (cp && !nv50_program_validate(nv50, cp))
+ return;
+
+ BEGIN_NV04(push, NV50_CP(CODE_CB_FLUSH), 1);
+ PUSH_DATA (push, 0);
+}
+
static void
nv50_sprite_coords_validate(struct nv50_context *nv50)
{