7 Replies Latest reply on Sep 14, 2011 2:19 PM by himanshu.gautam

    SDK 2.5 Bug : access violation

    spectral

      Hi,

      I have some OpenCL code (works on other platforms) but crash with AMD SDK.

      It seems that it does an access violation when accessing "shaderParams->params.matte.Kd". in line 9 !

      But it print the correct value (1.f). If I remove the line 9 there is no problem !

      It looks like a Bug in the SDK (I work on the CPU).

       

      Krys

      clReflectance shader_matte2(clScene* scene, ShaderGlobalParameters* globals, ShaderParameters* shaderParams, NextEventPath* nextEventPath) { clReflectance f; ClosureParameters p_21; p_21.params.diffuse.N = globals->N; printf("%f\n", shaderParams->params.matte.Kd); f = Integrator(scene, globals, 0, &p_21, nextEventPath)*shaderParams->params.matte.Cs; //f *= shaderParams->params.matte.Kd; return f; }

        • SDK 2.5 Bug : access violation
          spectral

          I also join the declaration of my structure :

           

           

          struct __attribute__((packed)) ShaderParam_matte { float Kd __attribute__((packed)); clRGB Cs __attribute__((packed)); }; struct __attribute__((packed)) ShaderParametersStruct { uint shaderId __attribute__((packed)); union __attribute__((packed)) { struct ShaderParam_ashikhmin ashikhmin; struct ShaderParam_ashikhmin_velvet ashikhmin_velvet; struct ShaderParam_debug debug; struct ShaderParam_emitter emitter; struct ShaderParam_emitter_textured emitter_textured; struct ShaderParam_glass glass; struct ShaderParam_glass_rough glass_rough; struct ShaderParam_glass_textured glass_textured; struct ShaderParam_glossy glossy; struct ShaderParam_matte matte; struct ShaderParam_matte_textured matte_textured; struct ShaderParam_metal_rough metal_rough; struct ShaderParam_mirror mirror; struct ShaderParam_mirror_textured mirror_textured; struct ShaderParam_oren_nayar oren_nayar; struct ShaderParam_phong phong; struct ShaderParam_transmissive transmissive; struct ShaderParam_ward ward; struct ShaderParam_unit_test_builtinfunctions unit_test_builtinfunctions; } params __attribute__((packed)); };