diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 018bae98e8..0b9c219df2 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -420,10 +420,12 @@ brw_get_texture_swizzle(const struct gl_context *ctx, } break; case GL_RED: - swizzles[1] = SWIZZLE_ZERO; + if (datatype == GL_UNSIGNED_BYTE) + swizzles[1] = SWIZZLE_ZERO; /* fallthrough */ case GL_RG: - swizzles[2] = SWIZZLE_ZERO; + if (datatype == GL_UNSIGNED_BYTE) + swizzles[2] = SWIZZLE_ZERO; /* fallthrough */ case GL_RGB: if (_mesa_get_format_bits(img->TexFormat, GL_ALPHA_BITS) > 0 || diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c index 7e40d61a47..22c499127a 100644 --- a/src/mesa/drivers/dri/i965/intel_fbo.c +++ b/src/mesa/drivers/dri/i965/intel_fbo.c @@ -771,8 +771,15 @@ intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) continue; } + if (rb->Format == MESA_FORMAT_R_SRGB8) { + fbo_incomplete(fb, GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT, + "FBO incomplete: Format not color renderable: %s\n", + _mesa_get_format_name(rb->Format)); + continue; + } + if (!brw_render_target_supported(brw, rb)) { - fbo_incomplete(fb, GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT, + fbo_incomplete(fb, GL_FRAMEBUFFER_UNSUPPORTED, "FBO incomplete: Unsupported HW " "texture/renderbuffer format attached: %s\n", _mesa_get_format_name(intel_rb_format(irb)));