summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-04-10 12:48:28 -0600
committerBrian Paul <[email protected]>2011-04-10 13:12:49 -0600
commit34a5d3b9f4740601708c82093e2114356d749e65 (patch)
tree7c8b91e28a4b2e056e4da9d24dc1f13afacd70c0 /src/mesa/main
parentf22d49de0f02653bb54aeb6a5f07a56e2cc63f1d (diff)
mesa: plug in new functions for GL_ARB_sampler_objects
Build the new sources, plug the new functions into the dispatch table, implement display list support. And enable extension in the gallium state tracker.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/api_exec.c7
-rw-r--r--src/mesa/main/dlist.c29
-rw-r--r--src/mesa/main/mfeatures.h1
3 files changed, 37 insertions, 0 deletions
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 91cdea5bb98..d0298df20cb 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -78,6 +78,9 @@
#include "polygon.h"
#include "queryobj.h"
#include "readpix.h"
+#if FEATURE_ARB_sampler_objects
+#include "samplerobj.h"
+#endif
#include "scissor.h"
#include "stencil.h"
#include "texenv.h"
@@ -729,6 +732,10 @@ _mesa_create_exec_table(void)
/* GL_ARB_texture_buffer_object */
SET_TexBufferARB(exec, _mesa_TexBuffer);
+#if FEATURE_ARB_sampler_objects
+ _mesa_init_sampler_object_dispatch(exec);
+#endif
+
return exec;
}
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 7e86f1d0ed0..f66082e7fce 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -49,6 +49,7 @@
#include "eval.h"
#include "framebuffer.h"
#include "glapi/glapi.h"
+#include "glapidispatch.h"
#include "hash.h"
#include "image.h"
#include "light.h"
@@ -437,6 +438,9 @@ typedef enum
/* GL_NV_texture_barrier */
OPCODE_TEXTURE_BARRIER_NV,
+ /* GL_ARB_sampler_object */
+ OPCODE_BIND_SAMPLER,
+
/* The following three are meta instructions */
OPCODE_ERROR, /* raise compiled-in error */
OPCODE_CONTINUE,
@@ -7066,6 +7070,24 @@ save_TextureBarrierNV(void)
}
+/* GL_ARB_sampler_objects */
+static void
+save_BindSampler(GLuint unit, GLuint sampler)
+{
+ Node *n;
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_BIND_SAMPLER, 2);
+ if (n) {
+ n[1].ui = unit;
+ n[2].ui = sampler;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_BindSampler(ctx->Exec, (unit, sampler));
+ }
+}
+
+
/**
* Save an error-generating command into display list.
*
@@ -8249,6 +8271,10 @@ execute_list(struct gl_context *ctx, GLuint list)
CALL_TextureBarrierNV(ctx->Exec, ());
break;
+ case OPCODE_BIND_SAMPLER:
+ CALL_BindSampler(ctx->Exec, (n[1].ui, n[2].ui));
+ break;
+
case OPCODE_CONTINUE:
n = (Node *) n[1].next;
break;
@@ -9930,6 +9956,9 @@ _mesa_create_save_table(void)
/* GL_NV_texture_barrier */
SET_TextureBarrierNV(table, save_TextureBarrierNV);
+ /* GL_ARB_sampler_objects */
+ SET_BindSampler(table, save_BindSampler);
+
/* GL_ARB_draw_buffer_blend */
SET_BlendFunciARB(table, save_BlendFunci);
SET_BlendFuncSeparateiARB(table, save_BlendFuncSeparatei);
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 1b39f5fdd36..33db5081419 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -122,6 +122,7 @@
#define FEATURE_ARB_framebuffer_object (FEATURE_GL && FEATURE_EXT_framebuffer_object)
#define FEATURE_ARB_map_buffer_range FEATURE_GL
#define FEATURE_ARB_pixel_buffer_object (FEATURE_GL && FEATURE_EXT_pixel_buffer_object)
+#define FEATURE_ARB_sampler_objects FEATURE_GL
#define FEATURE_ARB_sync FEATURE_GL
#define FEATURE_ARB_vertex_buffer_object 1