Just found another problem. This time, I think its a Bug. Not sure if it is my graphics driver tho.
Situation is as follows:
first, a 2D texture is setup, then some data is written to it using imageStore() in GPU, as a compute shader.
On some image sizes, the call to extractTexture or texture.write takes infinity, panda window becomes grey, and clicking on it gives me a windows crash report, saying:
Of course, the output file is empty afterwards.
Tested with following image sizes:
256,256: no crash
255,255 crash
1025,1025: no crash
129,129: crash
128,128: no crash
1025, 1025: no crash
to some up, only uneven image sizes seem to be affected.
not every uneven image size results in a crash.
Problemereignisname: APPCRASH
Anwendungsname: python.exe
Anwendungsversion: 0.0.0.0
Anwendungszeitstempel: 5560ae54
Fehlermodulname: StackHash_cff8
Fehlermodulversion: 6.1.7601.19045
Fehlermodulzeitstempel: 56259295
Ausnahmecode: c0000374
Ausnahmeoffset: 00000000000bffc2
Betriebsystemversion: 6.1.7601.2.1.0.768.3
Gebietsschema-ID: 1031
Zusatzinformation 1: cff8
Zusatzinformation 2: cff87d79f9b1a3b25a1935a13c1fd06a
Zusatzinformation 3: d2c7
Zusatzinformation 4: d2c7b514c68f3cdee3fe42a00e5a8eca
Test Program:
from panda3d.core import Shader, ComputeNode, Texture, NodePath, ShaderAttrib, Filename
from direct.directbase import DirectStart
shader_rect = Shader.load_compute(Shader.SL_GLSL,"bw_rect.glsl")
img_out = Texture("img_out")
# here, set the image size.
img_out.setup2dTexture(255,255,Texture.T_unsigned_short, Texture.F_r16)
dummy = NodePath("dummy")
dummy.set_shader(shader_rect)
dummy.set_shader_input("img_out", img_out)
sattr = dummy.get_attrib(ShaderAttrib)
base.graphicsEngine.dispatch_compute((128/32+1, 128/32+1, 1), sattr, base.win.get_gsg())
base.graphicsEngine.extractTextureData(img_out,base.win.get_gsg())
img_out.setFormat(Texture.F_luminance)
img_out.write(Filename("output.png"))
Shader:
#version 450
layout (binding=0, r16) writeonly uniform image2D img_out;
layout (local_size_x = 32, local_size_y = 32) in;
void main() {
ivec2 texelCoords = ivec2(gl_GlobalInvocationID.xy);
vec4 pixel = vec4(1,0,0,1);
imageStore(img_out, texelCoords, pixel);
}
I’m on win 7, 64Bit.
Can someone test this to confirm?
would be good to know