Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-12 17:13:56 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-12 17:13:56 +0400
commitebc653463ddfd9f8b893b6acbcc6465972e6abc6 (patch)
tree6b3cc2ba3f04994cf9f8d8f5bca6d63cfe2c9d1f /intern/cycles/device/device_cuda.cpp
parentc40492205b4369de3babe63b43d127ca622773ec (diff)
Cycles:
* Fix missing update when editing objects with emission materials. * Fix preview pass rendering set to 1 not showing full resolution. * Fix CUDA runtime compiling failing due to missing cache directory. * Use settings from first render layer for visibility and material override. And a bunch of incomplete and still disabled code mostly related to closure sampling.
Diffstat (limited to 'intern/cycles/device/device_cuda.cpp')
-rw-r--r--intern/cycles/device/device_cuda.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 49ffd3d0834..7fc0afce1ac 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -232,11 +232,16 @@ public:
double starttime = time_dt();
printf("Compiling CUDA kernel ...\n");
+ path_create_directories(cubin);
+
string command = string_printf("%s -arch=sm_%d%d -m%d --cubin \"%s\" --use_fast_math "
"-o \"%s\" --ptxas-options=\"-v\" --maxrregcount=%d --opencc-options -OPT:Olimit=0 -I\"%s\" -DNVCC",
nvcc.c_str(), major, minor, machine, kernel.c_str(), cubin.c_str(), maxreg, include.c_str());
- system(command.c_str());
+ if(system(command.c_str()) == -1) {
+ fprintf(stderr, "Failed to execute compilation command.\n");
+ return "";
+ }
/* verify if compilation succeeded */
if(!path_exists(cubin)) {
@@ -708,9 +713,13 @@ public:
cuda_push_context();
+ /* for multi devices, this assumes the ineffecient method that we allocate
+ all pixels on the device even though we only render to a subset */
+ size_t offset = sizeof(uint8_t)*4*y*w;
+
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pmem.cuPBO);
glBindTexture(GL_TEXTURE_2D, pmem.cuTexId);
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, 0);
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, (void*)offset);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
glEnable(GL_TEXTURE_2D);
@@ -729,11 +738,11 @@ public:
glTexCoord2f(0.0f, 0.0f);
glVertex2f(0.0f, 0.0f);
- glTexCoord2f((float)w/(float)width, 0);
+ glTexCoord2f((float)w/(float)pmem.w, 0.0f);
glVertex2f((float)width, 0.0f);
- glTexCoord2f((float)w/(float)width, (float)h/(float)height);
+ glTexCoord2f((float)w/(float)pmem.w, (float)h/(float)pmem.h);
glVertex2f((float)width, (float)height);
- glTexCoord2f(0.0f, (float)h/(float)height);
+ glTexCoord2f(0.0f, (float)h/(float)pmem.h);
glVertex2f(0.0f, (float)height);
glEnd();