summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-04-20 11:48:31 -0700
committerEric Anholt <[email protected]>2011-04-23 13:21:57 -0700
commit1f32c665c8af0622e2bbf451edb999ffbcd7d0fe (patch)
tree42deb7077604e541224b15de3c65eefaea605922 /src/mesa/drivers/dri/intel
parent1df72402d99145425531297eef6772b88ce5225d (diff)
intel: Add support for ARB_sampler_objects.
This extension support consists of replacing "gl_texture_obj->Sampler." with "_mesa_get_samplerobj(ctx, unit)->". One instance of referencing the texture's base sampler remains in the initial miptree allocation, where I'm not sure we have a clear association with any texture unit. Tested with piglit ARB_sampler_objects/sampler-objects. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_extensions.c1
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_validate.c11
2 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c
index c24bc99f904..3fd987abd8c 100644
--- a/src/mesa/drivers/dri/intel/intel_extensions.c
+++ b/src/mesa/drivers/dri/intel/intel_extensions.c
@@ -91,6 +91,7 @@ static const struct dri_extension card_extensions[] = {
{ "GL_ARB_pixel_buffer_object", NULL },
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
{ "GL_ARB_point_sprite", NULL },
+ { "GL_ARB_sampler_objects", NULL },
{ "GL_ARB_shader_objects", GL_ARB_shader_objects_functions },
{ "GL_ARB_shading_language_100", GL_VERSION_2_0_functions },
{ "GL_ARB_sync", GL_ARB_sync_functions },
diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c
index 5e705c93619..27f2646ebf5 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c
@@ -1,5 +1,6 @@
#include "main/mtypes.h"
#include "main/macros.h"
+#include "main/samplerobj.h"
#include "intel_context.h"
#include "intel_mipmap_tree.h"
@@ -14,11 +15,13 @@
*/
static void
intel_update_max_level(struct intel_context *intel,
- struct intel_texture_object *intelObj)
+ struct intel_texture_object *intelObj,
+ struct gl_sampler_object *sampler)
{
struct gl_texture_object *tObj = &intelObj->base;
- if (tObj->Sampler.MinFilter == GL_NEAREST || tObj->Sampler.MinFilter == GL_LINEAR) {
+ if (sampler->MinFilter == GL_NEAREST ||
+ sampler->MinFilter == GL_LINEAR) {
intelObj->_MaxLevel = tObj->BaseLevel;
} else {
intelObj->_MaxLevel = tObj->_MaxLevel;
@@ -70,8 +73,10 @@ copy_image_data_to_tree(struct intel_context *intel,
GLuint
intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
{
+ struct gl_context *ctx = &intel->ctx;
struct gl_texture_object *tObj = intel->ctx.Texture.Unit[unit]._Current;
struct intel_texture_object *intelObj = intel_texture_object(tObj);
+ struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit);
int comp_byte = 0;
int cpp;
GLuint face, i;
@@ -84,7 +89,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
/* What levels must the tree include at a minimum?
*/
- intel_update_max_level(intel, intelObj);
+ intel_update_max_level(intel, intelObj, sampler);
firstImage = intel_texture_image(tObj->Image[0][tObj->BaseLevel]);
/* Fallback case: