*/
void
lp_sampler_static_state(struct lp_sampler_static_state *state,
- const struct pipe_resource *texture,
+ const struct pipe_sampler_view *view,
const struct pipe_sampler_state *sampler)
{
+ const struct pipe_resource *texture = view->texture;
+
memset(state, 0, sizeof *state);
if(!texture)
* regarding 1D/2D/3D/CUBE textures, wrap modes, etc.
*/
- state->format = texture->format;
+ state->format = view->format;
state->target = texture->target;
state->pot_width = util_is_pot(texture->width0);
state->pot_height = util_is_pot(texture->height0);
state->border_color[1] = sampler->border_color[1];
state->border_color[2] = sampler->border_color[2];
state->border_color[3] = sampler->border_color[3];
+
+ /*
+ * FIXME: Handle the remainder of pipe_sampler_view.
+ */
}
#include "gallivm/lp_bld.h"
struct pipe_resource;
+struct pipe_sampler_view;
struct pipe_sampler_state;
struct util_format_description;
struct lp_type;
*/
void
lp_sampler_static_state(struct lp_sampler_static_state *state,
- const struct pipe_resource *texture,
+ const struct pipe_sampler_view *view,
const struct pipe_sampler_state *sampler);
for(i = 0; i < PIPE_MAX_SAMPLERS; ++i)
if(shader->info.file_mask[TGSI_FILE_SAMPLER] & (1 << i))
- lp_sampler_static_state(&key->sampler[i], lp->fragment_sampler_views[i]->texture, lp->sampler[i]);
+ lp_sampler_static_state(&key->sampler[i], lp->fragment_sampler_views[i], lp->sampler[i]);
}