Ilia Mirkin
2014-Jun-18 03:55 UTC
[Nouveau] [PATCH 1/2] nv30: tidy screen caps, add missing ones
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> --- src/gallium/drivers/nouveau/nv30/nv30_screen.c | 33 +++++++++++++------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c b/src/gallium/drivers/nouveau/nv30/nv30_screen.c index 4baabaf..5c3d783 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c @@ -62,6 +62,12 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) return 13; case PIPE_CAP_GLSL_FEATURE_LEVEL: return 120; + case PIPE_CAP_ENDIANNESS: + return PIPE_ENDIAN_LITTLE; + case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT: + return 16; + case PIPE_CAP_MAX_VIEWPORTS: + return 1; /* supported capabilities */ case PIPE_CAP_TWO_SIDED_STENCIL: case PIPE_CAP_ANISOTROPIC_FILTER: @@ -80,12 +86,10 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_USER_CONSTANT_BUFFERS: case PIPE_CAP_USER_INDEX_BUFFERS: case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT: - return 1; - case PIPE_CAP_USER_VERTEX_BUFFERS: - return 0; - case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT: - return 16; - case PIPE_CAP_MAX_VIEWPORTS: + case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY: + case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY: + case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY: + case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER: return 1; /* nv4x capabilities */ case PIPE_CAP_BLEND_EQUATION_SEPARATE: @@ -119,6 +123,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE: case PIPE_CAP_CUBE_MAP_ARRAY: case PIPE_CAP_VERTEX_COLOR_UNCLAMPED: + case PIPE_CAP_FRAGMENT_COLOR_CLAMPED: + case PIPE_CAP_VERTEX_COLOR_CLAMPED: case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION: case PIPE_CAP_MIXED_COLORBUFFER_FORMATS: case PIPE_CAP_START_INSTANCE: @@ -138,18 +144,13 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_SAMPLE_SHADING: case PIPE_CAP_TEXTURE_GATHER_OFFSETS: case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION: - return 0; - case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY: - case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY: - case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY: - case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER: - return 1; - case PIPE_CAP_ENDIANNESS: - return PIPE_ENDIAN_LITTLE; - default: - debug_printf("unknown param %d\n", param); + case PIPE_CAP_USER_VERTEX_BUFFERS: + case PIPE_CAP_COMPUTE: return 0; } + + debug_printf("unknown param %d\n", param); + return 0; } static float -- 1.8.5.5
Ilia Mirkin
2014-Jun-18 03:55 UTC
[Nouveau] [PATCH 2/2] nv30: hack to avoid errors on unexpected color/zeta combinations
This is just a hack, it should be possible to create a temporary zeta surface and render to that instead. However that's more complicated and this avoids the render being entirely broken and errors being reported by the card. Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> Cc: "10.2" <mesa-stable at lists.freedesktop.org> --- src/gallium/drivers/nouveau/nv30/nv30_state.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/gallium/drivers/nouveau/nv30/nv30_state.c b/src/gallium/drivers/nouveau/nv30/nv30_state.c index 64be1b7..708ba34 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_state.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_state.c @@ -23,6 +23,7 @@ * */ +#include "util/u_format.h" #include "util/u_helpers.h" #include "util/u_inlines.h" @@ -360,6 +361,22 @@ nv30_set_framebuffer_state(struct pipe_context *pipe, nv30->framebuffer = *fb; nv30->dirty |= NV30_NEW_FRAMEBUFFER; + + /* Hardware can't handle different swizzled-ness or different blocksizes + * for zs and cbufs. If both are supplied and something doesn't match, + * blank out the zs for now so that at least *some* rendering can occur. + */ + if (fb->nr_cbufs > 0 && fb->zsbuf) { + struct nv30_miptree *color_mt = nv30_miptree(fb->cbufs[0]->texture); + struct nv30_miptree *zeta_mt = nv30_miptree(fb->zsbuf->texture); + + if (color_mt->swizzled != zeta_mt->swizzled || + (util_format_get_blocksize(fb->zsbuf->format) > 2) !+ (util_format_get_blocksize(fb->cbufs[0]->format) > 2)) { + nv30->framebuffer.zsbuf = NULL; + debug_printf("Mismatched color and zeta formats, ignoring zeta.\n"); + } + } } static void -- 1.8.5.5
Possibly Parallel Threads
- [Bug 92306] New: GL Excess demo renders incorrectly on nv43
- [PATCH] nv30,nvc0: only claim a single viewport
- [Patches] mesa/nv30: Diverse set of patches that improve NV3x render quality V2
- [PATCH 1/2] gallium: add PIPE_CAP_MIXED_FRAMEBUFFER_SIZES
- [PATCH 1/3] nvc0: remove vport_int hack and instead use the usual state validation