r300g: Update comments, function names in r300_state_inlines.
This commit is contained in:
parent
034db65f08
commit
0a8cd4862c
|
@ -250,7 +250,7 @@ static void r300_vertex_psc(struct r300_context* r300,
|
||||||
assert(tab[i] != -1);
|
assert(tab[i] != -1);
|
||||||
|
|
||||||
/* Add the attribute to the PSC table. */
|
/* Add the attribute to the PSC table. */
|
||||||
temp = translate_vertex_data_type(vinfo->attrib[i].emit) |
|
temp = translate_draw_vertex_data_type(vinfo->attrib[i].emit) |
|
||||||
tab[i] << R300_DST_VEC_LOC_SHIFT;
|
tab[i] << R300_DST_VEC_LOC_SHIFT;
|
||||||
|
|
||||||
if (i & 1) {
|
if (i & 1) {
|
||||||
|
|
|
@ -53,6 +53,7 @@ static INLINE uint32_t r300_translate_blend_function(int blend_func)
|
||||||
return R300_COMB_FCN_MAX;
|
return R300_COMB_FCN_MAX;
|
||||||
default:
|
default:
|
||||||
debug_printf("r300: Unknown blend function %d\n", blend_func);
|
debug_printf("r300: Unknown blend function %d\n", blend_func);
|
||||||
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -100,6 +101,7 @@ static INLINE uint32_t r300_translate_blend_factor(int blend_fact)
|
||||||
case PIPE_BLENDFACTOR_INV_SRC1_ALPHA: */
|
case PIPE_BLENDFACTOR_INV_SRC1_ALPHA: */
|
||||||
default:
|
default:
|
||||||
debug_printf("r300: Unknown blend factor %d\n", blend_fact);
|
debug_printf("r300: Unknown blend factor %d\n", blend_fact);
|
||||||
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -129,6 +131,7 @@ static INLINE uint32_t r300_translate_depth_stencil_function(int zs_func)
|
||||||
default:
|
default:
|
||||||
debug_printf("r300: Unknown depth/stencil function %d\n",
|
debug_printf("r300: Unknown depth/stencil function %d\n",
|
||||||
zs_func);
|
zs_func);
|
||||||
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -155,6 +158,7 @@ static INLINE uint32_t r300_translate_stencil_op(int s_op)
|
||||||
return R300_ZS_INVERT;
|
return R300_ZS_INVERT;
|
||||||
default:
|
default:
|
||||||
debug_printf("r300: Unknown stencil op %d", s_op);
|
debug_printf("r300: Unknown stencil op %d", s_op);
|
||||||
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -181,6 +185,7 @@ static INLINE uint32_t r300_translate_alpha_function(int alpha_func)
|
||||||
return R300_FG_ALPHA_FUNC_ALWAYS;
|
return R300_FG_ALPHA_FUNC_ALWAYS;
|
||||||
default:
|
default:
|
||||||
debug_printf("r300: Unknown alpha function %d", alpha_func);
|
debug_printf("r300: Unknown alpha function %d", alpha_func);
|
||||||
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -209,6 +214,7 @@ static INLINE uint32_t r300_translate_wrap(int wrap)
|
||||||
return R300_TX_CLAMP_TO_EDGE | R300_TX_MIRRORED;
|
return R300_TX_CLAMP_TO_EDGE | R300_TX_MIRRORED;
|
||||||
default:
|
default:
|
||||||
debug_printf("r300: Unknown texture wrap %d", wrap);
|
debug_printf("r300: Unknown texture wrap %d", wrap);
|
||||||
|
assert(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,6 +234,7 @@ static INLINE uint32_t r300_translate_tex_filters(int min, int mag, int mip)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
debug_printf("r300: Unknown texture filter %d\n", min);
|
debug_printf("r300: Unknown texture filter %d\n", min);
|
||||||
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (mag) {
|
switch (mag) {
|
||||||
|
@ -242,6 +249,7 @@ static INLINE uint32_t r300_translate_tex_filters(int min, int mag, int mip)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
debug_printf("r300: Unknown texture filter %d\n", mag);
|
debug_printf("r300: Unknown texture filter %d\n", mag);
|
||||||
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (mip) {
|
switch (mip) {
|
||||||
|
@ -256,6 +264,7 @@ static INLINE uint32_t r300_translate_tex_filters(int min, int mag, int mip)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
debug_printf("r300: Unknown texture filter %d\n", mip);
|
debug_printf("r300: Unknown texture filter %d\n", mip);
|
||||||
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,6 +288,8 @@ static INLINE uint32_t r300_anisotropy(float max_aniso)
|
||||||
|
|
||||||
/* Buffer formats. */
|
/* Buffer formats. */
|
||||||
|
|
||||||
|
/* Colorbuffer formats. This is the unswizzled format of the RB3D block's
|
||||||
|
* output. For the swizzling of the targets, check the shader's format. */
|
||||||
static INLINE uint32_t r300_translate_colorformat(enum pipe_format format)
|
static INLINE uint32_t r300_translate_colorformat(enum pipe_format format)
|
||||||
{
|
{
|
||||||
switch (format) {
|
switch (format) {
|
||||||
|
@ -313,11 +324,13 @@ static INLINE uint32_t r300_translate_colorformat(enum pipe_format format)
|
||||||
debug_printf("r300: Implementation error: "
|
debug_printf("r300: Implementation error: "
|
||||||
"Got unsupported color format %s in %s\n",
|
"Got unsupported color format %s in %s\n",
|
||||||
pf_name(format), __FUNCTION__);
|
pf_name(format), __FUNCTION__);
|
||||||
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Depthbuffer and stencilbuffer. Thankfully, we only support two kinds. */
|
||||||
static INLINE uint32_t r300_translate_zsformat(enum pipe_format format)
|
static INLINE uint32_t r300_translate_zsformat(enum pipe_format format)
|
||||||
{
|
{
|
||||||
switch (format) {
|
switch (format) {
|
||||||
|
@ -331,18 +344,22 @@ static INLINE uint32_t r300_translate_zsformat(enum pipe_format format)
|
||||||
debug_printf("r300: Implementation error: "
|
debug_printf("r300: Implementation error: "
|
||||||
"Got unsupported ZS format %s in %s\n",
|
"Got unsupported ZS format %s in %s\n",
|
||||||
pf_name(format), __FUNCTION__);
|
pf_name(format), __FUNCTION__);
|
||||||
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Translate pipe_format into US_OUT_FMT.
|
/* Shader output formats. This is essentially the swizzle from the shader
|
||||||
|
* to the RB3D block.
|
||||||
|
*
|
||||||
* Note that formats are stored from C3 to C0. */
|
* Note that formats are stored from C3 to C0. */
|
||||||
static INLINE uint32_t r300_translate_out_fmt(enum pipe_format format)
|
static INLINE uint32_t r300_translate_out_fmt(enum pipe_format format)
|
||||||
{
|
{
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case PIPE_FORMAT_A8R8G8B8_UNORM:
|
case PIPE_FORMAT_A8R8G8B8_UNORM:
|
||||||
case PIPE_FORMAT_X8R8G8B8_UNORM:
|
case PIPE_FORMAT_X8R8G8B8_UNORM:
|
||||||
|
/* XXX */
|
||||||
case PIPE_FORMAT_Z24S8_UNORM:
|
case PIPE_FORMAT_Z24S8_UNORM:
|
||||||
return R300_US_OUT_FMT_C4_8 |
|
return R300_US_OUT_FMT_C4_8 |
|
||||||
R300_C0_SEL_B | R300_C1_SEL_G |
|
R300_C0_SEL_B | R300_C1_SEL_G |
|
||||||
|
@ -356,6 +373,7 @@ static INLINE uint32_t r300_translate_out_fmt(enum pipe_format format)
|
||||||
debug_printf("r300: Implementation error: "
|
debug_printf("r300: Implementation error: "
|
||||||
"Got unsupported output format %s in %s\n",
|
"Got unsupported output format %s in %s\n",
|
||||||
pf_name(format), __FUNCTION__);
|
pf_name(format), __FUNCTION__);
|
||||||
|
assert(0);
|
||||||
return R300_US_OUT_FMT_UNUSED;
|
return R300_US_OUT_FMT_UNUSED;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -382,7 +400,8 @@ static INLINE uint32_t r300_translate_gb_pipes(int pipe_count)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE uint32_t translate_vertex_data_type(int type) {
|
/* Translate Draw vertex types into PSC vertex types. */
|
||||||
|
static INLINE uint32_t translate_draw_vertex_data_type(int type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case EMIT_1F:
|
case EMIT_1F:
|
||||||
case EMIT_1F_PSIZE:
|
case EMIT_1F_PSIZE:
|
||||||
|
@ -406,7 +425,6 @@ static INLINE uint32_t translate_vertex_data_type(int type) {
|
||||||
assert(0);
|
assert(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue