projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '7.8' into master
[mesa.git]
/
src
/
gallium
/
drivers
/
llvmpipe
/
lp_setup.c
diff --git
a/src/gallium/drivers/llvmpipe/lp_setup.c
b/src/gallium/drivers/llvmpipe/lp_setup.c
index c870f89d01d4d78ff836c564281ecf9639b9c03c..cd16b6b2d38783010e3494964a87642cbb208486 100644
(file)
--- a/
src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/
src/gallium/drivers/llvmpipe/lp_setup.c
@@
-52,11
+52,11
@@
#include "draw/draw_vbuf.h"
#include "draw/draw_vbuf.h"
-static void set_scene_state( struct setup_context *, unsigned );
+static void set_scene_state( struct
lp_
setup_context *, unsigned );
struct lp_scene *
struct lp_scene *
-lp_setup_get_current_scene(struct setup_context *setup)
+lp_setup_get_current_scene(struct
lp_
setup_context *setup)
{
if (!setup->scene) {
{
if (!setup->scene) {
@@
-74,7
+74,7
@@
lp_setup_get_current_scene(struct setup_context *setup)
static void
static void
-first_triangle( struct setup_context *setup,
+first_triangle( struct
lp_
setup_context *setup,
const float (*v0)[4],
const float (*v1)[4],
const float (*v2)[4])
const float (*v0)[4],
const float (*v1)[4],
const float (*v2)[4])
@@
-85,7
+85,7
@@
first_triangle( struct setup_context *setup,
}
static void
}
static void
-first_line( struct setup_context *setup,
+first_line( struct
lp_
setup_context *setup,
const float (*v0)[4],
const float (*v1)[4])
{
const float (*v0)[4],
const float (*v1)[4])
{
@@
-95,7
+95,7
@@
first_line( struct setup_context *setup,
}
static void
}
static void
-first_point( struct setup_context *setup,
+first_point( struct
lp_
setup_context *setup,
const float (*v0)[4])
{
set_scene_state( setup, SETUP_ACTIVE );
const float (*v0)[4])
{
set_scene_state( setup, SETUP_ACTIVE );
@@
-103,7
+103,7
@@
first_point( struct setup_context *setup,
setup->point( setup, v0 );
}
setup->point( setup, v0 );
}
-static void reset_context( struct setup_context *setup )
+static void reset_context( struct
lp_
setup_context *setup )
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
@@
-131,7
+131,7
@@
static void reset_context( struct setup_context *setup )
/** Rasterize all scene's bins */
static void
/** Rasterize all scene's bins */
static void
-lp_setup_rasterize_scene( struct setup_context *setup,
+lp_setup_rasterize_scene( struct
lp_
setup_context *setup,
boolean write_depth )
{
struct lp_scene *scene = lp_setup_get_current_scene(setup);
boolean write_depth )
{
struct lp_scene *scene = lp_setup_get_current_scene(setup);
@@
-148,7
+148,7
@@
lp_setup_rasterize_scene( struct setup_context *setup,
static void
static void
-begin_binning( struct setup_context *setup )
+begin_binning( struct
lp_
setup_context *setup )
{
struct lp_scene *scene = lp_setup_get_current_scene(setup);
{
struct lp_scene *scene = lp_setup_get_current_scene(setup);
@@
-184,7
+184,7
@@
begin_binning( struct setup_context *setup )
* TODO: fast path for fullscreen clears and no triangles.
*/
static void
* TODO: fast path for fullscreen clears and no triangles.
*/
static void
-execute_clears( struct setup_context *setup )
+execute_clears( struct
lp_
setup_context *setup )
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
@@
-194,7
+194,7
@@
execute_clears( struct setup_context *setup )
static void
static void
-set_scene_state( struct setup_context *setup,
+set_scene_state( struct
lp_
setup_context *setup,
unsigned new_state )
{
unsigned old_state = setup->state;
unsigned new_state )
{
unsigned old_state = setup->state;
@@
-229,7
+229,7
@@
set_scene_state( struct setup_context *setup,
void
void
-lp_setup_flush( struct setup_context *setup,
+lp_setup_flush( struct
lp_
setup_context *setup,
unsigned flags )
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
unsigned flags )
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
@@
-239,7
+239,7
@@
lp_setup_flush( struct setup_context *setup,
void
void
-lp_setup_bind_framebuffer( struct setup_context *setup,
+lp_setup_bind_framebuffer( struct
lp_
setup_context *setup,
const struct pipe_framebuffer_state *fb )
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
const struct pipe_framebuffer_state *fb )
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
@@
-256,7
+256,7
@@
lp_setup_bind_framebuffer( struct setup_context *setup,
void
void
-lp_setup_clear( struct setup_context *setup,
+lp_setup_clear( struct
lp_
setup_context *setup,
const float *color,
double depth,
unsigned stencil,
const float *color,
double depth,
unsigned stencil,
@@
-314,7
+314,7
@@
lp_setup_clear( struct setup_context *setup,
* Emit a fence.
*/
struct pipe_fence_handle *
* Emit a fence.
*/
struct pipe_fence_handle *
-lp_setup_fence( struct setup_context *setup )
+lp_setup_fence( struct
lp_
setup_context *setup )
{
struct lp_scene *scene = lp_setup_get_current_scene(setup);
const unsigned rank = lp_scene_get_num_bins( scene ); /* xxx */
{
struct lp_scene *scene = lp_setup_get_current_scene(setup);
const unsigned rank = lp_scene_get_num_bins( scene ); /* xxx */
@@
-334,10
+334,11
@@
lp_setup_fence( struct setup_context *setup )
void
void
-lp_setup_set_triangle_state( struct setup_context *setup,
+lp_setup_set_triangle_state( struct
lp_
setup_context *setup,
unsigned cull_mode,
boolean ccw_is_frontface,
unsigned cull_mode,
boolean ccw_is_frontface,
- boolean scissor )
+ boolean scissor,
+ boolean gl_rasterization_rules)
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
@@
-345,12
+346,13
@@
lp_setup_set_triangle_state( struct setup_context *setup,
setup->cullmode = cull_mode;
setup->triangle = first_triangle;
setup->scissor_test = scissor;
setup->cullmode = cull_mode;
setup->triangle = first_triangle;
setup->scissor_test = scissor;
+ setup->pixel_offset = gl_rasterization_rules ? 0.5f : 0.0f;
}
void
}
void
-lp_setup_set_fs_inputs( struct setup_context *setup,
+lp_setup_set_fs_inputs( struct
lp_
setup_context *setup,
const struct lp_shader_input *input,
unsigned nr )
{
const struct lp_shader_input *input,
unsigned nr )
{
@@
-361,7
+363,7
@@
lp_setup_set_fs_inputs( struct setup_context *setup,
}
void
}
void
-lp_setup_set_fs_functions( struct setup_context *setup,
+lp_setup_set_fs_functions( struct
lp_
setup_context *setup,
lp_jit_frag_func jit_function0,
lp_jit_frag_func jit_function1,
boolean opaque )
lp_jit_frag_func jit_function0,
lp_jit_frag_func jit_function1,
boolean opaque )
@@
-376,7
+378,7
@@
lp_setup_set_fs_functions( struct setup_context *setup,
}
void
}
void
-lp_setup_set_fs_constants(struct setup_context *setup,
+lp_setup_set_fs_constants(struct
lp_
setup_context *setup,
struct pipe_buffer *buffer)
{
LP_DBG(DEBUG_SETUP, "%s %p\n", __FUNCTION__, (void *) buffer);
struct pipe_buffer *buffer)
{
LP_DBG(DEBUG_SETUP, "%s %p\n", __FUNCTION__, (void *) buffer);
@@
-388,7
+390,7
@@
lp_setup_set_fs_constants(struct setup_context *setup,
void
void
-lp_setup_set_alpha_ref_value( struct setup_context *setup,
+lp_setup_set_alpha_ref_value( struct
lp_
setup_context *setup,
float alpha_ref_value )
{
LP_DBG(DEBUG_SETUP, "%s %f\n", __FUNCTION__, alpha_ref_value);
float alpha_ref_value )
{
LP_DBG(DEBUG_SETUP, "%s %f\n", __FUNCTION__, alpha_ref_value);
@@
-400,7
+402,7
@@
lp_setup_set_alpha_ref_value( struct setup_context *setup,
}
void
}
void
-lp_setup_set_blend_color( struct setup_context *setup,
+lp_setup_set_blend_color( struct
lp_
setup_context *setup,
const struct pipe_blend_color *blend_color )
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
const struct pipe_blend_color *blend_color )
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
@@
-415,7
+417,7
@@
lp_setup_set_blend_color( struct setup_context *setup,
void
void
-lp_setup_set_scissor( struct setup_context *setup,
+lp_setup_set_scissor( struct
lp_
setup_context *setup,
const struct pipe_scissor_state *scissor )
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
const struct pipe_scissor_state *scissor )
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
@@
-430,7
+432,7
@@
lp_setup_set_scissor( struct setup_context *setup,
void
void
-lp_setup_set_flatshade_first( struct setup_context *setup,
+lp_setup_set_flatshade_first( struct
lp_
setup_context *setup,
boolean flatshade_first )
{
setup->flatshade_first = flatshade_first;
boolean flatshade_first )
{
setup->flatshade_first = flatshade_first;
@@
-438,7
+440,7
@@
lp_setup_set_flatshade_first( struct setup_context *setup,
void
void
-lp_setup_set_vertex_info( struct setup_context *setup,
+lp_setup_set_vertex_info( struct
lp_
setup_context *setup,
struct vertex_info *vertex_info )
{
/* XXX: just silently holding onto the pointer:
struct vertex_info *vertex_info )
{
/* XXX: just silently holding onto the pointer:
@@
-448,11
+450,12
@@
lp_setup_set_vertex_info( struct setup_context *setup,
/**
/**
- * Called during state validation when LP_NEW_
TEXTURE
is set.
+ * Called during state validation when LP_NEW_
SAMPLER_VIEW
is set.
*/
void
*/
void
-lp_setup_set_sampler_textures( struct setup_context *setup,
- unsigned num, struct pipe_texture **texture)
+lp_setup_set_fragment_sampler_views(struct lp_setup_context *setup,
+ unsigned num,
+ struct pipe_sampler_view **views)
{
unsigned i;
{
unsigned i;
@@
-461,9
+464,10
@@
lp_setup_set_sampler_textures( struct setup_context *setup,
assert(num <= PIPE_MAX_SAMPLERS);
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
assert(num <= PIPE_MAX_SAMPLERS);
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
- struct pipe_
texture *tex = i < num ? texture
[i] : NULL;
+ struct pipe_
sampler_view *view = i < num ? views
[i] : NULL;
- if(tex) {
+ if(view) {
+ struct pipe_texture *tex = view->texture;
struct llvmpipe_texture *lp_tex = llvmpipe_texture(tex);
struct lp_jit_texture *jit_tex;
jit_tex = &setup->fs.current.jit_context.textures[i];
struct llvmpipe_texture *lp_tex = llvmpipe_texture(tex);
struct lp_jit_texture *jit_tex;
jit_tex = &setup->fs.current.jit_context.textures[i];
@@
-512,7
+516,7
@@
lp_setup_set_sampler_textures( struct setup_context *setup,
* being rendered and the current scene being built.
*/
unsigned
* being rendered and the current scene being built.
*/
unsigned
-lp_setup_is_texture_referenced( const struct setup_context *setup,
+lp_setup_is_texture_referenced( const struct
lp_
setup_context *setup,
const struct pipe_texture *texture )
{
unsigned i;
const struct pipe_texture *texture )
{
unsigned i;
@@
-541,7
+545,7
@@
lp_setup_is_texture_referenced( const struct setup_context *setup,
* Called by vbuf code when we're about to draw something.
*/
void
* Called by vbuf code when we're about to draw something.
*/
void
-lp_setup_update_state( struct setup_context *setup )
+lp_setup_update_state( struct
lp_
setup_context *setup )
{
struct lp_scene *scene = lp_setup_get_current_scene(setup);
{
struct lp_scene *scene = lp_setup_get_current_scene(setup);
@@
-659,7
+663,7
@@
lp_setup_update_state( struct setup_context *setup )
/* Only caller is lp_setup_vbuf_destroy()
*/
void
/* Only caller is lp_setup_vbuf_destroy()
*/
void
-lp_setup_destroy( struct setup_context *setup )
+lp_setup_destroy( struct
lp_
setup_context *setup )
{
reset_context( setup );
{
reset_context( setup );
@@
-684,12
+688,12
@@
lp_setup_destroy( struct setup_context *setup )
* the draw module. Currently also creates a rasterizer to use with
* it.
*/
* the draw module. Currently also creates a rasterizer to use with
* it.
*/
-struct setup_context *
+struct
lp_
setup_context *
lp_setup_create( struct pipe_context *pipe,
struct draw_context *draw )
{
unsigned i;
lp_setup_create( struct pipe_context *pipe,
struct draw_context *draw )
{
unsigned i;
- struct
setup_context *setup = CALLOC_STRUCT(
setup_context);
+ struct
lp_setup_context *setup = CALLOC_STRUCT(lp_
setup_context);
if (!setup)
return NULL;
if (!setup)
return NULL;