[Mesa-dev] [PATCH 1/5] mesa: hook up core bits of GL_ARB_shader_group_vote
Ilia Mirkin
imirkin at alum.mit.edu
Tue Jun 7 00:53:14 UTC 2016
On Mon, Jun 6, 2016 at 6:00 PM, Ian Romanick <idr at freedesktop.org> wrote:
> On 05/29/2016 11:01 AM, Ilia Mirkin wrote:
>> diff --git a/src/compiler/glsl/ir_validate.cpp b/src/compiler/glsl/ir_validate.cpp
>> index 757f17c..bd69cd2 100644
>> --- a/src/compiler/glsl/ir_validate.cpp
>> +++ b/src/compiler/glsl/ir_validate.cpp
>> @@ -453,6 +453,14 @@ ir_validate::visit_leave(ir_expression *ir)
>> assert(ir->operands[0]->type->base_type == GLSL_TYPE_SUBROUTINE);
>> assert(ir->type->base_type == GLSL_TYPE_INT);
>> break;
>> +
>> + case ir_unop_vote_any:
>> + case ir_unop_vote_all:
>> + case ir_unop_vote_eq:
>> + assert(ir->type->base_type == GLSL_TYPE_BOOL);
>> + assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
>
> The inputs and output are always scalar Boolean, so I think it's better
> to check ir->type == glsl_type::bool_type. With that changed, this patch is
>
> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
>
Right, changed both of those. Been a while since I've touched ir
types, was just cut & pasting.
> One other side comment below.
>
>> + break;
>> +
>> case ir_binop_add:
>> case ir_binop_sub:
>> case ir_binop_mul:
>> diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
>> index 7f24a9e..b10648b 100644
>> --- a/src/mesa/program/ir_to_mesa.cpp
>> +++ b/src/mesa/program/ir_to_mesa.cpp
>> @@ -1375,6 +1375,9 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
>> case ir_unop_dFdy_fine:
>> case ir_unop_subroutine_to_int:
>> case ir_unop_get_buffer_size:
>> + case ir_unop_vote_any:
>> + case ir_unop_vote_all:
>> + case ir_unop_vote_eq:
>> assert(!"not supported");
>
> I'd also support a follow-on patch that converts this to unreachable().
I'm a bit weary of throwing in unreachable unless I'm 100% sure it's
actually unreachable. Someone would have to go through that whole list
and become sure of that. Not against someone doing it, but not sure
that I'll be the one to do so.
-ilia
More information about the mesa-dev
mailing list