X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fgalahad%2Fglhd_context.c;h=2e61e5924a67832d9d755d5aa83b228d5c58d51a;hb=1d28650b551bb516fdff99d0a196c1fa133f6d05;hp=3df22ce332eee6c5a1981076fa88ff3e1769caa3;hpb=419cd5f2a24b87d31a2fd9dd9b7d0025b4f5515c;p=mesa.git diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c index 3df22ce332e..2e61e5924a6 100644 --- a/src/gallium/drivers/galahad/glhd_context.c +++ b/src/gallium/drivers/galahad/glhd_context.c @@ -197,49 +197,9 @@ galahad_context_bind_sampler_states(struct pipe_context *_pipe, num_samplers, PIPE_MAX_SAMPLERS); } - switch (shader) { - case PIPE_SHADER_VERTEX: - pipe->bind_vertex_sampler_states(pipe, num_samplers, samplers); - break; - case PIPE_SHADER_FRAGMENT: - pipe->bind_fragment_sampler_states(pipe, num_samplers, samplers); - break; - case PIPE_SHADER_GEOMETRY: - pipe->bind_geometry_sampler_states(pipe, num_samplers, samplers); - break; - default: - assert(0); - } -} - -static void -galahad_context_bind_vertex_sampler_states(struct pipe_context *_pipe, - unsigned num_samplers, - void **samplers) -{ - galahad_context_bind_sampler_states(_pipe, PIPE_SHADER_VERTEX, - 0, num_samplers, samplers); + pipe->bind_sampler_states(pipe, shader, start, num_samplers, samplers); } -static void -galahad_context_bind_fragment_sampler_states(struct pipe_context *_pipe, - unsigned num_samplers, - void **samplers) -{ - galahad_context_bind_sampler_states(_pipe, PIPE_SHADER_FRAGMENT, - 0, num_samplers, samplers); -} - -static void -galahad_context_bind_geometry_sampler_states(struct pipe_context *_pipe, - unsigned num_samplers, - void **samplers) -{ - galahad_context_bind_sampler_states(_pipe, PIPE_SHADER_GEOMETRY, - 0, num_samplers, samplers); -} - - static void galahad_context_delete_sampler_state(struct pipe_context *_pipe, void *sampler) @@ -558,59 +518,13 @@ galahad_context_set_sampler_views(struct pipe_context *_pipe, { struct galahad_context *glhd_pipe = galahad_context(_pipe); struct pipe_context *pipe = glhd_pipe->pipe; - struct pipe_sampler_view *unwrapped_views[PIPE_MAX_SAMPLERS]; - struct pipe_sampler_view **views = NULL; + struct pipe_sampler_view *unwrapped_views[PIPE_MAX_SHADER_SAMPLER_VIEWS]; unsigned i; - if (_views) { - for (i = 0; i < num; i++) - unwrapped_views[i] = galahad_sampler_view_unwrap(_views[i]); - for (; i < PIPE_MAX_SAMPLERS; i++) - unwrapped_views[i] = NULL; + for (i = 0; i < num; i++) + unwrapped_views[i] = galahad_sampler_view_unwrap(_views[i]); - views = unwrapped_views; - } - - switch (shader) { - case PIPE_SHADER_VERTEX: - pipe->set_vertex_sampler_views(pipe, num, views); - break; - case PIPE_SHADER_FRAGMENT: - pipe->set_fragment_sampler_views(pipe, num, views); - break; - case PIPE_SHADER_GEOMETRY: - pipe->set_geometry_sampler_views(pipe, num, views); - break; - default: - assert(0); - } -} - -static void -galahad_context_set_vertex_sampler_views(struct pipe_context *_pipe, - unsigned num, - struct pipe_sampler_view **_views) -{ - galahad_context_set_sampler_views(_pipe, PIPE_SHADER_VERTEX, - 0, num, _views); -} - -static void -galahad_context_set_fragment_sampler_views(struct pipe_context *_pipe, - unsigned num, - struct pipe_sampler_view **_views) -{ - galahad_context_set_sampler_views(_pipe, PIPE_SHADER_FRAGMENT, - 0, num, _views); -} - -static void -galahad_context_set_geometry_sampler_views(struct pipe_context *_pipe, - unsigned num, - struct pipe_sampler_view **_views) -{ - galahad_context_set_sampler_views(_pipe, PIPE_SHADER_GEOMETRY, - 0, num, _views); + pipe->set_sampler_views(pipe, shader, start, num, unwrapped_views); } static void @@ -699,12 +613,12 @@ static INLINE void galahad_context_set_stream_output_targets(struct pipe_context *_pipe, unsigned num_targets, struct pipe_stream_output_target **tgs, - unsigned append_bitmask) + const unsigned *offsets) { struct galahad_context *glhd_pipe = galahad_context(_pipe); struct pipe_context *pipe = glhd_pipe->pipe; - pipe->set_stream_output_targets(pipe, num_targets, tgs, append_bitmask); + pipe->set_stream_output_targets(pipe, num_targets, tgs, offsets); } static void @@ -1064,10 +978,7 @@ galahad_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) GLHD_PIPE_INIT(bind_blend_state); GLHD_PIPE_INIT(delete_blend_state); GLHD_PIPE_INIT(create_sampler_state); - GLHD_PIPE_INIT(bind_fragment_sampler_states); - GLHD_PIPE_INIT(bind_vertex_sampler_states); - GLHD_PIPE_INIT(bind_geometry_sampler_states); - //GLHD_PIPE_INIT(bind_compute_sampler_states); + GLHD_PIPE_INIT(bind_sampler_states); GLHD_PIPE_INIT(delete_sampler_state); GLHD_PIPE_INIT(create_rasterizer_state); GLHD_PIPE_INIT(bind_rasterizer_state); @@ -1096,10 +1007,7 @@ galahad_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) GLHD_PIPE_INIT(set_polygon_stipple); GLHD_PIPE_INIT(set_scissor_states); GLHD_PIPE_INIT(set_viewport_states); - GLHD_PIPE_INIT(set_fragment_sampler_views); - GLHD_PIPE_INIT(set_vertex_sampler_views); - GLHD_PIPE_INIT(set_geometry_sampler_views); - //GLHD_PIPE_INIT(set_compute_sampler_views); + GLHD_PIPE_INIT(set_sampler_views); //GLHD_PIPE_INIT(set_shader_resources); GLHD_PIPE_INIT(set_vertex_buffers); GLHD_PIPE_INIT(set_index_buffer);