summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/python/p_context.i
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/python/p_context.i')
-rw-r--r--src/gallium/state_trackers/python/p_context.i48
1 files changed, 41 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/python/p_context.i b/src/gallium/state_trackers/python/p_context.i
index a40aa1e518..84ce1a41e6 100644
--- a/src/gallium/state_trackers/python/p_context.i
+++ b/src/gallium/state_trackers/python/p_context.i
@@ -52,11 +52,16 @@ struct st_context {
cso_set_blend($self->cso, state);
}
- void set_sampler( unsigned index, const struct pipe_sampler_state *state ) {
+ void set_fragment_sampler( unsigned index, const struct pipe_sampler_state *state ) {
cso_single_sampler($self->cso, index, state);
cso_single_sampler_done($self->cso);
}
+ void set_vertex_sampler( unsigned index, const struct pipe_sampler_state *state ) {
+ cso_single_vertex_sampler($self->cso, index, state);
+ cso_single_vertex_sampler_done($self->cso);
+ }
+
void set_rasterizer( const struct pipe_rasterizer_state *state ) {
cso_set_rasterizer($self->cso, state);
}
@@ -103,6 +108,25 @@ struct st_context {
$self->vs = vs;
}
+ void set_geometry_shader( const struct pipe_shader_state *state ) {
+ void *gs;
+
+ if(!state) {
+ cso_set_geometry_shader_handle($self->cso, NULL);
+ return;
+ }
+
+ gs = $self->pipe->create_gs_state($self->pipe, state);
+ if(!gs)
+ return;
+
+ if(cso_set_geometry_shader_handle($self->cso, gs) != PIPE_OK)
+ return;
+
+ cso_delete_geometry_shader($self->cso, $self->gs);
+ $self->gs = gs;
+ }
+
/*
* Parameter-like state (or properties)
*/
@@ -142,14 +166,24 @@ struct st_context {
cso_set_viewport($self->cso, state);
}
- void set_sampler_texture(unsigned index,
- struct pipe_texture *texture) {
+ void set_fragment_sampler_texture(unsigned index,
+ struct pipe_texture *texture) {
+ if(!texture)
+ texture = $self->default_texture;
+ pipe_texture_reference(&$self->fragment_sampler_textures[index], texture);
+ $self->pipe->set_fragment_sampler_textures($self->pipe,
+ PIPE_MAX_SAMPLERS,
+ $self->fragment_sampler_textures);
+ }
+
+ void set_vertex_sampler_texture(unsigned index,
+ struct pipe_texture *texture) {
if(!texture)
texture = $self->default_texture;
- pipe_texture_reference(&$self->sampler_textures[index], texture);
- $self->pipe->set_sampler_textures($self->pipe,
- PIPE_MAX_SAMPLERS,
- $self->sampler_textures);
+ pipe_texture_reference(&$self->vertex_sampler_textures[index], texture);
+ $self->pipe->set_vertex_sampler_textures($self->pipe,
+ PIPE_MAX_VERTEX_SAMPLERS,
+ $self->vertex_sampler_textures);
}
void set_vertex_buffer(unsigned index,