Fix return type of shadow2D/sampler_compare (#1066)

* GL Renderer, OSX, no swap chain: Bind back buffer fbo ready for NSOpenGLContext flushBuffer

* Support for high precision Metal texture samplers.

* Fix return type of shadow2D/sampler_compare
This commit is contained in:
Don Williamson 2017-03-06 17:58:55 +00:00 committed by Branimir Karadžić
parent d27ff36d44
commit bf4d092064

View File

@ -1282,6 +1282,12 @@ void ir_print_metal_visitor::visit(ir_texture *ir)
sampler_uv_dim += 1;
const bool is_proj = (uv_dim > sampler_uv_dim) && !is_array;
// Construct as the expected return type of shadow2D as sample_compare returns a scalar
if (is_shadow)
{
buffer.asprintf_append("float4(");
}
// texture name & call to sample
ir->sampler->accept(this);
if (is_shadow)
@ -1345,6 +1351,12 @@ void ir_print_metal_visitor::visit(ir_texture *ir)
//@TODO: pixel offsets
buffer.asprintf_append (")");
// Close float4 cast
if (is_shadow)
{
buffer.asprintf_append(")");
}
}