summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Hopf <mhopf@suse.de>2009-01-27 16:55:23 +0100
committerMatthias Hopf <mhopf@suse.de>2009-01-27 16:55:23 +0100
commit596202e201d9839a6c51a11130123c8d5a53cd13 (patch)
tree33078d9882de6cee4b32241ed8ee4c268492bc3a
parentca157c24a8b46102d2ae293694e01d645b811b43 (diff)
Move create_sample_texture() to _lib.c. Don't swap components on textures.
-rw-r--r--r600_lib.c17
-rw-r--r--r600_lib.h2
-rw-r--r--r600_texture.c19
3 files changed, 20 insertions, 18 deletions
diff --git a/r600_lib.c b/r600_lib.c
index e33b8a2..4b6f8be 100644
--- a/r600_lib.c
+++ b/r600_lib.c
@@ -681,3 +681,20 @@ void write_register (adapter_t *adapt, uint32_t reg, uint32_t val)
}
+uint32_t *create_sample_texture (int width, int height, int pitch)
+{
+ int y, x;
+ uint32_t *tex = malloc (pitch * height * sizeof(uint32_t));
+ uint32_t *t = tex;
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ t[x] = ((0x00000001 * (0x100 * x / width)) |
+ (0x00000100 * (0x100 * y / height)) |
+ (0x00010000 * (((0x200 * x / width) + (0x200 * y / height)) % 0xff))|
+ (0xff000000));
+ t += pitch;
+ }
+ return tex;
+}
+
+
diff --git a/r600_lib.h b/r600_lib.h
index 88041d1..3091d0e 100644
--- a/r600_lib.h
+++ b/r600_lib.h
@@ -118,6 +118,8 @@ void show_state (adapter_t *adapt);
void dump_register (adapter_t *adapt, uint32_t reg);
void write_register (adapter_t *adapt, uint32_t reg, uint32_t val);
+uint32_t *create_sample_texture (int width, int height, int pitch);
+
/* Demos functions */
/* r600_basic.c : */
diff --git a/r600_texture.c b/r600_texture.c
index 7c5bb3f..b2a41b2 100644
--- a/r600_texture.c
+++ b/r600_texture.c
@@ -37,23 +37,6 @@
#include "r600_shader.h"
-uint32_t *create_sample_texture (int width, int height, int pitch)
-{
- int y, x;
- uint32_t *tex = malloc (pitch * height * sizeof(uint32_t));
- uint32_t *t = tex;
- for (y = 0; y < height; y++) {
- for (x = 0; x < width; x++)
- t[x] = ((0x00000001 * (0x100 * x / width)) |
- (0x00000100 * (0x100 * y / height)) |
- (0x00010000 * (((0x200 * x / width) + (0x200 * y / height)) % 0xff))|
- (0xff000000));
- t += pitch;
- }
- return tex;
-}
-
-
/*
* Simple textured triangle test, scaling, float coords, explicit texture coords
*/
@@ -345,7 +328,7 @@ void quad_test_tex_scaled(adapter_t *adapt)
cb_conf.h = adapt->color_height;
cb_conf.base = adapt->color_gpu;
cb_conf.format = FMT_8_8_8_8;
- cb_conf.comp_swap = 1;
+ cb_conf.comp_swap = 0;
cb_conf.source_format = 1;
cb_conf.blend_clamp = 1;
set_render_target(adapt, &cb_conf);