svn merge ^/trunk/blender -r42516:42521

This commit is contained in:
Campbell Barton
2011-12-09 00:23:57 +00:00
8 changed files with 53 additions and 28 deletions

View File

@@ -119,6 +119,12 @@ tempbitness = int(B.arguments.get('BF_BITNESS', bitness)) # default to bitness f
if tempbitness in (32, 64): # only set if 32 or 64 has been given
bitness = int(tempbitness)
if bitness:
B.bitness = bitness
else:
B.bitness = tempbitness
# first check cmdline for toolset and we create env to work on
quickie = B.arguments.get('BF_QUICK', None)
quickdebug = B.arguments.get('BF_QUICKDEBUG', None)

View File

@@ -50,6 +50,7 @@ program_list = [] # A list holding Nodes to final binaries, used to create insta
arguments = None
targets = None
resources = []
bitness = 0
#some internals
blenderdeps = [] # don't manipulate this one outside this module!

View File

@@ -269,7 +269,7 @@ SessionParams BlenderSync::get_session_params(BL::Scene b_scene, bool background
if(!experimental || RNA_enum_get(&cscene, "gpu_type") == 0)
dtype = DEVICE_CUDA;
else
dtype = DEVICE_CUDA;
dtype = DEVICE_OPENCL;
if(device_type_available(types, dtype))
params.device_type = dtype;

View File

@@ -1,6 +1,7 @@
#!/usr/bin/python
import sys
import os
import Blender as B
def normpath(path):
return os.path.abspath(os.path.normpath(path))
@@ -9,6 +10,12 @@ Import ('env')
kernel_binaries = []
#Bitness
if B.bitness == 32:
bits = 32
else:
bits = 64
if env['WITH_BF_CYCLES_CUDA_BINARIES']:
kernel = env.Clone()
@@ -27,7 +34,8 @@ if env['WITH_BF_CYCLES_CUDA_BINARIES']:
svm_dir = os.path.join(source_dir, "../svm")
# nvcc flags
nvcc_flags = "--cubin -use_fast_math --ptxas-options=\"-v\" --maxrregcount=24"
nvcc_flags = "-m%s" % (bits)
nvcc_flags += " --cubin -use_fast_math --ptxas-options=\"-v\" --maxrregcount=24"
nvcc_flags += " --opencc-options -OPT:Olimit=0"
nvcc_flags += " -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC"
nvcc_flags += " -I \"%s\" -I \"%s\"" % (util_dir, svm_dir)

View File

@@ -270,15 +270,19 @@ void Mesh::compute_bvh(SceneParams *params, Progress& progress)
void Mesh::tag_update(Scene *scene, bool rebuild)
{
need_update = true;
if(rebuild)
if(rebuild) {
need_update_rebuild = true;
scene->light_manager->need_update = true;
}
else {
foreach(uint sindex, used_shaders)
if(scene->shaders[sindex]->has_surface_emission)
scene->light_manager->need_update = true;
}
scene->mesh_manager->need_update = true;
scene->object_manager->need_update = true;
foreach(uint sindex, used_shaders)
if(scene->shaders[sindex]->has_surface_emission)
scene->light_manager->need_update = true;
}
/* Mesh Manager */
@@ -685,9 +689,9 @@ void MeshManager::device_update(Device *device, DeviceScene *dscene, Scene *scen
if(!mesh->transform_applied) {
string msg = "Updating Mesh BVH ";
if(mesh->name == "")
msg += string_printf("%lu/%lu", (unsigned long)(i+1), (unsigned long)num_instance_bvh);
msg += string_printf("%u/%u", (uint)(i+1), (uint)num_instance_bvh);
else
msg += string_printf("%s %lu/%lu", mesh->name.c_str(), (unsigned long)(i+1), (unsigned long)num_instance_bvh);
msg += string_printf("%s %u/%u", mesh->name.c_str(), (uint)(i+1), (uint)num_instance_bvh);
progress.set_status(msg, "Building BVH");
mesh->compute_bvh(&scene->params, progress);

View File

@@ -47,6 +47,7 @@
*/
#include "util_debug.h"
#include "util_types.h"
#include "sobol.h"
@@ -55,8 +56,8 @@ CCL_NAMESPACE_BEGIN
#define SOBOL_MAX_NUMBER 32
typedef struct SobolDirectionNumbers {
unsigned int d, s, a;
unsigned int m[SOBOL_MAX_NUMBER];
uint d, s, a;
uint m[SOBOL_MAX_NUMBER];
} SobolDirectionNumbers;
static SobolDirectionNumbers SOBOL_NUMBERS[SOBOL_MAX_DIMENSIONS-1] = {
@@ -21262,38 +21263,38 @@ static SobolDirectionNumbers SOBOL_NUMBERS[SOBOL_MAX_DIMENSIONS-1] = {
{21201, 18, 131059, {1, 1, 7, 11, 15, 7, 37, 239, 337, 245, 1557, 3681, 7357, 9639, 27367, 26869, 114603, 86317}}
};
void sobol_generate_direction_vectors(unsigned int vectors[][SOBOL_BITS], int dimensions)
void sobol_generate_direction_vectors(uint vectors[][SOBOL_BITS], int dimensions)
{
assert(dimensions <= SOBOL_MAX_DIMENSIONS);
const unsigned int L = SOBOL_BITS;
const uint L = SOBOL_BITS;
/* first dimension is exception */
unsigned int *v = vectors[0];
uint *v = vectors[0];
for(unsigned int i = 0; i < L; i++)
for(uint i = 0; i < L; i++)
v[i] = 1 << (31-i); // all m's = 1
for(int dim = 1; dim < dimensions; dim++) {
SobolDirectionNumbers *numbers = &SOBOL_NUMBERS[dim-1];
unsigned int s = numbers->s;
unsigned int a = numbers->a;
unsigned int *m = numbers->m;
uint s = numbers->s;
uint a = numbers->a;
uint *m = numbers->m;
v = vectors[dim];
if(L <= s) {
for(unsigned int i = 0; i < L; i++)
for(uint i = 0; i < L; i++)
v[i] = m[i] << (31-i);
}
else {
for(unsigned int i = 0; i < s; i++)
for(uint i = 0; i < s; i++)
v[i] = m[i] << (31-i);
for(unsigned int i = s; i < L; i++) {
for(uint i = s; i < L; i++) {
v[i] = v[i-s] ^ (v[i-s] >> s);
for(unsigned int k = 1; k < s; k++)
for(uint k = 1; k < s; k++)
v[i] ^= (((a >> (s-1-k)) & 1) * v[i-k]);
}
}

View File

@@ -19,12 +19,14 @@
#ifndef __SOBOL_H__
#define __SOBOL_H__
#include "util_types.h"
CCL_NAMESPACE_BEGIN
#define SOBOL_BITS 32
#define SOBOL_MAX_DIMENSIONS 21201
void sobol_generate_direction_vectors(unsigned int vectors[][SOBOL_BITS], int dimensions);
void sobol_generate_direction_vectors(uint vectors[][SOBOL_BITS], int dimensions);
CCL_NAMESPACE_END

View File

@@ -5241,11 +5241,14 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
data->state= state;
if(!ELEM(state, BUTTON_STATE_EXIT, BUTTON_STATE_HIGHLIGHT)) {
/* When objects for eg. are removed, running ui_check_but()
* can access the removed data - so disable update on exit
* or highlight */
ui_check_but(but);
if(state != BUTTON_STATE_EXIT) {
/* When objects for eg. are removed, running ui_check_but() can access
the removed data - so disable update on exit. Also in case of
highlight when not in a popup menu, we remove because data used in
button below popup might have been removed by action of popup. Needs
a more reliable solution... */
if(state != BUTTON_STATE_HIGHLIGHT || but->block->handle)
ui_check_but(but);
}
/* redraw */