summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2009-04-04 00:31:49 -0700
committerCorbin Simpson <MostAwesomeDude@gmail.com>2009-04-04 00:36:04 -0700
commitbe1dbba0a4d0d75468461aff8c281a512a537ecc (patch)
tree6b0f57b58824d0d2d60025db3a13930beda03e4f /src/gallium/drivers/r300
parenta7dc04fa73f9879d94ab4abf8fcd6f38ee2e9531 (diff)
r300-gallium: Clean up compile warnings and strict compile errors.
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_emit.c20
-rw-r--r--src/gallium/drivers/r300/r300_query.c8
-rw-r--r--src/gallium/drivers/r300/r300_state.c1
-rw-r--r--src/gallium/drivers/r300/r300_surface.c12
-rw-r--r--src/gallium/drivers/r300/r300_surface.h6
5 files changed, 23 insertions, 24 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 989fba74df..0ee3233446 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -82,8 +82,8 @@ void r300_emit_dsa_state(struct r300_context* r300,
void r300_emit_fragment_shader(struct r300_context* r300,
struct r300_fragment_shader* fs)
{
- CS_LOCALS(r300);
int i;
+ CS_LOCALS(r300);
BEGIN_CS(22);
@@ -114,10 +114,10 @@ void r300_emit_fragment_shader(struct r300_context* r300,
void r500_emit_fragment_shader(struct r300_context* r300,
struct r500_fragment_shader* fs)
{
- CS_LOCALS(r300);
+ int i;
struct r300_constant_buffer* constants =
&r300->shader_constants[PIPE_SHADER_FRAGMENT];
- int i;
+ CS_LOCALS(r300);
BEGIN_CS(9 + (fs->instruction_count * 6) + (constants->count ? 3 : 0) +
(constants->count * 4));
@@ -156,9 +156,9 @@ void r500_emit_fragment_shader(struct r300_context* r300,
void r300_emit_fb_state(struct r300_context* r300,
struct pipe_framebuffer_state* fb)
{
- CS_LOCALS(r300);
- struct r300_texture* tex;
int i;
+ struct r300_texture* tex;
+ CS_LOCALS(r300);
BEGIN_CS((6 * fb->nr_cbufs) + (fb->zsbuf ? 6 : 0) + 4);
for (i = 0; i < fb->nr_cbufs; i++) {
@@ -217,9 +217,9 @@ void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs)
void r300_emit_rs_block_state(struct r300_context* r300,
struct r300_rs_block* rs)
{
+ int i;
struct r300_screen* r300screen = r300_screen(r300->context.screen);
CS_LOCALS(r300);
- int i;
BEGIN_CS(21);
if (r300screen->caps->is_r500) {
@@ -293,8 +293,8 @@ void r300_emit_texture(struct r300_context* r300,
void r300_emit_vertex_format_state(struct r300_context* r300)
{
- CS_LOCALS(r300);
int i;
+ CS_LOCALS(r300);
BEGIN_CS(26);
OUT_CS_REG(R300_VAP_VTX_SIZE, r300->vertex_info.vinfo.size);
@@ -328,9 +328,9 @@ void r300_emit_vertex_format_state(struct r300_context* r300)
void r300_emit_vertex_shader(struct r300_context* r300,
struct r300_vertex_shader* vs)
{
- CS_LOCALS(r300);
- struct r300_screen* r300screen = r300_screen(r300->context.screen);
int i;
+ struct r300_screen* r300screen = r300_screen(r300->context.screen);
+ CS_LOCALS(r300);
if (!r300screen->caps->has_tcl) {
debug_printf("r300: Implementation error: emit_vertex_shader called,"
@@ -368,8 +368,6 @@ void r300_emit_vertex_shader(struct r300_context* r300,
void r300_emit_viewport_state(struct r300_context* r300,
struct r300_viewport_state* viewport)
{
- /* XXX has_tcl */
- return;
CS_LOCALS(r300);
BEGIN_CS(7);
diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c
index 5f5f4c4dbd..8fc61c2dec 100644
--- a/src/gallium/drivers/r300/r300_query.c
+++ b/src/gallium/drivers/r300/r300_query.c
@@ -46,12 +46,12 @@ static void r300_destroy_query(struct pipe_context* pipe,
static void r300_begin_query(struct pipe_context* pipe,
struct pipe_query* query)
{
+ uint32_t* map;
struct r300_context* r300 = r300_context(pipe);
struct r300_query* q = (struct r300_query*)query;
CS_LOCALS(r300);
- uint32_t* map = pipe_buffer_map(pipe->screen, q->buf,
- PIPE_BUFFER_USAGE_CPU_WRITE);
+ map = pipe_buffer_map(pipe->screen, q->buf, PIPE_BUFFER_USAGE_CPU_WRITE);
*map = ~0;
pipe_buffer_unmap(pipe->screen, q->buf);
@@ -79,6 +79,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
uint64_t* result)
{
struct r300_query* q = (struct r300_query*)query;
+ uint32_t* map;
uint32_t temp;
if (wait) {
@@ -88,8 +89,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
pipe->flush(pipe, 0, NULL);
}
- uint32_t* map = pipe_buffer_map(pipe->screen, q->buf,
- PIPE_BUFFER_USAGE_CPU_READ);
+ map = pipe_buffer_map(pipe->screen, q->buf, PIPE_BUFFER_USAGE_CPU_READ);
temp = *map;
pipe_buffer_unmap(pipe->screen, q->buf);
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index c9a20c9e8a..b1d85260cc 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -593,6 +593,7 @@ static void* r300_create_vs_state(struct pipe_context* pipe,
const struct pipe_shader_state* state)
{
struct r300_context* context = r300_context(pipe);
+ tgsi_dump(state->tokens);
/* XXX handing this off to Draw for now */
return draw_create_vertex_shader(context->draw, state);
}
diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c
index ab0ecac35a..dc4b29eb40 100644
--- a/src/gallium/drivers/r300/r300_surface.c
+++ b/src/gallium/drivers/r300/r300_surface.c
@@ -29,10 +29,10 @@ static void r300_surface_setup(struct pipe_context* pipe,
unsigned w, unsigned h)
{
struct r300_context* r300 = r300_context(pipe);
- CS_LOCALS(r300);
struct r300_capabilities* caps = r300_screen(pipe->screen)->caps;
struct r300_texture* tex = (struct r300_texture*)dest->texture;
unsigned pixpitch = tex->stride / tex->tex.block.size;
+ CS_LOCALS(r300);
r300_emit_blend_state(r300, &blend_clear_state);
r300_emit_blend_color_state(r300, &blend_color_clear_state);
@@ -80,13 +80,13 @@ static void r300_surface_fill(struct pipe_context* pipe,
unsigned w, unsigned h,
unsigned color)
{
+ int i;
+ float r, g, b, a, depth;
struct r300_context* r300 = r300_context(pipe);
- CS_LOCALS(r300);
struct r300_capabilities* caps = r300_screen(pipe->screen)->caps;
struct r300_texture* tex = (struct r300_texture*)dest->texture;
- int i;
- float r, g, b, a, depth;
unsigned pixpitch = tex->stride / tex->tex.block.size;
+ CS_LOCALS(r300);
a = (float)((color >> 24) & 0xff) / 255.0f;
r = (float)((color >> 16) & 0xff) / 255.0f;
@@ -201,12 +201,12 @@ static void r300_surface_copy(struct pipe_context* pipe,
unsigned w, unsigned h)
{
struct r300_context* r300 = r300_context(pipe);
- CS_LOCALS(r300);
struct r300_capabilities* caps = r300_screen(pipe->screen)->caps;
struct r300_texture* srctex = (struct r300_texture*)src->texture;
struct r300_texture* desttex = (struct r300_texture*)dest->texture;
-
unsigned pixpitch = srctex->stride / srctex->tex.block.size;
+ CS_LOCALS(r300);
+
debug_printf("r300: Copying surface %p at (%d,%d) to %p at (%d, %d),"
" dimensions %dx%d (pixel pitch %d)\n",
src, srcx, srcy, dest, destx, desty, w, h, pixpitch);
diff --git a/src/gallium/drivers/r300/r300_surface.h b/src/gallium/drivers/r300/r300_surface.h
index 36090882f1..894def07aa 100644
--- a/src/gallium/drivers/r300/r300_surface.h
+++ b/src/gallium/drivers/r300/r300_surface.h
@@ -105,11 +105,11 @@ static struct r300_rs_block r300_rs_block_copy_state = {
};
static struct r300_rs_block r500_rs_block_copy_state = {
- .ip[0] = R500_RS_SEL_S(R500_RS_IP_PTR_K0) |
- R500_RS_SEL_T(R500_RS_IP_PTR_K0) |
+ .ip[0] = R500_RS_SEL_S(0) |
+ R500_RS_SEL_T(1) |
R500_RS_SEL_R(R500_RS_IP_PTR_K0) |
R500_RS_SEL_Q(R500_RS_IP_PTR_K1),
- .inst[0] = R500_RS_INST_COL_CN_WRITE,
+ .inst[0] = R500_RS_INST_TEX_CN_WRITE,
.count = R300_IT_COUNT(2) | R300_IC_COUNT(0) | R300_HIRES_EN,
.inst_count = R300_RS_TX_OFFSET(6),
};