From de2af92edce11af5626cbb222721932b0e6784f8 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 16 May 2009 18:28:17 +0200 Subject: r300: add support for ARB_texture_rg and ARB_half_float_pixel extension --- src/mesa/drivers/dri/r300/r300_context.c | 2 ++ src/mesa/drivers/dri/r300/r300_texstate.c | 6 ++++++ src/mesa/drivers/dri/radeon/radeon_texture.c | 14 ++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 91fa77a169..81890a6e12 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -97,6 +97,7 @@ const struct dri_extension card_extensions[] = { {"GL_ARB_depth_texture", NULL}, {"GL_ARB_fragment_program", NULL}, {"GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions}, + {"GL_ARB_half_float_pixel", NULL}, {"GL_ARB_multitexture", NULL}, {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions}, {"GL_ARB_shadow", NULL}, @@ -108,6 +109,7 @@ const struct dri_extension card_extensions[] = { {"GL_ARB_texture_env_crossbar", NULL}, {"GL_ARB_texture_env_dot3", NULL}, {"GL_ARB_texture_mirrored_repeat", NULL}, + {"GL_ARB_texture_rg", NULL}, {"GL_ARB_vertex_program", GL_ARB_vertex_program_functions}, {"GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions}, {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions}, diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 6f489ace7b..46625cada3 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -107,6 +107,12 @@ static const struct tx_table { _ASSIGN(RGBA_FLOAT16, R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R16G16B16A16)), _ASSIGN(RGB_FLOAT32, 0xffffffff), _ASSIGN(RGB_FLOAT16, 0xffffffff), + _ASSIGN(R8, R300_EASY_TX_FORMAT(ZERO, ZERO, X, ONE, X8)), + _ASSIGN(RG88, R300_EASY_TX_FORMAT(ZERO, Y, X, ONE, Y8X8)), + _ASSIGN(RED_FLOAT16, R300_EASY_TX_FORMAT(ZERO, ZERO, X, ONE, FL_I16)), + _ASSIGN(RG_FLOAT16, R300_EASY_TX_FORMAT(ZERO, X, Y, ONE, FL_I16A16)), + _ASSIGN(RED_FLOAT32, R300_EASY_TX_FORMAT(ZERO, ZERO, X, ONE, FL_I32)), + _ASSIGN(RG_FLOAT32, R300_EASY_TX_FORMAT(ZERO, X, Y, ONE, FL_I32A32)), _ASSIGN(ALPHA_FLOAT32, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I32)), _ASSIGN(ALPHA_FLOAT16, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I16)), _ASSIGN(LUMINANCE_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I32)), diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index fa16f44c18..5965be968b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -497,6 +497,20 @@ const struct gl_texture_format *radeonChooseTextureFormat(GLcontext * ctx, case GL_COMPRESSED_SLUMINANCE_ALPHA: return &_mesa_texformat_sla8; + /* ARB_texture_rg */ + case GL_R8: + return &_mesa_texformat_r8; + case GL_RG8: + return &_mesa_texformat_rg88; + case GL_R16F: + return &_mesa_texformat_red_float16; + case GL_R32F: + return &_mesa_texformat_red_float32; + case GL_RG16F: + return &_mesa_texformat_rg_float16; + case GL_RG32F: + return &_mesa_texformat_rg_float32; + default: _mesa_problem(ctx, "unexpected internalFormat 0x%x in %s", -- cgit v1.2.3