mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 10:35:43 -05:00
Integrated glsl-optimizer.
This commit is contained in:
parent
2936474f49
commit
8d5f9f3355
3 changed files with 6 additions and 3 deletions
|
@ -171,7 +171,7 @@ static void propagate_precision_expr(ir_instruction *ir, void *data)
|
|||
return;
|
||||
|
||||
glsl_precision prec_params_max = glsl_precision_undefined;
|
||||
for (int i = 0; i < expr->get_num_operands(); ++i)
|
||||
for (int i = 0; i < (int)expr->get_num_operands(); ++i)
|
||||
{
|
||||
ir_rvalue* op = expr->operands[i];
|
||||
if (op && op->get_precision() != glsl_precision_undefined)
|
||||
|
@ -317,7 +317,7 @@ glslopt_shader* glslopt_optimize (glslopt_ctx* ctx, glslopt_shader_type type, co
|
|||
{
|
||||
glslopt_shader* shader = new (ctx->mem_ctx) glslopt_shader ();
|
||||
|
||||
PrintGlslMode printMode;
|
||||
PrintGlslMode printMode = kPrintGlslVertex;
|
||||
switch (type) {
|
||||
case kGlslOptShaderVertex: shader->shader->Type = GL_VERTEX_SHADER; printMode = kPrintGlslVertex; break;
|
||||
case kGlslOptShaderFragment: shader->shader->Type = GL_FRAGMENT_SHADER; printMode = kPrintGlslFragment; break;
|
||||
|
|
2
3rdparty/glsl-optimizer/src/glsl/ir.cpp
vendored
2
3rdparty/glsl-optimizer/src/glsl/ir.cpp
vendored
|
@ -1544,7 +1544,7 @@ ir_swizzle::variable_referenced() const
|
|||
ir_variable::ir_variable(const struct glsl_type *type, const char *name,
|
||||
ir_variable_mode mode, glsl_precision precision)
|
||||
: max_array_access(0), read_only(false), centroid(false), invariant(false),
|
||||
mode(mode), precision(precision), interpolation(INTERP_QUALIFIER_NONE)
|
||||
mode(mode), interpolation(INTERP_QUALIFIER_NONE), precision(precision)
|
||||
{
|
||||
this->ir_type = ir_type_variable;
|
||||
this->type = type;
|
||||
|
|
|
@ -227,6 +227,9 @@ ir_visitor_status
|
|||
ir_validate::visit_leave(ir_expression *ir)
|
||||
{
|
||||
switch (ir->operation) {
|
||||
case ir_ternop_clamp:
|
||||
case ir_ternop_mix:
|
||||
break;
|
||||
case ir_unop_bit_not:
|
||||
assert(ir->operands[0]->type == ir->type);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue