END_CS;
}
-/* Translate pipe_format into US_OUT_FMT. Note that formats are stored from
- * C3 to C0. */
-uint32_t translate_out_fmt(enum pipe_format format)
-{
- switch (format) {
- case PIPE_FORMAT_A8R8G8B8_UNORM:
- return R300_US_OUT_FMT_C4_8 |
- R300_C0_SEL_B | R300_C1_SEL_G |
- R300_C2_SEL_R | R300_C3_SEL_A;
- default:
- return R300_US_OUT_FMT_UNUSED;
- }
- return 0;
-}
-
/* XXX add pitch, stride, clean up */
void r300_emit_fb_state(struct r300_context* r300,
struct pipe_framebuffer_state* fb)
OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i),
- translate_out_fmt(fb->cbufs[i]->format));
+ r300_translate_out_fmt(fb->cbufs[i]->format));
}
if (fb->zsbuf) {
#include "r300_context.h"
#include "r300_cs.h"
#include "r300_screen.h"
+#include "r300_state_inlines.h"
void r300_emit_blend_state(struct r300_context* r300,
struct r300_blend_state* blend);
void r300_emit_rs_block_state(struct r300_context* r300,
struct r300_rs_block* rs);
+void r300_emit_sampler(struct r300_context* r300,
+ struct r300_sampler_state* sampler, unsigned offset);
+
void r300_emit_scissor_state(struct r300_context* r300,
struct r300_scissor_state* scissor);
+void r300_emit_texture(struct r300_context* r300,
+ struct r300_texture* tex, unsigned offset);
+
void r300_emit_vertex_format_state(struct r300_context* r300);
+void r300_emit_viewport_state(struct r300_context* r300,
+ struct r300_viewport_state* viewport);
+
/* Emit all dirty state. */
void r300_emit_dirty_state(struct r300_context* r300);
case PIPE_FORMAT_A32R32G32B32:
return R300_COLOR_FORMAT_ARGB32323232;
case PIPE_FORMAT_A16R16G16B16:
- return R300_COLOR_FORMAT_ARGB16161616; */
- /* XXX Not in pipe_format
+ return R300_COLOR_FORMAT_ARGB16161616;
case PIPE_FORMAT_A10R10G10B10_UNORM:
return R500_COLOR_FORMAT_ARGB10101010;
case PIPE_FORMAT_A2R10G10B10_UNORM:
case PIPE_FORMAT_I10_UNORM:
return R500_COLOR_FORMAT_I10; */
default:
- debug_printf("r300: Implementation error: " \
+ debug_printf("r300: Implementation error: "
"Got unsupported color format %s in %s\n",
pf_name(format), __FUNCTION__);
break;
case PIPE_FORMAT_Z24S8_UNORM:
return R300_DEPTHFORMAT_24BIT_INT_Z_8BIT_STENCIL;
default:
- debug_printf("r300: Implementation error: " \
+ debug_printf("r300: Implementation error: "
"Got unsupported ZS format %s in %s\n",
pf_name(format), __FUNCTION__);
break;
return 0;
}
+/* Translate pipe_format into US_OUT_FMT.
+ * Note that formats are stored from C3 to C0. */
+static INLINE uint32_t r300_translate_out_fmt(enum pipe_format format)
+{
+ switch (format) {
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ return R300_US_OUT_FMT_C4_8 |
+ R300_C0_SEL_B | R300_C1_SEL_G |
+ R300_C2_SEL_R | R300_C3_SEL_A;
+ default:
+ debug_printf("r300: Implementation error: "
+ "Got unsupported output format %s in %s\n",
+ pf_name(format), __FUNCTION__);
+ return R300_US_OUT_FMT_UNUSED;
+ }
+ return 0;
+}
+
/* Non-CSO state. (For now.) */
static INLINE uint32_t r300_translate_gb_pipes(int pipe_count)