softpipe: s/varient/variant
This commit is contained in:
@@ -154,9 +154,9 @@ struct softpipe_context {
|
|||||||
|
|
||||||
/** TGSI exec things */
|
/** TGSI exec things */
|
||||||
struct {
|
struct {
|
||||||
struct sp_sampler_varient *geom_samplers_list[PIPE_MAX_GEOMETRY_SAMPLERS];
|
struct sp_sampler_variant *geom_samplers_list[PIPE_MAX_GEOMETRY_SAMPLERS];
|
||||||
struct sp_sampler_varient *vert_samplers_list[PIPE_MAX_VERTEX_SAMPLERS];
|
struct sp_sampler_variant *vert_samplers_list[PIPE_MAX_VERTEX_SAMPLERS];
|
||||||
struct sp_sampler_varient *frag_samplers_list[PIPE_MAX_SAMPLERS];
|
struct sp_sampler_variant *frag_samplers_list[PIPE_MAX_SAMPLERS];
|
||||||
} tgsi;
|
} tgsi;
|
||||||
|
|
||||||
struct tgsi_exec_machine *fs_machine;
|
struct tgsi_exec_machine *fs_machine;
|
||||||
@@ -192,7 +192,7 @@ softpipe_context( struct pipe_context *pipe )
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
softpipe_reset_sampler_varients(struct softpipe_context *softpipe);
|
softpipe_reset_sampler_variants(struct softpipe_context *softpipe);
|
||||||
|
|
||||||
struct pipe_context *
|
struct pipe_context *
|
||||||
softpipe_create_context( struct pipe_screen *, void *priv );
|
softpipe_create_context( struct pipe_screen *, void *priv );
|
||||||
|
@@ -197,7 +197,7 @@ update_tgsi_samplers( struct softpipe_context *softpipe )
|
|||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
softpipe_reset_sampler_varients( softpipe );
|
softpipe_reset_sampler_variants( softpipe );
|
||||||
|
|
||||||
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
|
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
|
||||||
struct softpipe_tex_tile_cache *tc = softpipe->tex_cache[i];
|
struct softpipe_tex_tile_cache *tc = softpipe->tex_cache[i];
|
||||||
|
@@ -43,8 +43,8 @@
|
|||||||
|
|
||||||
struct sp_sampler {
|
struct sp_sampler {
|
||||||
struct pipe_sampler_state base;
|
struct pipe_sampler_state base;
|
||||||
struct sp_sampler_varient *varients;
|
struct sp_sampler_variant *variants;
|
||||||
struct sp_sampler_varient *current;
|
struct sp_sampler_variant *current;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct sp_sampler *sp_sampler( struct pipe_sampler_state *sampler )
|
static struct sp_sampler *sp_sampler( struct pipe_sampler_state *sampler )
|
||||||
@@ -60,7 +60,7 @@ softpipe_create_sampler_state(struct pipe_context *pipe,
|
|||||||
struct sp_sampler *sp_sampler = CALLOC_STRUCT(sp_sampler);
|
struct sp_sampler *sp_sampler = CALLOC_STRUCT(sp_sampler);
|
||||||
|
|
||||||
sp_sampler->base = *sampler;
|
sp_sampler->base = *sampler;
|
||||||
sp_sampler->varients = NULL;
|
sp_sampler->variants = NULL;
|
||||||
|
|
||||||
return (void *)sp_sampler;
|
return (void *)sp_sampler;
|
||||||
}
|
}
|
||||||
@@ -277,24 +277,24 @@ softpipe_set_geometry_sampler_views(struct pipe_context *pipe,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find/create an sp_sampler_varient object for sampling the given texture,
|
* Find/create an sp_sampler_variant object for sampling the given texture,
|
||||||
* sampler and tex unit.
|
* sampler and tex unit.
|
||||||
*
|
*
|
||||||
* Note that the tex unit is significant. We can't re-use a sampler
|
* Note that the tex unit is significant. We can't re-use a sampler
|
||||||
* varient for multiple texture units because the sampler varient contains
|
* variant for multiple texture units because the sampler variant contains
|
||||||
* the texture object pointer. If the texture object pointer were stored
|
* the texture object pointer. If the texture object pointer were stored
|
||||||
* somewhere outside the sampler varient, we could re-use samplers for
|
* somewhere outside the sampler variant, we could re-use samplers for
|
||||||
* multiple texture units.
|
* multiple texture units.
|
||||||
*/
|
*/
|
||||||
static struct sp_sampler_varient *
|
static struct sp_sampler_variant *
|
||||||
get_sampler_varient( unsigned unit,
|
get_sampler_variant( unsigned unit,
|
||||||
struct sp_sampler *sampler,
|
struct sp_sampler *sampler,
|
||||||
struct pipe_sampler_view *view,
|
struct pipe_sampler_view *view,
|
||||||
struct pipe_resource *resource,
|
struct pipe_resource *resource,
|
||||||
unsigned processor )
|
unsigned processor )
|
||||||
{
|
{
|
||||||
struct softpipe_resource *sp_texture = softpipe_resource(resource);
|
struct softpipe_resource *sp_texture = softpipe_resource(resource);
|
||||||
struct sp_sampler_varient *v = NULL;
|
struct sp_sampler_variant *v = NULL;
|
||||||
union sp_sampler_key key;
|
union sp_sampler_key key;
|
||||||
|
|
||||||
/* if this fails, widen the key.unit field and update this assertion */
|
/* if this fails, widen the key.unit field and update this assertion */
|
||||||
@@ -316,14 +316,14 @@ get_sampler_varient( unsigned unit,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (v == NULL) {
|
if (v == NULL) {
|
||||||
for (v = sampler->varients; v; v = v->next)
|
for (v = sampler->variants; v; v = v->next)
|
||||||
if (v->key.value == key.value)
|
if (v->key.value == key.value)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (v == NULL) {
|
if (v == NULL) {
|
||||||
v = sp_create_sampler_varient( &sampler->base, key );
|
v = sp_create_sampler_variant( &sampler->base, key );
|
||||||
v->next = sampler->varients;
|
v->next = sampler->variants;
|
||||||
sampler->varients = v;
|
sampler->variants = v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,7 +333,7 @@ get_sampler_varient( unsigned unit,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
softpipe_reset_sampler_varients(struct softpipe_context *softpipe)
|
softpipe_reset_sampler_variants(struct softpipe_context *softpipe)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -350,13 +350,13 @@ softpipe_reset_sampler_varients(struct softpipe_context *softpipe)
|
|||||||
}
|
}
|
||||||
|
|
||||||
softpipe->tgsi.vert_samplers_list[i] =
|
softpipe->tgsi.vert_samplers_list[i] =
|
||||||
get_sampler_varient( i,
|
get_sampler_variant( i,
|
||||||
sp_sampler(softpipe->vertex_samplers[i]),
|
sp_sampler(softpipe->vertex_samplers[i]),
|
||||||
softpipe->vertex_sampler_views[i],
|
softpipe->vertex_sampler_views[i],
|
||||||
texture,
|
texture,
|
||||||
TGSI_PROCESSOR_VERTEX );
|
TGSI_PROCESSOR_VERTEX );
|
||||||
|
|
||||||
sp_sampler_varient_bind_texture( softpipe->tgsi.vert_samplers_list[i],
|
sp_sampler_variant_bind_texture( softpipe->tgsi.vert_samplers_list[i],
|
||||||
softpipe->vertex_tex_cache[i],
|
softpipe->vertex_tex_cache[i],
|
||||||
texture );
|
texture );
|
||||||
}
|
}
|
||||||
@@ -372,14 +372,14 @@ softpipe_reset_sampler_varients(struct softpipe_context *softpipe)
|
|||||||
}
|
}
|
||||||
|
|
||||||
softpipe->tgsi.geom_samplers_list[i] =
|
softpipe->tgsi.geom_samplers_list[i] =
|
||||||
get_sampler_varient(
|
get_sampler_variant(
|
||||||
i,
|
i,
|
||||||
sp_sampler(softpipe->geometry_samplers[i]),
|
sp_sampler(softpipe->geometry_samplers[i]),
|
||||||
softpipe->geometry_sampler_views[i],
|
softpipe->geometry_sampler_views[i],
|
||||||
texture,
|
texture,
|
||||||
TGSI_PROCESSOR_GEOMETRY );
|
TGSI_PROCESSOR_GEOMETRY );
|
||||||
|
|
||||||
sp_sampler_varient_bind_texture(
|
sp_sampler_variant_bind_texture(
|
||||||
softpipe->tgsi.geom_samplers_list[i],
|
softpipe->tgsi.geom_samplers_list[i],
|
||||||
softpipe->geometry_tex_cache[i],
|
softpipe->geometry_tex_cache[i],
|
||||||
texture );
|
texture );
|
||||||
@@ -396,13 +396,13 @@ softpipe_reset_sampler_varients(struct softpipe_context *softpipe)
|
|||||||
}
|
}
|
||||||
|
|
||||||
softpipe->tgsi.frag_samplers_list[i] =
|
softpipe->tgsi.frag_samplers_list[i] =
|
||||||
get_sampler_varient( i,
|
get_sampler_variant( i,
|
||||||
sp_sampler(softpipe->sampler[i]),
|
sp_sampler(softpipe->sampler[i]),
|
||||||
softpipe->sampler_views[i],
|
softpipe->sampler_views[i],
|
||||||
texture,
|
texture,
|
||||||
TGSI_PROCESSOR_FRAGMENT );
|
TGSI_PROCESSOR_FRAGMENT );
|
||||||
|
|
||||||
sp_sampler_varient_bind_texture( softpipe->tgsi.frag_samplers_list[i],
|
sp_sampler_variant_bind_texture( softpipe->tgsi.frag_samplers_list[i],
|
||||||
softpipe->tex_cache[i],
|
softpipe->tex_cache[i],
|
||||||
texture );
|
texture );
|
||||||
}
|
}
|
||||||
@@ -414,11 +414,11 @@ softpipe_delete_sampler_state(struct pipe_context *pipe,
|
|||||||
void *sampler)
|
void *sampler)
|
||||||
{
|
{
|
||||||
struct sp_sampler *sp_sampler = (struct sp_sampler *)sampler;
|
struct sp_sampler *sp_sampler = (struct sp_sampler *)sampler;
|
||||||
struct sp_sampler_varient *v, *tmp;
|
struct sp_sampler_variant *v, *tmp;
|
||||||
|
|
||||||
for (v = sp_sampler->varients; v; v = tmp) {
|
for (v = sp_sampler->variants; v; v = tmp) {
|
||||||
tmp = v->next;
|
tmp = v->next;
|
||||||
sp_sampler_varient_destroy(v);
|
sp_sampler_variant_destroy(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
FREE( sampler );
|
FREE( sampler );
|
||||||
|
@@ -545,7 +545,7 @@ wrap_linear_unorm_clamp_to_edge(const float s[4], unsigned size,
|
|||||||
* derivatives w.r.t X and Y, then compute lambda (level of detail).
|
* derivatives w.r.t X and Y, then compute lambda (level of detail).
|
||||||
*/
|
*/
|
||||||
static float
|
static float
|
||||||
compute_lambda_1d(const struct sp_sampler_varient *samp,
|
compute_lambda_1d(const struct sp_sampler_variant *samp,
|
||||||
const float s[QUAD_SIZE],
|
const float s[QUAD_SIZE],
|
||||||
const float t[QUAD_SIZE],
|
const float t[QUAD_SIZE],
|
||||||
const float p[QUAD_SIZE])
|
const float p[QUAD_SIZE])
|
||||||
@@ -560,7 +560,7 @@ compute_lambda_1d(const struct sp_sampler_varient *samp,
|
|||||||
|
|
||||||
|
|
||||||
static float
|
static float
|
||||||
compute_lambda_2d(const struct sp_sampler_varient *samp,
|
compute_lambda_2d(const struct sp_sampler_variant *samp,
|
||||||
const float s[QUAD_SIZE],
|
const float s[QUAD_SIZE],
|
||||||
const float t[QUAD_SIZE],
|
const float t[QUAD_SIZE],
|
||||||
const float p[QUAD_SIZE])
|
const float p[QUAD_SIZE])
|
||||||
@@ -579,7 +579,7 @@ compute_lambda_2d(const struct sp_sampler_varient *samp,
|
|||||||
|
|
||||||
|
|
||||||
static float
|
static float
|
||||||
compute_lambda_3d(const struct sp_sampler_varient *samp,
|
compute_lambda_3d(const struct sp_sampler_variant *samp,
|
||||||
const float s[QUAD_SIZE],
|
const float s[QUAD_SIZE],
|
||||||
const float t[QUAD_SIZE],
|
const float t[QUAD_SIZE],
|
||||||
const float p[QUAD_SIZE])
|
const float p[QUAD_SIZE])
|
||||||
@@ -608,7 +608,7 @@ compute_lambda_3d(const struct sp_sampler_varient *samp,
|
|||||||
* Since there aren't derivatives to use, just return 0.
|
* Since there aren't derivatives to use, just return 0.
|
||||||
*/
|
*/
|
||||||
static float
|
static float
|
||||||
compute_lambda_vert(const struct sp_sampler_varient *samp,
|
compute_lambda_vert(const struct sp_sampler_variant *samp,
|
||||||
const float s[QUAD_SIZE],
|
const float s[QUAD_SIZE],
|
||||||
const float t[QUAD_SIZE],
|
const float t[QUAD_SIZE],
|
||||||
const float p[QUAD_SIZE])
|
const float p[QUAD_SIZE])
|
||||||
@@ -634,7 +634,7 @@ compute_lambda_vert(const struct sp_sampler_varient *samp,
|
|||||||
|
|
||||||
|
|
||||||
static INLINE const float *
|
static INLINE const float *
|
||||||
get_texel_2d_no_border(const struct sp_sampler_varient *samp,
|
get_texel_2d_no_border(const struct sp_sampler_variant *samp,
|
||||||
union tex_tile_address addr, int x, int y)
|
union tex_tile_address addr, int x, int y)
|
||||||
{
|
{
|
||||||
const struct softpipe_tex_cached_tile *tile;
|
const struct softpipe_tex_cached_tile *tile;
|
||||||
@@ -651,7 +651,7 @@ get_texel_2d_no_border(const struct sp_sampler_varient *samp,
|
|||||||
|
|
||||||
|
|
||||||
static INLINE const float *
|
static INLINE const float *
|
||||||
get_texel_2d(const struct sp_sampler_varient *samp,
|
get_texel_2d(const struct sp_sampler_variant *samp,
|
||||||
union tex_tile_address addr, int x, int y)
|
union tex_tile_address addr, int x, int y)
|
||||||
{
|
{
|
||||||
const struct pipe_resource *texture = samp->texture;
|
const struct pipe_resource *texture = samp->texture;
|
||||||
@@ -671,7 +671,7 @@ get_texel_2d(const struct sp_sampler_varient *samp,
|
|||||||
/* Gather a quad of adjacent texels within a tile:
|
/* Gather a quad of adjacent texels within a tile:
|
||||||
*/
|
*/
|
||||||
static INLINE void
|
static INLINE void
|
||||||
get_texel_quad_2d_no_border_single_tile(const struct sp_sampler_varient *samp,
|
get_texel_quad_2d_no_border_single_tile(const struct sp_sampler_variant *samp,
|
||||||
union tex_tile_address addr,
|
union tex_tile_address addr,
|
||||||
unsigned x, unsigned y,
|
unsigned x, unsigned y,
|
||||||
const float *out[4])
|
const float *out[4])
|
||||||
@@ -695,7 +695,7 @@ get_texel_quad_2d_no_border_single_tile(const struct sp_sampler_varient *samp,
|
|||||||
/* Gather a quad of potentially non-adjacent texels:
|
/* Gather a quad of potentially non-adjacent texels:
|
||||||
*/
|
*/
|
||||||
static INLINE void
|
static INLINE void
|
||||||
get_texel_quad_2d_no_border(const struct sp_sampler_varient *samp,
|
get_texel_quad_2d_no_border(const struct sp_sampler_variant *samp,
|
||||||
union tex_tile_address addr,
|
union tex_tile_address addr,
|
||||||
int x0, int y0,
|
int x0, int y0,
|
||||||
int x1, int y1,
|
int x1, int y1,
|
||||||
@@ -710,7 +710,7 @@ get_texel_quad_2d_no_border(const struct sp_sampler_varient *samp,
|
|||||||
/* Can involve a lot of unnecessary checks for border color:
|
/* Can involve a lot of unnecessary checks for border color:
|
||||||
*/
|
*/
|
||||||
static INLINE void
|
static INLINE void
|
||||||
get_texel_quad_2d(const struct sp_sampler_varient *samp,
|
get_texel_quad_2d(const struct sp_sampler_variant *samp,
|
||||||
union tex_tile_address addr,
|
union tex_tile_address addr,
|
||||||
int x0, int y0,
|
int x0, int y0,
|
||||||
int x1, int y1,
|
int x1, int y1,
|
||||||
@@ -724,10 +724,10 @@ get_texel_quad_2d(const struct sp_sampler_varient *samp,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* 3d varients:
|
/* 3d variants:
|
||||||
*/
|
*/
|
||||||
static INLINE const float *
|
static INLINE const float *
|
||||||
get_texel_3d_no_border(const struct sp_sampler_varient *samp,
|
get_texel_3d_no_border(const struct sp_sampler_variant *samp,
|
||||||
union tex_tile_address addr, int x, int y, int z)
|
union tex_tile_address addr, int x, int y, int z)
|
||||||
{
|
{
|
||||||
const struct softpipe_tex_cached_tile *tile;
|
const struct softpipe_tex_cached_tile *tile;
|
||||||
@@ -745,7 +745,7 @@ get_texel_3d_no_border(const struct sp_sampler_varient *samp,
|
|||||||
|
|
||||||
|
|
||||||
static INLINE const float *
|
static INLINE const float *
|
||||||
get_texel_3d(const struct sp_sampler_varient *samp,
|
get_texel_3d(const struct sp_sampler_variant *samp,
|
||||||
union tex_tile_address addr, int x, int y, int z)
|
union tex_tile_address addr, int x, int y, int z)
|
||||||
{
|
{
|
||||||
const struct pipe_resource *texture = samp->texture;
|
const struct pipe_resource *texture = samp->texture;
|
||||||
@@ -800,7 +800,7 @@ img_filter_2d_linear_repeat_POT(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
const struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
unsigned j;
|
unsigned j;
|
||||||
unsigned level = samp->level;
|
unsigned level = samp->level;
|
||||||
unsigned xpot = pot_level_size(samp->xpot, level);
|
unsigned xpot = pot_level_size(samp->xpot, level);
|
||||||
@@ -863,7 +863,7 @@ img_filter_2d_nearest_repeat_POT(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
const struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
unsigned j;
|
unsigned j;
|
||||||
unsigned level = samp->level;
|
unsigned level = samp->level;
|
||||||
unsigned xpot = pot_level_size(samp->xpot, level);
|
unsigned xpot = pot_level_size(samp->xpot, level);
|
||||||
@@ -907,7 +907,7 @@ img_filter_2d_nearest_clamp_POT(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
const struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
unsigned j;
|
unsigned j;
|
||||||
unsigned level = samp->level;
|
unsigned level = samp->level;
|
||||||
unsigned xpot = pot_level_size(samp->xpot, level);
|
unsigned xpot = pot_level_size(samp->xpot, level);
|
||||||
@@ -960,7 +960,7 @@ img_filter_1d_nearest(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
const struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
const struct pipe_resource *texture = samp->texture;
|
const struct pipe_resource *texture = samp->texture;
|
||||||
unsigned level0, j;
|
unsigned level0, j;
|
||||||
int width;
|
int width;
|
||||||
@@ -1000,7 +1000,7 @@ img_filter_2d_nearest(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
const struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
const struct pipe_resource *texture = samp->texture;
|
const struct pipe_resource *texture = samp->texture;
|
||||||
unsigned level0, j;
|
unsigned level0, j;
|
||||||
int width, height;
|
int width, height;
|
||||||
@@ -1052,7 +1052,7 @@ img_filter_cube_nearest(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
const struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
const struct pipe_resource *texture = samp->texture;
|
const struct pipe_resource *texture = samp->texture;
|
||||||
const unsigned *faces = samp->faces; /* zero when not cube-mapping */
|
const unsigned *faces = samp->faces; /* zero when not cube-mapping */
|
||||||
unsigned level0, j;
|
unsigned level0, j;
|
||||||
@@ -1096,7 +1096,7 @@ img_filter_3d_nearest(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
const struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
const struct pipe_resource *texture = samp->texture;
|
const struct pipe_resource *texture = samp->texture;
|
||||||
unsigned level0, j;
|
unsigned level0, j;
|
||||||
int width, height, depth;
|
int width, height, depth;
|
||||||
@@ -1138,7 +1138,7 @@ img_filter_1d_linear(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
const struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
const struct pipe_resource *texture = samp->texture;
|
const struct pipe_resource *texture = samp->texture;
|
||||||
unsigned level0, j;
|
unsigned level0, j;
|
||||||
int width;
|
int width;
|
||||||
@@ -1178,7 +1178,7 @@ img_filter_2d_linear(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
const struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
const struct pipe_resource *texture = samp->texture;
|
const struct pipe_resource *texture = samp->texture;
|
||||||
unsigned level0, j;
|
unsigned level0, j;
|
||||||
int width, height;
|
int width, height;
|
||||||
@@ -1225,7 +1225,7 @@ img_filter_cube_linear(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
const struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
const struct pipe_resource *texture = samp->texture;
|
const struct pipe_resource *texture = samp->texture;
|
||||||
const unsigned *faces = samp->faces; /* zero when not cube-mapping */
|
const unsigned *faces = samp->faces; /* zero when not cube-mapping */
|
||||||
unsigned level0, j;
|
unsigned level0, j;
|
||||||
@@ -1274,7 +1274,7 @@ img_filter_3d_linear(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
const struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
const struct pipe_resource *texture = samp->texture;
|
const struct pipe_resource *texture = samp->texture;
|
||||||
unsigned level0, j;
|
unsigned level0, j;
|
||||||
int width, height, depth;
|
int width, height, depth;
|
||||||
@@ -1350,7 +1350,7 @@ mip_filter_linear(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
const struct pipe_resource *texture = samp->texture;
|
const struct pipe_resource *texture = samp->texture;
|
||||||
int level0;
|
int level0;
|
||||||
float lambda;
|
float lambda;
|
||||||
@@ -1417,7 +1417,7 @@ mip_filter_nearest(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
const struct pipe_resource *texture = samp->texture;
|
const struct pipe_resource *texture = samp->texture;
|
||||||
float lambda;
|
float lambda;
|
||||||
float lod[QUAD_SIZE];
|
float lod[QUAD_SIZE];
|
||||||
@@ -1460,7 +1460,7 @@ mip_filter_none(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
float lambda;
|
float lambda;
|
||||||
float lod[QUAD_SIZE];
|
float lod[QUAD_SIZE];
|
||||||
|
|
||||||
@@ -1501,7 +1501,7 @@ mip_filter_linear_2d_linear_repeat_POT(
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
const struct pipe_resource *texture = samp->texture;
|
const struct pipe_resource *texture = samp->texture;
|
||||||
int level0;
|
int level0;
|
||||||
float lambda;
|
float lambda;
|
||||||
@@ -1569,7 +1569,7 @@ sample_compare(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
const struct pipe_sampler_state *sampler = samp->sampler;
|
const struct pipe_sampler_state *sampler = samp->sampler;
|
||||||
int j, k0, k1, k2, k3;
|
int j, k0, k1, k2, k3;
|
||||||
float val;
|
float val;
|
||||||
@@ -1656,7 +1656,7 @@ sample_cube(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
unsigned j;
|
unsigned j;
|
||||||
float ssss[4], tttt[4];
|
float ssss[4], tttt[4];
|
||||||
|
|
||||||
@@ -1740,7 +1740,7 @@ sample_swizzle(struct tgsi_sampler *tgsi_sampler,
|
|||||||
enum tgsi_sampler_control control,
|
enum tgsi_sampler_control control,
|
||||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||||
{
|
{
|
||||||
struct sp_sampler_varient *samp = sp_sampler_varient(tgsi_sampler);
|
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||||
float rgba_temp[NUM_CHANNELS][QUAD_SIZE];
|
float rgba_temp[NUM_CHANNELS][QUAD_SIZE];
|
||||||
const unsigned swizzle_r = samp->key.bits.swizzle_r;
|
const unsigned swizzle_r = samp->key.bits.swizzle_r;
|
||||||
const unsigned swizzle_g = samp->key.bits.swizzle_g;
|
const unsigned swizzle_g = samp->key.bits.swizzle_g;
|
||||||
@@ -1989,10 +1989,10 @@ get_img_filter(const union sp_sampler_key key,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bind the given texture object and texture cache to the sampler varient.
|
* Bind the given texture object and texture cache to the sampler variant.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
sp_sampler_varient_bind_texture( struct sp_sampler_varient *samp,
|
sp_sampler_variant_bind_texture( struct sp_sampler_variant *samp,
|
||||||
struct softpipe_tex_tile_cache *tex_cache,
|
struct softpipe_tex_tile_cache *tex_cache,
|
||||||
const struct pipe_resource *texture )
|
const struct pipe_resource *texture )
|
||||||
{
|
{
|
||||||
@@ -2007,20 +2007,20 @@ sp_sampler_varient_bind_texture( struct sp_sampler_varient *samp,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
sp_sampler_varient_destroy( struct sp_sampler_varient *samp )
|
sp_sampler_variant_destroy( struct sp_sampler_variant *samp )
|
||||||
{
|
{
|
||||||
FREE(samp);
|
FREE(samp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a sampler varient for a given set of non-orthogonal state.
|
* Create a sampler variant for a given set of non-orthogonal state.
|
||||||
*/
|
*/
|
||||||
struct sp_sampler_varient *
|
struct sp_sampler_variant *
|
||||||
sp_create_sampler_varient( const struct pipe_sampler_state *sampler,
|
sp_create_sampler_variant( const struct pipe_sampler_state *sampler,
|
||||||
const union sp_sampler_key key )
|
const union sp_sampler_key key )
|
||||||
{
|
{
|
||||||
struct sp_sampler_varient *samp = CALLOC_STRUCT(sp_sampler_varient);
|
struct sp_sampler_variant *samp = CALLOC_STRUCT(sp_sampler_variant);
|
||||||
if (!samp)
|
if (!samp)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "tgsi/tgsi_exec.h"
|
#include "tgsi/tgsi_exec.h"
|
||||||
|
|
||||||
struct sp_sampler_varient;
|
struct sp_sampler_variant;
|
||||||
|
|
||||||
typedef void (*wrap_nearest_func)(const float s[4],
|
typedef void (*wrap_nearest_func)(const float s[4],
|
||||||
unsigned size,
|
unsigned size,
|
||||||
@@ -44,7 +44,7 @@ typedef void (*wrap_linear_func)(const float s[4],
|
|||||||
int icoord1[4],
|
int icoord1[4],
|
||||||
float w[4]);
|
float w[4]);
|
||||||
|
|
||||||
typedef float (*compute_lambda_func)(const struct sp_sampler_varient *sampler,
|
typedef float (*compute_lambda_func)(const struct sp_sampler_variant *sampler,
|
||||||
const float s[QUAD_SIZE],
|
const float s[QUAD_SIZE],
|
||||||
const float t[QUAD_SIZE],
|
const float t[QUAD_SIZE],
|
||||||
const float p[QUAD_SIZE]);
|
const float p[QUAD_SIZE]);
|
||||||
@@ -76,7 +76,7 @@ union sp_sampler_key {
|
|||||||
/**
|
/**
|
||||||
* Subclass of tgsi_sampler
|
* Subclass of tgsi_sampler
|
||||||
*/
|
*/
|
||||||
struct sp_sampler_varient
|
struct sp_sampler_variant
|
||||||
{
|
{
|
||||||
struct tgsi_sampler base; /**< base class */
|
struct tgsi_sampler base; /**< base class */
|
||||||
|
|
||||||
@@ -121,29 +121,29 @@ struct sp_sampler_varient
|
|||||||
|
|
||||||
/* Linked list:
|
/* Linked list:
|
||||||
*/
|
*/
|
||||||
struct sp_sampler_varient *next;
|
struct sp_sampler_variant *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sp_sampler;
|
struct sp_sampler;
|
||||||
|
|
||||||
/* Create a sampler varient for a given set of non-orthogonal state. Currently the
|
/* Create a sampler variant for a given set of non-orthogonal state. Currently the
|
||||||
*/
|
*/
|
||||||
struct sp_sampler_varient *
|
struct sp_sampler_variant *
|
||||||
sp_create_sampler_varient( const struct pipe_sampler_state *sampler,
|
sp_create_sampler_variant( const struct pipe_sampler_state *sampler,
|
||||||
const union sp_sampler_key key );
|
const union sp_sampler_key key );
|
||||||
|
|
||||||
void sp_sampler_varient_bind_texture( struct sp_sampler_varient *varient,
|
void sp_sampler_variant_bind_texture( struct sp_sampler_variant *variant,
|
||||||
struct softpipe_tex_tile_cache *tex_cache,
|
struct softpipe_tex_tile_cache *tex_cache,
|
||||||
const struct pipe_resource *tex );
|
const struct pipe_resource *tex );
|
||||||
|
|
||||||
void sp_sampler_varient_destroy( struct sp_sampler_varient * );
|
void sp_sampler_variant_destroy( struct sp_sampler_variant * );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static INLINE struct sp_sampler_varient *
|
static INLINE struct sp_sampler_variant *
|
||||||
sp_sampler_varient(const struct tgsi_sampler *sampler)
|
sp_sampler_variant(const struct tgsi_sampler *sampler)
|
||||||
{
|
{
|
||||||
return (struct sp_sampler_varient *) sampler;
|
return (struct sp_sampler_variant *) sampler;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
|
Reference in New Issue
Block a user