+change static naming in IR to make it compatible with NVVM
This commit is contained in:
@@ -101,7 +101,7 @@ ray_plane_intersect(Isect &isect, Ray &ray, uniform Plane &plane) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void
|
void
|
||||||
ray_sphere_intersect(Isect &isect, Ray &ray, uniform Sphere &sphere) {
|
ray_sphere_intersect(Isect &isect, Ray &ray, uniform Sphere &sphere) {
|
||||||
vec rs = ray.org - sphere.center;
|
vec rs = ray.org - sphere.center;
|
||||||
|
|
||||||
@@ -158,8 +158,8 @@ ambient_occlusion(Isect &isect, uniform Plane &plane, uniform Sphere spheres[3],
|
|||||||
|
|
||||||
orthoBasis(basis, isect.n);
|
orthoBasis(basis, isect.n);
|
||||||
|
|
||||||
const uniform int ntheta = NAO_SAMPLES;
|
static const uniform int ntheta = NAO_SAMPLES;
|
||||||
const uniform int nphi = NAO_SAMPLES;
|
static const uniform int nphi = NAO_SAMPLES;
|
||||||
for (uniform int j = 0; j < ntheta; j++) {
|
for (uniform int j = 0; j < ntheta; j++) {
|
||||||
for (uniform int i = 0; i < nphi; i++) {
|
for (uniform int i = 0; i < nphi; i++) {
|
||||||
Ray ray;
|
Ray ray;
|
||||||
@@ -200,15 +200,15 @@ ambient_occlusion(Isect &isect, uniform Plane &plane, uniform Sphere spheres[3],
|
|||||||
/* Compute the image for the scanlines from [y0,y1), for an overall image
|
/* Compute the image for the scanlines from [y0,y1), for an overall image
|
||||||
of width w and height h.
|
of width w and height h.
|
||||||
*/
|
*/
|
||||||
static inline void ao_tile(
|
static inline void ao_tile(
|
||||||
uniform int x0, uniform int x1,
|
uniform int x0, uniform int x1,
|
||||||
uniform int y0, uniform int y1,
|
uniform int y0, uniform int y1,
|
||||||
uniform int w, uniform int h,
|
uniform int w, uniform int h,
|
||||||
uniform int nsubsamples,
|
uniform int nsubsamples,
|
||||||
uniform float image[])
|
uniform float image[])
|
||||||
{
|
{
|
||||||
uniform Plane plane = { { 0.0f, -0.5f, 0.0f }, { 0.f, 1.f, 0.f } };
|
static uniform Plane plane = { { 0.0f, -0.5f, 0.0f }, { 0.f, 1.f, 0.f } };
|
||||||
uniform Sphere spheres[3] = {
|
static uniform Sphere spheres[3] = {
|
||||||
{ { -2.0f, 0.0f, -3.5f }, 0.5f },
|
{ { -2.0f, 0.0f, -3.5f }, 0.5f },
|
||||||
{ { -0.5f, 0.0f, -3.0f }, 0.5f },
|
{ { -0.5f, 0.0f, -3.0f }, 0.5f },
|
||||||
{ { 1.0f, 0.0f, -2.2f }, 0.5f } };
|
{ { 1.0f, 0.0f, -2.2f }, 0.5f } };
|
||||||
|
|||||||
4
stmt.cpp
4
stmt.cpp
@@ -239,9 +239,9 @@ DeclStmt::EmitCode(FunctionEmitContext *ctx) const {
|
|||||||
new llvm::GlobalVariable(*m->module, llvmType,
|
new llvm::GlobalVariable(*m->module, llvmType,
|
||||||
sym->type->IsConstType(),
|
sym->type->IsConstType(),
|
||||||
llvm::GlobalValue::InternalLinkage, cinit,
|
llvm::GlobalValue::InternalLinkage, cinit,
|
||||||
llvm::Twine("static.") +
|
llvm::Twine("static_") +
|
||||||
llvm::Twine(sym->pos.first_line) +
|
llvm::Twine(sym->pos.first_line) +
|
||||||
llvm::Twine(".") + sym->name.c_str());
|
llvm::Twine("_") + sym->name.c_str());
|
||||||
// Tell the FunctionEmitContext about the variable
|
// Tell the FunctionEmitContext about the variable
|
||||||
ctx->EmitVariableDebugInfo(sym);
|
ctx->EmitVariableDebugInfo(sym);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user