summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/nouveau/nouveau_shader.c
diff options
context:
space:
mode:
authorBen Skeggs <darktama@iinet.net.au>2006-06-03 16:36:23 +0000
committerBen Skeggs <darktama@iinet.net.au>2006-06-03 16:36:23 +0000
commit5411b96c5fc9b50ca4cd1ae61eb9d8b00fe5ff9a (patch)
tree573b869a9e6fccd34f6cd838aacf91cd9a9d5822 /src/mesa/drivers/dri/nouveau/nouveau_shader.c
parent13a2d6698fce050732b421107a2a92b37a5e01f8 (diff)
Add start of vertex shader backend, will most likely not work correctly yet
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_shader.c')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_shader.c91
1 files changed, 91 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_shader.c b/src/mesa/drivers/dri/nouveau/nouveau_shader.c
new file mode 100644
index 0000000000..ef8f02e910
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_shader.c
@@ -0,0 +1,91 @@
+#include "glheader.h"
+#include "macros.h"
+#include "enums.h"
+
+#include "program.h"
+#include "nouveau_context.h"
+#include "nouveau_shader.h"
+
+static struct program *
+nv40NewProgram(GLcontext *ctx, GLenum target, GLuint id)
+{
+}
+
+static void
+nv40BindProgram(GLcontext *ctx, GLenum target, struct program *prog)
+{
+}
+
+static void
+nv40DeleteProgram(GLcontext *ctx, struct program *prog)
+{
+}
+
+static void
+nv40ProgramStringNotify(GLcontext *ctx, GLenum target,
+ struct program *prog)
+{
+}
+
+static GLboolean
+nv40IsProgramNative(GLcontext *ctx, GLenum target, struct program *prog)
+{
+}
+
+void
+nouveauInitShaderFuncs(GLcontext *ctx)
+{
+ struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
+
+ if (nmesa->screen->card_type == NV_40) {
+ ctx->Driver.NewProgram = nv40NewProgram;
+ ctx->Driver.BindProgram = nv40BindProgram;
+ ctx->Driver.DeleteProgram = nv40DeleteProgram;
+ ctx->Driver.ProgramStringNotify = nv40ProgramStringNotify;
+ ctx->Driver.IsProgramNative = nv40IsProgramNative;
+ }
+}
+
+#define LONGBITS (sizeof(long) * 8)
+void
+nvsBitSet(long *rec, int bit)
+{
+ int ri = bit / LONGBITS;
+ int rb = bit % LONGBITS;
+
+ rec[ri] |= (1 << rb);
+}
+
+void
+nvsBitClear(long *rec, int bit)
+{
+ int ri = bit / LONGBITS;
+ int rb = bit % LONGBITS;
+
+ rec[ri] &= ~(1 << rb);
+}
+
+void
+nvsRecInit(long **rec, int max)
+{
+ int c = (max / LONGBITS) + ((max % LONGBITS) ? 1 : 0);
+ *rec = calloc(c, sizeof(long));
+}
+
+int
+nvsAllocIndex(long *rec, int max)
+{
+ int c = (max / LONGBITS) + ((max % LONGBITS) ? 1 : 0);
+ int i, idx = 0;
+
+ for (i=0;i<c;i++) {
+ idx = ffsl(~rec[i]);
+ if (idx) {
+ nvsBitSet(rec, (idx - 1));
+ break;
+ }
+ }
+
+ return (idx - 1);
+}
+