blob: 7c624cee654e8c4d956174f398c3989ad956bfb4 [file] [log] [blame]
joshualitt30ba4362014-08-21 20:18:45 -07001/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
egdaniel2d721d32015-11-11 13:06:05 -08008#ifndef GrGLSLVertexShader_DEFINED
9#define GrGLSLVertexShader_DEFINED
joshualitt47bb3822014-10-07 16:43:25 -070010
egdaniel2d721d32015-11-11 13:06:05 -080011#include "GrGLSLShaderBuilder.h"
joshualitt5bf99f12015-03-13 11:47:42 -070012#include "GrGeometryProcessor.h"
joshualitt30ba4362014-08-21 20:18:45 -070013
egdaniel8dcdedc2015-11-11 06:27:20 -080014class GrGLSLVarying;
joshualitt30ba4362014-08-21 20:18:45 -070015
egdaniel7ea439b2015-12-03 09:20:44 -080016// Enough precision to represent 1 / 2048 accurately in printf
17#define GR_SIGNIFICANT_POW2_DECIMAL_DIG 11
18
egdaniel2d721d32015-11-11 13:06:05 -080019class GrGLSLVertexBuilder : public GrGLSLShaderBuilder {
joshualitt30ba4362014-08-21 20:18:45 -070020public:
egdaniel2d721d32015-11-11 13:06:05 -080021 GrGLSLVertexBuilder(GrGLSLProgramBuilder* program);
joshualitt30ba4362014-08-21 20:18:45 -070022
robertphillips46d36f02015-01-18 08:14:14 -080023 void transformToNormalizedDeviceSpace(const GrShaderVar& posVar);
joshualitt74077b92014-10-24 11:26:03 -070024private:
egdaniel0eafe792015-11-20 14:01:22 -080025 void onFinalize() override;
egdaniel574a4c12015-11-02 06:22:44 -080026
joshualitt2dd1ae02014-12-03 06:24:10 -080027 const char* fRtAdjustName;
joshualitt30ba4362014-08-21 20:18:45 -070028
joshualitt74077b92014-10-24 11:26:03 -070029 friend class GrGLProgramBuilder;
30
egdaniel2d721d32015-11-11 13:06:05 -080031 typedef GrGLSLShaderBuilder INHERITED;
joshualitt30ba4362014-08-21 20:18:45 -070032};
33
34#endif