mirror of
				https://github.com/stevenrobertson/cuburn.git
				synced 2025-11-03 18:00:55 -05:00 
			
		
		
		
	Fix rendering at insane resolutions
This commit is contained in:
		@ -11,7 +11,7 @@ void colorclip(float4 *pixbuf, float gamma, float vibrancy, float highpow,
 | 
			
		||||
               float linrange, float lingam, float3 bkgd) {
 | 
			
		||||
    // TODO: test if over an edge of the framebuffer - currently gutters are
 | 
			
		||||
    // used and up to 256 pixels are ignored, which breaks when width<256
 | 
			
		||||
    int i = blockDim.x * blockIdx.x + threadIdx.x;
 | 
			
		||||
    int i = (gridDim.x * blockIdx.y + blockIdx.x) * blockDim.x + threadIdx.x;
 | 
			
		||||
    float4 pix = pixbuf[i];
 | 
			
		||||
 | 
			
		||||
    if (pix.w <= 0) {
 | 
			
		||||
 | 
			
		||||
@ -103,7 +103,7 @@ uint32_t trunca(float f) {
 | 
			
		||||
 | 
			
		||||
__global__
 | 
			
		||||
void zero_dptr(float* dptr, int size) {
 | 
			
		||||
    int i = blockIdx.x * blockDim.x + threadIdx.x;
 | 
			
		||||
    int i = (gridDim.x * blockIdx.y + blockIdx.x) * blockDim.x + threadIdx.x;
 | 
			
		||||
    if (i < size) {
 | 
			
		||||
        dptr[i] = 0.0f;
 | 
			
		||||
    }
 | 
			
		||||
@ -161,8 +161,9 @@ void write_half(float &xy, float x, float y, float den) {
 | 
			
		||||
        number of 4-byte words in the pointer.
 | 
			
		||||
        """
 | 
			
		||||
        zero = mod.get_function("zero_dptr")
 | 
			
		||||
        blocks = int(np.ceil(np.sqrt(size / 1024 + 1)))
 | 
			
		||||
        zero(dptr, np.int32(size), stream=stream,
 | 
			
		||||
             block=(1024, 1, 1), grid=(size/1024+1, 1))
 | 
			
		||||
             block=(1024, 1, 1), grid=(blocks, blocks, 1))
 | 
			
		||||
 | 
			
		||||
class DataPackerView(object):
 | 
			
		||||
    """
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user