diff options
Diffstat (limited to 'src/gallium/drivers/nv50')
-rw-r--r-- | src/gallium/drivers/nv50/SConscript | 4 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_formats.c | 178 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_program.c | 17 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_program.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_state.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_stateobj.h | 25 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_stateobj_tex.h | 34 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_tex.c | 40 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_texture.xml.h | 60 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_tgsi_to_nc.c | 7 |
10 files changed, 219 insertions, 149 deletions
diff --git a/src/gallium/drivers/nv50/SConscript b/src/gallium/drivers/nv50/SConscript index 84644515ede..3c8a7276b97 100644 --- a/src/gallium/drivers/nv50/SConscript +++ b/src/gallium/drivers/nv50/SConscript @@ -5,7 +5,6 @@ env = env.Clone() nv50 = env.ConvenienceLibrary( target = 'nv50', source = [ - 'nv50_buffer.c', 'nv50_context.c', 'nv50_draw.c', 'nv50_formats.c', @@ -27,9 +26,6 @@ nv50 = env.ConvenienceLibrary( 'nv50_pc_optimize.c', 'nv50_pc_regalloc.c', 'nv50_push.c', - 'nv50_push2.c', - 'nv50_fence.c', - 'nv50_mm.c', 'nv50_query.c' ]) diff --git a/src/gallium/drivers/nv50/nv50_formats.c b/src/gallium/drivers/nv50/nv50_formats.c index 194e826fa66..7946117cf30 100644 --- a/src/gallium/drivers/nv50/nv50_formats.c +++ b/src/gallium/drivers/nv50/nv50_formats.c @@ -70,7 +70,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET | SCANOUT }, [PIPE_FORMAT_B8G8R8X8_UNORM] = { NV50_SURFACE_FORMAT_X8R8G8B8_UNORM, - A_(C2, C1, C0, ONE, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 1), + A_(C2, C1, C0, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 1), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET | SCANOUT }, [PIPE_FORMAT_B8G8R8A8_SRGB] = { NV50_SURFACE_FORMAT_A8R8G8B8_SRGB, @@ -78,18 +78,18 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_B8G8R8X8_SRGB] = { NV50_SURFACE_FORMAT_X8R8G8B8_SRGB, - A_(C2, C1, C0, ONE, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 1), + A_(C2, C1, C0, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8_8, 1), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_B5G6R5_UNORM] = { NV50_SURFACE_FORMAT_R5G6B5_UNORM, - B_(C2, C1, C0, ONE, UNORM, UNORM, UNORM, UNORM, 5_6_5, 1), + B_(C2, C1, C0, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 5_6_5, 1), SAMPLER_VIEW | RENDER_TARGET | SCANOUT }, [PIPE_FORMAT_B5G5R5A1_UNORM] = { NV50_SURFACE_FORMAT_A1R5G5B5_UNORM, B_(C2, C1, C0, C3, UNORM, UNORM, UNORM, UNORM, 1_5_5_5, 1), SAMPLER_VIEW | RENDER_TARGET | SCANOUT }, - [PIPE_FORMAT_B4G4R4A4_UNORM] = { NV50_SURFACE_FORMAT_R16_UNORM, + [PIPE_FORMAT_B4G4R4A4_UNORM] = { 0, B_(C2, C1, C0, C3, UNORM, UNORM, UNORM, UNORM, 4_4_4_4, 1), SAMPLER_VIEW }, @@ -104,49 +104,49 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = /* DEPTH/STENCIL FORMATS */ [PIPE_FORMAT_Z16_UNORM] = { NV50_ZETA_FORMAT_Z16_UNORM, - B_(C0, C0, C0, ONE, UNORM, UINT, UINT, UINT, 16_ZETA, 0), + B_(C0, C0, C0, ONE_FLOAT, UNORM, UINT, UINT, UINT, Z16, 0), SAMPLER_VIEW | DEPTH_STENCIL }, [PIPE_FORMAT_Z24_UNORM_S8_USCALED] = { NV50_ZETA_FORMAT_S8Z24_UNORM, - B_(C0, C0, C0, ONE, UNORM, UINT, UINT, UINT, 8_24, 0), + B_(C0, C0, C0, ONE_FLOAT, UNORM, UINT, UINT, UINT, S8Z24, 0), SAMPLER_VIEW | DEPTH_STENCIL }, [PIPE_FORMAT_Z24X8_UNORM] = { NV50_ZETA_FORMAT_X8Z24_UNORM, - B_(C0, C0, C0, ONE, UNORM, UINT, UINT, UINT, 8_24, 0), + B_(C0, C0, C0, ONE_FLOAT, UNORM, UINT, UINT, UINT, X8Z24, 0), SAMPLER_VIEW | DEPTH_STENCIL }, [PIPE_FORMAT_S8_USCALED_Z24_UNORM] = { NV50_ZETA_FORMAT_Z24S8_UNORM, - B_(C1, C1, C1, ONE, UINT, UNORM, UINT, UINT, 24_8, 0), + B_(C1, C1, C1, ONE_FLOAT, UINT, UNORM, UINT, UINT, Z24S8, 0), SAMPLER_VIEW | DEPTH_STENCIL }, [PIPE_FORMAT_Z32_FLOAT] = { NV50_ZETA_FORMAT_Z32_FLOAT, - B_(C0, C0, C0, ONE, FLOAT, UINT, UINT, UINT, 32_ZETA, 0), + B_(C0, C0, C0, ONE_FLOAT, FLOAT, UINT, UINT, UINT, Z32, 0), SAMPLER_VIEW | DEPTH_STENCIL }, [PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED] = { NV50_ZETA_FORMAT_Z32_FLOAT_X24S8_UNORM, - B_(C0, C0, C0, ONE, FLOAT, UINT, UINT, UINT, 32_8, 0), + B_(C0, C0, C0, ONE_FLOAT, FLOAT, UINT, UINT, UINT, X24S8Z32, 0), SAMPLER_VIEW | DEPTH_STENCIL }, /* LUMINANCE, ALPHA, INTENSITY */ [PIPE_FORMAT_L8_UNORM] = { NV50_SURFACE_FORMAT_R8_UNORM, - A_(C0, C0, C0, ONE, UNORM, UNORM, UNORM, UNORM, 8, 0), - SAMPLER_VIEW }, + A_(C0, C0, C0, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8, 0), + SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_L8_SRGB] = { NV50_SURFACE_FORMAT_R8_UNORM, - A_(C0, C0, C0, ONE, UNORM, UNORM, UNORM, UNORM, 8, 0), - SAMPLER_VIEW }, + A_(C0, C0, C0, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8, 0), + SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_I8_UNORM] = { NV50_SURFACE_FORMAT_R8_UNORM, A_(C0, C0, C0, C0, UNORM, UNORM, UNORM, UNORM, 8, 0), - SAMPLER_VIEW }, + SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_A8_UNORM] = { NV50_SURFACE_FORMAT_A8_UNORM, A_(ZERO, ZERO, ZERO, C0, UNORM, UNORM, UNORM, UNORM, 8, 0), SAMPLER_VIEW | RENDER_TARGET }, - [PIPE_FORMAT_L8A8_UNORM] = { NV50_SURFACE_FORMAT_R16_UNORM, + [PIPE_FORMAT_L8A8_UNORM] = { 0, A_(C0, C0, C0, C1, UNORM, UNORM, UNORM, UNORM, 8_8, 0), SAMPLER_VIEW }, @@ -157,7 +157,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = /* DXT, RGTC */ [PIPE_FORMAT_DXT1_RGB] = { 0, - B_(C0, C1, C2, ONE, UNORM, UNORM, UNORM, UNORM, DXT1, 0), + B_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, DXT1, 0), SAMPLER_VIEW }, [PIPE_FORMAT_DXT1_RGBA] = { 0, @@ -173,19 +173,19 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = SAMPLER_VIEW }, [PIPE_FORMAT_RGTC1_UNORM] = { 0, - B_(C0, ZERO, ZERO, ONE, UNORM, UNORM, UNORM, UNORM, RGTC1, 0), + B_(C0, ZERO, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, RGTC1, 0), SAMPLER_VIEW }, [PIPE_FORMAT_RGTC1_SNORM] = { 0, - B_(C0, ZERO, ZERO, ONE, SNORM, SNORM, SNORM, SNORM, RGTC1, 0), + B_(C0, ZERO, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, RGTC1, 0), SAMPLER_VIEW }, [PIPE_FORMAT_RGTC2_UNORM] = { 0, - B_(C0, C1, ZERO, ONE, UNORM, UNORM, UNORM, UNORM, RGTC2, 0), + B_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, RGTC2, 0), SAMPLER_VIEW }, [PIPE_FORMAT_RGTC2_SNORM] = { 0, - B_(C0, C1, ZERO, ONE, SNORM, SNORM, SNORM, SNORM, RGTC2, 0), + B_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, RGTC2, 0), SAMPLER_VIEW }, /* FLOAT 16 */ @@ -195,15 +195,15 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R16G16B16_FLOAT] = { NV50_SURFACE_FORMAT_R16G16B16X16_FLOAT, - A_(C0, C1, C2, ONE, FLOAT, FLOAT, FLOAT, FLOAT, 16_16_16, 0), + A_(C0, C1, C2, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 16_16_16, 0), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R16G16_FLOAT] = { NV50_SURFACE_FORMAT_R16G16_FLOAT, - A_(C0, C1, ZERO, ONE, FLOAT, FLOAT, FLOAT, FLOAT, 16_16, 0), + A_(C0, C1, ZERO, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 16_16, 0), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R16_FLOAT] = { NV50_SURFACE_FORMAT_R16_FLOAT, - A_(C0, ZERO, ZERO, ONE, FLOAT, FLOAT, FLOAT, FLOAT, 16, 0), + A_(C0, ZERO, ZERO, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 16, 0), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, /* FLOAT 32 */ @@ -213,25 +213,25 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R32G32B32_FLOAT] = { NV50_SURFACE_FORMAT_R32G32B32X32_FLOAT, - A_(C0, C1, C2, ONE, FLOAT, FLOAT, FLOAT, FLOAT, 32_32_32, 0), + A_(C0, C1, C2, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 32_32_32, 0), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R32G32_FLOAT] = { NV50_SURFACE_FORMAT_R32G32_FLOAT, - A_(C0, C1, ZERO, ONE, FLOAT, FLOAT, FLOAT, FLOAT, 32_32, 0), + A_(C0, C1, ZERO, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 32_32, 0), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R32_FLOAT] = { NV50_SURFACE_FORMAT_R32_FLOAT, - A_(C0, ZERO, ZERO, ONE, FLOAT, FLOAT, FLOAT, FLOAT, 32, 0), + A_(C0, ZERO, ZERO, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 32, 0), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, /* ODD FORMATS */ [PIPE_FORMAT_R11G11B10_FLOAT] = { NV50_SURFACE_FORMAT_B10G11R11_FLOAT, - B_(C0, C1, C2, ONE, FLOAT, FLOAT, FLOAT, FLOAT, 10_11_11, 0), + B_(C0, C1, C2, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, 10_11_11, 0), SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R9G9B9E5_FLOAT] = { 0, - B_(C0, C1, C2, ONE, FLOAT, FLOAT, FLOAT, FLOAT, E5_9_9_9, 0), + B_(C0, C1, C2, ONE_FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, E5_9_9_9, 0), SAMPLER_VIEW }, /* SNORM 32 */ @@ -241,15 +241,15 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = VERTEX_BUFFER | SAMPLER_VIEW }, [PIPE_FORMAT_R32G32B32_SNORM] = { 0, - A_(C0, C1, C2, ONE, SNORM, SNORM, SNORM, SNORM, 32_32_32, 0), + A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 32_32_32, 0), VERTEX_BUFFER | SAMPLER_VIEW }, [PIPE_FORMAT_R32G32_SNORM] = { 0, - A_(C0, C1, ZERO, ONE, SNORM, SNORM, SNORM, SNORM, 32_32, 0), + A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 32_32, 0), VERTEX_BUFFER | SAMPLER_VIEW }, [PIPE_FORMAT_R32_SNORM] = { 0, - A_(C0, ZERO, ZERO, ONE, SNORM, SNORM, SNORM, SNORM, 32, 0), + A_(C0, ZERO, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 32, 0), VERTEX_BUFFER | SAMPLER_VIEW }, /* UNORM 32 */ @@ -259,15 +259,15 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = VERTEX_BUFFER | SAMPLER_VIEW }, [PIPE_FORMAT_R32G32B32_UNORM] = { 0, - A_(C0, C1, C2, ONE, UNORM, UNORM, UNORM, UNORM, 32_32_32, 0), + A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 32_32_32, 0), VERTEX_BUFFER | SAMPLER_VIEW }, [PIPE_FORMAT_R32G32_UNORM] = { 0, - A_(C0, C1, ZERO, ONE, UNORM, UNORM, UNORM, UNORM, 32_32, 0), + A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 32_32, 0), VERTEX_BUFFER | SAMPLER_VIEW }, [PIPE_FORMAT_R32_UNORM] = { 0, - A_(C0, ZERO, ZERO, ONE, UNORM, UNORM, UNORM, UNORM, 32, 0), + A_(C0, ZERO, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 32, 0), VERTEX_BUFFER | SAMPLER_VIEW }, /* SNORM 16 */ @@ -277,7 +277,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R16G16B16_SNORM] = { 0, - A_(C0, C1, C2, ONE, SNORM, SNORM, SNORM, SNORM, 16_16_16, 0), + A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 16_16_16, 0), VERTEX_BUFFER | SAMPLER_VIEW }, [PIPE_FORMAT_R16G16_SNORM] = { NV50_SURFACE_FORMAT_R16G16_SNORM, @@ -285,7 +285,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R16_SNORM] = { NV50_SURFACE_FORMAT_R16_SNORM, - A_(C0, ZERO, ZERO, ONE, SNORM, SNORM, SNORM, SNORM, 16, 0), + A_(C0, ZERO, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 16, 0), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, /* UNORM 16 */ @@ -295,7 +295,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R16G16B16_UNORM] = { 0, - A_(C0, C1, C2, ONE, UNORM, UNORM, UNORM, UNORM, 16_16_16, 0), + A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 16_16_16, 0), VERTEX_BUFFER | SAMPLER_VIEW }, [PIPE_FORMAT_R16G16_UNORM] = { NV50_SURFACE_FORMAT_R16G16_UNORM, @@ -303,7 +303,7 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R16_UNORM] = { NV50_SURFACE_FORMAT_R16_UNORM, - A_(C0, ZERO, ZERO, ONE, UNORM, UNORM, UNORM, UNORM, 16, 0), + A_(C0, ZERO, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 16, 0), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, /* SNORM 8 */ @@ -313,15 +313,15 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R8G8B8_SNORM] = { 0, - A_(C0, C1, C2, ONE, SNORM, SNORM, SNORM, SNORM, 8_8_8, 0), + A_(C0, C1, C2, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 8_8_8, 0), VERTEX_BUFFER | SAMPLER_VIEW }, [PIPE_FORMAT_R8G8_SNORM] = { NV50_SURFACE_FORMAT_R8G8_SNORM, - A_(C0, C1, ZERO, ONE, SNORM, SNORM, SNORM, SNORM, 8_8, 0), + A_(C0, C1, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 8_8, 0), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R8_SNORM] = { NV50_SURFACE_FORMAT_R8_SNORM, - A_(C0, ZERO, ZERO, ONE, SNORM, SNORM, SNORM, SNORM, 8, 0), + A_(C0, ZERO, ZERO, ONE_FLOAT, SNORM, SNORM, SNORM, SNORM, 8, 0), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, /* UNORM 8 */ @@ -335,126 +335,126 @@ const struct nv50_format nv50_format_table[PIPE_FORMAT_COUNT] = SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R8G8B8_UNORM] = { NV50_SURFACE_FORMAT_X8B8G8R8_UNORM, - A_(C0, C1, C2, ONE, UNORM, UNORM, UNORM, UNORM, 8_8_8, 0), + A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8, 0), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R8G8B8_SRGB] = { NV50_SURFACE_FORMAT_X8B8G8R8_SRGB, - A_(C0, C1, C2, ONE, UNORM, UNORM, UNORM, UNORM, 8_8_8, 0), + A_(C0, C1, C2, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8_8, 0), SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R8G8_UNORM] = { NV50_SURFACE_FORMAT_R8G8_UNORM, - A_(C0, C1, ZERO, ONE, UNORM, UNORM, UNORM, UNORM, 8_8, 0), + A_(C0, C1, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8_8, 0), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, [PIPE_FORMAT_R8_UNORM] = { NV50_SURFACE_FORMAT_R8_UNORM, - A_(C0, ZERO, ZERO, ONE, UNORM, UNORM, UNORM, UNORM, 8, 0), + A_(C0, ZERO, ZERO, ONE_FLOAT, UNORM, UNORM, UNORM, UNORM, 8, 0), VERTEX_BUFFER | SAMPLER_VIEW | RENDER_TARGET }, - /* SSCALED 32 */ + /* SSCALED 32 (not integer, data is converted to float !) */ [PIPE_FORMAT_R32G32B32A32_SSCALED] = { 0, A_(C0, C1, C2, C3, SSCALED, SSCALED, SSCALED, SSCALED, 32_32_32_32, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + VERTEX_BUFFER }, [PIPE_FORMAT_R32G32B32_SSCALED] = { 0, - A_(C0, C1, C2, ONE, SSCALED, SSCALED, SSCALED, SSCALED, 32_32_32, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, C1, C2, ONE_FLOAT, SSCALED, SSCALED, SSCALED, SSCALED, 32_32_32, 0), + VERTEX_BUFFER }, [PIPE_FORMAT_R32G32_SSCALED] = { 0, - A_(C0, C1, ZERO, ONE, SSCALED, SSCALED, SSCALED, SSCALED, 32_32, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, C1, ZERO, ONE_FLOAT, SSCALED, SSCALED, SSCALED, SSCALED, 32_32, 0), + VERTEX_BUFFER }, [PIPE_FORMAT_R32_SSCALED] = { 0, - A_(C0, ZERO, ZERO, ONE, SSCALED, SSCALED, SSCALED, SSCALED, 32, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, ZERO, ZERO, ONE_FLOAT, SSCALED, SSCALED, SSCALED, SSCALED, 32, 0), + VERTEX_BUFFER }, /* USCALED 32 */ [PIPE_FORMAT_R32G32B32A32_USCALED] = { 0, A_(C0, C1, C2, C3, USCALED, USCALED, USCALED, USCALED, 32_32_32_32, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + VERTEX_BUFFER }, [PIPE_FORMAT_R32G32B32_USCALED] = { 0, - A_(C0, C1, C2, ONE, USCALED, USCALED, USCALED, USCALED, 32_32_32, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, C1, C2, ONE_FLOAT, USCALED, USCALED, USCALED, USCALED, 32_32_32, 0), + VERTEX_BUFFER }, [PIPE_FORMAT_R32G32_USCALED] = { 0, - A_(C0, C1, ZERO, ONE, USCALED, USCALED, USCALED, USCALED, 32_32, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, C1, ZERO, ONE_FLOAT, USCALED, USCALED, USCALED, USCALED, 32_32, 0), + VERTEX_BUFFER }, [PIPE_FORMAT_R32_USCALED] = { 0, - A_(C0, ZERO, ZERO, ONE, USCALED, USCALED, USCALED, USCALED, 32, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, ZERO, ZERO, ONE_FLOAT, USCALED, USCALED, USCALED, USCALED, 32, 0), + VERTEX_BUFFER }, /* SSCALED 16 */ [PIPE_FORMAT_R16G16B16A16_SSCALED] = { 0, A_(C0, C1, C2, C3, SSCALED, SSCALED, SSCALED, SSCALED, 16_16_16_16, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + VERTEX_BUFFER }, [PIPE_FORMAT_R16G16B16_SSCALED] = { 0, - A_(C0, C1, C2, ONE, SSCALED, SSCALED, SSCALED, SSCALED, 16_16_16, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, C1, C2, ONE_FLOAT, SSCALED, SSCALED, SSCALED, SSCALED, 16_16_16, 0), + VERTEX_BUFFER }, [PIPE_FORMAT_R16G16_SSCALED] = { 0, - A_(C0, C1, ZERO, ONE, SSCALED, SSCALED, SSCALED, SSCALED, 16_16, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, C1, ZERO, ONE_FLOAT, SSCALED, SSCALED, SSCALED, SSCALED, 16_16, 0), + VERTEX_BUFFER }, [PIPE_FORMAT_R16_SSCALED] = { 0, - A_(C0, ZERO, ZERO, ONE, SSCALED, SSCALED, SSCALED, SSCALED, 16, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, ZERO, ZERO, ONE_FLOAT, SSCALED, SSCALED, SSCALED, SSCALED, 16, 0), + VERTEX_BUFFER }, /* USCALED 16 */ [PIPE_FORMAT_R16G16B16A16_USCALED] = { 0, A_(C0, C1, C2, C3, USCALED, USCALED, USCALED, USCALED, 16_16_16_16, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + VERTEX_BUFFER }, [PIPE_FORMAT_R16G16B16_USCALED] = { 0, - A_(C0, C1, C2, ONE, USCALED, USCALED, USCALED, USCALED, 16_16_16, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, C1, C2, ONE_FLOAT, USCALED, USCALED, USCALED, USCALED, 16_16_16, 0), + VERTEX_BUFFER }, [PIPE_FORMAT_R16G16_USCALED] = { 0, - A_(C0, C1, ZERO, ONE, USCALED, USCALED, USCALED, USCALED, 16_16, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, C1, ZERO, ONE_FLOAT, USCALED, USCALED, USCALED, USCALED, 16_16, 0), + VERTEX_BUFFER }, [PIPE_FORMAT_R16_USCALED] = { 0, - A_(C0, ZERO, ZERO, ONE, USCALED, USCALED, USCALED, USCALED, 16, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, ZERO, ZERO, ONE_FLOAT, USCALED, USCALED, USCALED, USCALED, 16, 0), + VERTEX_BUFFER }, /* SSCALED 8 */ [PIPE_FORMAT_R8G8B8A8_SSCALED] = { 0, A_(C0, C1, C2, C3, SSCALED, SSCALED, SSCALED, SSCALED, 8_8_8_8, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + VERTEX_BUFFER }, [PIPE_FORMAT_R8G8B8_SSCALED] = { 0, - A_(C0, C1, C2, ONE, SSCALED, SSCALED, SSCALED, SSCALED, 8_8_8, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, C1, C2, ONE_FLOAT, SSCALED, SSCALED, SSCALED, SSCALED, 8_8_8, 0), + VERTEX_BUFFER }, [PIPE_FORMAT_R8G8_SSCALED] = { 0, - A_(C0, C1, ZERO, ONE, SSCALED, SSCALED, SSCALED, SSCALED, 8_8, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, C1, ZERO, ONE_FLOAT, SSCALED, SSCALED, SSCALED, SSCALED, 8_8, 0), + VERTEX_BUFFER }, [PIPE_FORMAT_R8_SSCALED] = { 0, - A_(C0, ZERO, ZERO, ONE, SSCALED, SSCALED, SSCALED, SSCALED, 8, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, ZERO, ZERO, ONE_FLOAT, SSCALED, SSCALED, SSCALED, SSCALED, 8, 0), + VERTEX_BUFFER }, /* USCALED 8 */ [PIPE_FORMAT_R8G8B8A8_USCALED] = { 0, A_(C0, C1, C2, C3, USCALED, USCALED, USCALED, USCALED, 8_8_8_8, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + VERTEX_BUFFER }, [PIPE_FORMAT_R8G8B8_USCALED] = { 0, - A_(C0, C1, C2, ONE, USCALED, USCALED, USCALED, USCALED, 8_8_8, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, C1, C2, ONE_FLOAT, USCALED, USCALED, USCALED, USCALED, 8_8_8, 0), + VERTEX_BUFFER }, [PIPE_FORMAT_R8G8_USCALED] = { 0, - A_(C0, C1, ZERO, ONE, USCALED, USCALED, USCALED, USCALED, 8_8, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, C1, ZERO, ONE_FLOAT, USCALED, USCALED, USCALED, USCALED, 8_8, 0), + VERTEX_BUFFER }, [PIPE_FORMAT_R8_USCALED] = { 0, - A_(C0, ZERO, ZERO, ONE, USCALED, USCALED, USCALED, USCALED, 8, 0), - VERTEX_BUFFER | SAMPLER_VIEW }, + A_(C0, ZERO, ZERO, ONE_FLOAT, USCALED, USCALED, USCALED, USCALED, 8, 0), + VERTEX_BUFFER }, }; diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index 1c1a4201b60..a63f9d8a6d5 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -328,10 +328,15 @@ prog_decl(struct nv50_translation_info *ti, } break; case TGSI_FILE_SYSTEM_VALUE: + /* For VP/GP inputs, they are put in s[] after the last normal input. + * Let sysval_map reflect the order of the sysvals in s[] and fixup later. + */ switch (decl->Semantic.Name) { case TGSI_SEMANTIC_FACE: break; case TGSI_SEMANTIC_INSTANCEID: + ti->p->vp.attrs[2] |= NV50_3D_VP_GP_BUILTIN_ATTR_EN_INSTANCE_ID; + ti->sysval_map[first] = 2; break; case TGSI_SEMANTIC_PRIMID: break; @@ -392,6 +397,18 @@ nv50_vertprog_prepare(struct nv50_translation_info *ti) } } + for (i = 0; i < TGSI_SEMANTIC_COUNT; ++i) { + switch (ti->sysval_map[i]) { + case 2: + if (!(ti->p->vp.attrs[2] & NV50_3D_VP_GP_BUILTIN_ATTR_EN_VERTEX_ID)) + ti->sysval_map[i] = 1; + ti->sysval_map[i] = (ti->sysval_map[i] - 1) + num_inputs; + break; + default: + break; + } + } + if (p->vp.psiz < 0x40) p->vp.psiz = p->out[p->vp.psiz].hw; diff --git a/src/gallium/drivers/nv50/nv50_program.h b/src/gallium/drivers/nv50/nv50_program.h index 8f5b51757d8..993e1691ab7 100644 --- a/src/gallium/drivers/nv50/nv50_program.h +++ b/src/gallium/drivers/nv50/nv50_program.h @@ -111,6 +111,7 @@ struct nv50_translation_info { ubyte output_file; ubyte input_map[PIPE_MAX_SHADER_INPUTS][4]; ubyte output_map[PIPE_MAX_SHADER_OUTPUTS][4]; + ubyte sysval_map[TGSI_SEMANTIC_COUNT]; ubyte interp_mode[PIPE_MAX_SHADER_INPUTS]; int input_access[PIPE_MAX_SHADER_INPUTS][4]; int output_access[PIPE_MAX_SHADER_OUTPUTS][4]; diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index 3d6423b2238..980bc369293 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -380,7 +380,7 @@ nv50_tsc_wrap_mode(unsigned wrap) } } -static void * +void * nv50_sampler_state_create(struct pipe_context *pipe, const struct pipe_sampler_state *cso) { diff --git a/src/gallium/drivers/nv50/nv50_stateobj.h b/src/gallium/drivers/nv50/nv50_stateobj.h index f4e458b0c05..cf5b92ef1a8 100644 --- a/src/gallium/drivers/nv50/nv50_stateobj.h +++ b/src/gallium/drivers/nv50/nv50_stateobj.h @@ -16,35 +16,14 @@ #define SB_DATA(so, u) (so)->state[(so)->size++] = (u) +#include "nv50_stateobj_tex.h" + struct nv50_blend_stateobj { struct pipe_blend_state pipe; int size; uint32_t state[78]; }; -struct nv50_tsc_entry { - int id; - uint32_t tsc[8]; -}; - -static INLINE struct nv50_tsc_entry * -nv50_tsc_entry(void *hwcso) -{ - return (struct nv50_tsc_entry *)hwcso; -} - -struct nv50_tic_entry { - struct pipe_sampler_view pipe; - int id; - uint32_t tic[8]; -}; - -static INLINE struct nv50_tic_entry * -nv50_tic_entry(struct pipe_sampler_view *view) -{ - return (struct nv50_tic_entry *)view; -} - struct nv50_rasterizer_stateobj { struct pipe_rasterizer_state pipe; int size; diff --git a/src/gallium/drivers/nv50/nv50_stateobj_tex.h b/src/gallium/drivers/nv50/nv50_stateobj_tex.h new file mode 100644 index 00000000000..99548cbdb42 --- /dev/null +++ b/src/gallium/drivers/nv50/nv50_stateobj_tex.h @@ -0,0 +1,34 @@ + +#ifndef __NV50_STATEOBJ_TEX_H__ +#define __NV50_STATEOBJ_TEX_H__ + +#include "pipe/p_state.h" + +struct nv50_tsc_entry { + int id; + uint32_t tsc[8]; +}; + +static INLINE struct nv50_tsc_entry * +nv50_tsc_entry(void *hwcso) +{ + return (struct nv50_tsc_entry *)hwcso; +} + +struct nv50_tic_entry { + struct pipe_sampler_view pipe; + int id; + uint32_t tic[8]; +}; + +static INLINE struct nv50_tic_entry * +nv50_tic_entry(struct pipe_sampler_view *view) +{ + return (struct nv50_tic_entry *)view; +} + +extern void * +nv50_sampler_state_create(struct pipe_context *, + const struct pipe_sampler_state *); + +#endif /* __NV50_STATEOBJ_TEX_H__ */ diff --git a/src/gallium/drivers/nv50/nv50_tex.c b/src/gallium/drivers/nv50/nv50_tex.c index 4456553a868..9192d2e2590 100644 --- a/src/gallium/drivers/nv50/nv50_tex.c +++ b/src/gallium/drivers/nv50/nv50_tex.c @@ -27,8 +27,12 @@ #include "util/u_format.h" +#define NV50_TIC_0_SWIZZLE__MASK \ + (NV50_TIC_0_MAPA__MASK | NV50_TIC_0_MAPB__MASK | \ + NV50_TIC_0_MAPG__MASK | NV50_TIC_0_MAPR__MASK) + static INLINE uint32_t -nv50_tic_swizzle(uint32_t tc, unsigned swz) +nv50_tic_swizzle(uint32_t tc, unsigned swz, boolean tex_int) { switch (swz) { case PIPE_SWIZZLE_RED: @@ -40,7 +44,7 @@ nv50_tic_swizzle(uint32_t tc, unsigned swz) case PIPE_SWIZZLE_ALPHA: return (tc & NV50_TIC_0_MAPA__MASK) >> NV50_TIC_0_MAPA__SHIFT; case PIPE_SWIZZLE_ONE: - return NV50_TIC_MAP_ONE; + return tex_int ? NV50_TIC_MAP_ONE_INT : NV50_TIC_MAP_ONE_FLOAT; case PIPE_SWIZZLE_ZERO: default: return NV50_TIC_MAP_ZERO; @@ -58,6 +62,7 @@ nv50_create_sampler_view(struct pipe_context *pipe, uint32_t depth; struct nv50_tic_entry *view; struct nv50_miptree *mt = nv50_miptree(texture); + boolean tex_int; view = MALLOC_STRUCT(nv50_tic_entry); if (!view) @@ -74,26 +79,28 @@ nv50_create_sampler_view(struct pipe_context *pipe, tic = &view->tic[0]; - desc = util_format_description(mt->base.base.format); + desc = util_format_description(view->pipe.format); /* TIC[0] */ tic[0] = nv50_format_table[view->pipe.format].tic; - swz[0] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_r); - swz[1] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_g); - swz[2] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_b); - swz[3] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_a); + tex_int = FALSE; /* XXX: integer textures */ + + swz[0] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_r, tex_int); + swz[1] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_g, tex_int); + swz[2] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_b, tex_int); + swz[3] = nv50_tic_swizzle(tic[0], view->pipe.swizzle_a, tex_int); tic[0] = (tic[0] & ~NV50_TIC_0_SWIZZLE__MASK) | (swz[0] << NV50_TIC_0_MAPR__SHIFT) | (swz[1] << NV50_TIC_0_MAPG__SHIFT) | (swz[2] << NV50_TIC_0_MAPB__SHIFT) | (swz[3] << NV50_TIC_0_MAPA__SHIFT); - /* tic[1] = mt->base.bo->offset; */ + tic[1] = /* mt->base.bo->offset; */ 0; tic[2] = /* mt->base.bo->offset >> 32 */ 0; - tic[2] |= 0x10001000 | /* NV50_TIC_2_NO_BORDER */ 0x40000000; + tic[2] |= 0x10001000 | NV50_TIC_2_NO_BORDER; if (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB) tic[2] |= NV50_TIC_2_COLORSPACE_SRGB; @@ -107,6 +114,12 @@ nv50_create_sampler_view(struct pipe_context *pipe, depth = MAX2(mt->base.base.array_size, mt->base.base.depth0); + if (mt->base.base.target == PIPE_TEXTURE_1D_ARRAY || + mt->base.base.target == PIPE_TEXTURE_2D_ARRAY) { + tic[1] = view->pipe.u.tex.first_layer * mt->layer_stride; + depth = view->pipe.u.tex.last_layer - view->pipe.u.tex.first_layer + 1; + } + switch (mt->base.base.target) { case PIPE_TEXTURE_1D: tic[2] |= NV50_TIC_2_TARGET_1D; @@ -134,7 +147,8 @@ nv50_create_sampler_view(struct pipe_context *pipe, tic[2] |= NV50_TIC_2_TARGET_2D_ARRAY; break; case PIPE_BUFFER: - tic[2] |= NV50_TIC_2_TARGET_BUFFER | /* NV50_TIC_2_LINEAR */ (1 << 18); + tic[2] |= NV50_TIC_2_TARGET_BUFFER | NV50_TIC_2_LINEAR; + break; default: NOUVEAU_ERR("invalid texture target: %d\n", mt->base.base.target); return FALSE; @@ -178,6 +192,8 @@ nv50_validate_tic(struct nv50_context *nv50, int s) res = &nv50_miptree(tic->pipe.texture)->base; if (tic->id < 0) { + uint32_t offset = tic->tic[1]; + tic->id = nv50_screen_tic_alloc(nv50->screen, tic); MARK_RING (chan, 24 + 8, 4); @@ -206,8 +222,8 @@ nv50_validate_tic(struct nv50_context *nv50, int s) OUT_RING (chan, 0); BEGIN_RING_NI(chan, RING_2D(SIFC_DATA), 8); OUT_RING (chan, tic->tic[0]); - OUT_RELOCl(chan, res->bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); - OUT_RELOC (chan, res->bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD | + OUT_RELOCl(chan, res->bo, offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); + OUT_RELOC (chan, res->bo, offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD | NOUVEAU_BO_HIGH | NOUVEAU_BO_OR, tic->tic[2], tic->tic[2]); OUT_RINGp (chan, &tic->tic[3], 5); diff --git a/src/gallium/drivers/nv50/nv50_texture.xml.h b/src/gallium/drivers/nv50/nv50_texture.xml.h index 9f83206516f..e0cbbdf0d7b 100644 --- a/src/gallium/drivers/nv50/nv50_texture.xml.h +++ b/src/gallium/drivers/nv50/nv50_texture.xml.h @@ -8,10 +8,10 @@ http://0x04.net/cgit/index.cgi/rules-ng-ng git clone git://0x04.net/rules-ng-ng The rules-ng-ng source files this header was generated from are: -- nv50_texture.xml ( 6871 bytes, from 2010-10-03 13:18:37) -- copyright.xml ( 6498 bytes, from 2010-10-03 13:18:37) +- nv50_texture.xml ( 8377 bytes, from 2011-02-12 12:05:21) +- copyright.xml ( 6452 bytes, from 2010-11-25 23:28:20) -Copyright (C) 2006-2010 by the following authors: +Copyright (C) 2006-2011 by the following authors: - Artur Huillet <[email protected]> (ahuillet) - Ben Skeggs (darktama, darktama_) - B. R. <[email protected]> (koala_br) @@ -22,7 +22,7 @@ Copyright (C) 2006-2010 by the following authors: - Dmitry Eremin-Solenikov <[email protected]> (lumag) - EdB <[email protected]> (edb_) - Erik Waling <[email protected]> (erikwaling) -- Francisco Jerez <[email protected]> (curro, curro_, currojerez) +- Francisco Jerez <[email protected]> (curro) - imirkin <[email protected]> (imirkin) - jb17bsome <[email protected]> (jb17bsome) - Jeremy Kolb <[email protected]> (kjeremy) @@ -75,7 +75,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV50_TIC_MAP_C1 0x00000003 #define NV50_TIC_MAP_C2 0x00000004 #define NV50_TIC_MAP_C3 0x00000005 -#define NV50_TIC_MAP_ONE 0x00000007 +#define NV50_TIC_MAP_ONE_INT 0x00000006 +#define NV50_TIC_MAP_ONE_FLOAT 0x00000007 #define NV50_TIC_TYPE_SNORM 0x00000001 #define NV50_TIC_TYPE_UNORM 0x00000002 #define NV50_TIC_TYPE_SINT 0x00000003 @@ -109,7 +110,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV50_TIC_0_TYPE1__SHIFT 9 #define NV50_TIC_0_TYPE0__MASK 0x000001c0 #define NV50_TIC_0_TYPE0__SHIFT 6 -#define NV50_TIC_0_SWIZZLE__MASK 0x3ffc0000 #define NV50_TIC_0_FMT__MASK 0x0000003f #define NV50_TIC_0_FMT__SHIFT 0 #define NV50_TIC_0_FMT_32_32_32_32 0x00000001 @@ -122,16 +122,19 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV50_TIC_0_FMT_8_24 0x0000000d #define NV50_TIC_0_FMT_24_8 0x0000000e #define NV50_TIC_0_FMT_32 0x0000000f +#define NV50_TIC_0_FMT_BPTC_FLOAT 0x00000010 +#define NV50_TIC_0_FMT_BPTC_UFLOAT 0x00000011 #define NV50_TIC_0_FMT_4_4_4_4 0x00000012 #define NV50_TIC_0_FMT_5_5_5_1 0x00000013 #define NV50_TIC_0_FMT_1_5_5_5 0x00000014 #define NV50_TIC_0_FMT_5_6_5 0x00000015 #define NV50_TIC_0_FMT_6_5_5 0x00000016 +#define NV50_TIC_0_FMT_BPTC 0x00000017 #define NV50_TIC_0_FMT_8_8 0x00000018 #define NV50_TIC_0_FMT_16 0x0000001b #define NV50_TIC_0_FMT_8 0x0000001d #define NV50_TIC_0_FMT_4_4 0x0000001e -#define NV50_TIC_0_FMT_UNK1F 0x0000001f +#define NV50_TIC_0_FMT_BITMAP_8X8 0x0000001f #define NV50_TIC_0_FMT_E5_9_9_9 0x00000020 #define NV50_TIC_0_FMT_10_11_11 0x00000021 #define NV50_TIC_0_FMT_C1_C2_C1_C0 0x00000022 @@ -141,14 +144,24 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV50_TIC_0_FMT_DXT5 0x00000026 #define NV50_TIC_0_FMT_RGTC1 0x00000027 #define NV50_TIC_0_FMT_RGTC2 0x00000028 -#define NV50_TIC_0_FMT_24_8_ZETA 0x00000029 -#define NV50_TIC_0_FMT_8_24_ZETA 0x0000002a -#define NV50_TIC_0_FMT_UNK2C_ZETA 0x0000002c -#define NV50_TIC_0_FMT_UNK2D_ZETA 0x0000002d -#define NV50_TIC_0_FMT_UNK2E_ZETA 0x0000002e -#define NV50_TIC_0_FMT_32_ZETA 0x0000002f -#define NV50_TIC_0_FMT_32_8_ZETA 0x00000030 -#define NV50_TIC_0_FMT_16_ZETA 0x0000003a +#define NV50_TIC_0_FMT_Z24S8 0x00000029 +#define NV50_TIC_0_FMT_S8Z24 0x0000002a +#define NV50_TIC_0_FMT_X8Z24 0x0000002b +#define NV50_TIC_0_FMT_C8Z24_MS4_CS4 0x0000002c +#define NV50_TIC_0_FMT_C8Z24_MS8_CS8 0x0000002d +#define NV50_TIC_0_FMT_C8Z24_MS4_CS12 0x0000002e +#define NV50_TIC_0_FMT_Z32 0x0000002f +#define NV50_TIC_0_FMT_X24S8Z32 0x00000030 +#define NV50_TIC_0_FMT_X16C8S8X8Z24_MS4_CS4 0x00000031 +#define NV50_TIC_0_FMT_X16C8S8X8Z24_MS8_CS8 0x00000032 +#define NV50_TIC_0_FMT_X16C8X8Z32_MS4_CS4 0x00000033 +#define NV50_TIC_0_FMT_X16C8X8Z32_MS8_CS8 0x00000034 +#define NV50_TIC_0_FMT_X16C8S8Z32_MS4_CS4 0x00000035 +#define NV50_TIC_0_FMT_X16C8S8Z32_MS8_CS8 0x00000036 +#define NV50_TIC_0_FMT_X16C8S8X8Z24_MS4_CS12 0x00000037 +#define NV50_TIC_0_FMT_X16C8X8Z32_MS4_CS12 0x00000038 +#define NV50_TIC_0_FMT_X16C8S8Z32_MS4_CS12 0x00000039 +#define NV50_TIC_0_FMT_Z16 0x0000003a #define NV50_TIC_1 0x00000004 #define NV50_TIC_1_OFFSET_LOW__MASK 0xffffffff @@ -169,13 +182,16 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV50_TIC_2_TARGET_BUFFER 0x00018000 #define NV50_TIC_2_TARGET_RECT 0x0001c000 #define NV50_TIC_2_TARGET_CUBE_ARRAY 0x00020000 -#define NV50_TIC_2_TILE_MODE_LINEAR 0x00040000 +#define NV50_TIC_2_LINEAR 0x00040000 +#define NV50_TIC_2_TILE_MODE_X__MASK 0x00380000 +#define NV50_TIC_2_TILE_MODE_X__SHIFT 19 #define NV50_TIC_2_TILE_MODE_Y__MASK 0x01c00000 #define NV50_TIC_2_TILE_MODE_Y__SHIFT 22 #define NV50_TIC_2_TILE_MODE_Z__MASK 0x0e000000 #define NV50_TIC_2_TILE_MODE_Z__SHIFT 25 #define NV50_TIC_2_2D_UNK0258__MASK 0x30000000 #define NV50_TIC_2_2D_UNK0258__SHIFT 28 +#define NV50_TIC_2_NO_BORDER 0x40000000 #define NV50_TIC_2_NORMALIZED_COORDS 0x80000000 #define NV50_TIC_3 0x0000000c @@ -211,6 +227,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV50_TSC_0_SHADOW_COMPARE_ENABLE 0x00000200 #define NV50_TSC_0_SHADOW_COMPARE_FUNC__MASK 0x00001c00 #define NV50_TSC_0_SHADOW_COMPARE_FUNC__SHIFT 10 +#define NV50_TSC_0_BOX_S__MASK 0x0001c000 +#define NV50_TSC_0_BOX_S__SHIFT 14 +#define NV50_TSC_0_BOX_T__MASK 0x000e0000 +#define NV50_TSC_0_BOX_T__SHIFT 17 #define NV50_TSC_0_ANISOTROPY_MASK__MASK 0x00700000 #define NV50_TSC_0_ANISOTROPY_MASK__SHIFT 20 @@ -234,10 +254,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define NV50_TSC_1_LOD_BIAS__SHIFT 12 #define NV50_TSC_2 0x00000008 -#define NV50_TSC_2_MIN_LOD__MASK 0x00000f00 -#define NV50_TSC_2_MIN_LOD__SHIFT 8 -#define NV50_TSC_2_MAX_LOD__MASK 0x00f00000 -#define NV50_TSC_2_MAX_LOD__SHIFT 20 +#define NV50_TSC_2_MIN_LOD__MASK 0x00000fff +#define NV50_TSC_2_MIN_LOD__SHIFT 0 +#define NV50_TSC_2_MAX_LOD__MASK 0x00fff000 +#define NV50_TSC_2_MAX_LOD__SHIFT 12 #define NV50_TSC_4 0x00000010 #define NV50_TSC_4_BORDER_COLOR_RED__MASK 0xffffffff diff --git a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c index 54b78e850ed..1449cb04c69 100644 --- a/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c +++ b/src/gallium/drivers/nv50/nv50_tgsi_to_nc.c @@ -1159,6 +1159,13 @@ emit_fetch(struct bld_context *bld, const struct tgsi_full_instruction *insn, case TGSI_FILE_PREDICATE: res = bld_fetch_global(bld, &bld->pvs[idx][swz]); break; + case TGSI_FILE_SYSTEM_VALUE: + res = new_value(bld->pc, bld->ti->input_file, NV_TYPE_U32); + res->reg.id = bld->ti->sysval_map[idx]; + res = bld_insn_1(bld, NV_OP_LDA, res); + res = bld_insn_1(bld, NV_OP_CVT, res); + res->reg.type = NV_TYPE_F32; + break; default: NOUVEAU_ERR("illegal/unhandled src reg file: %d\n", src->Register.File); abort(); |