• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Delatore · Mar 11, 2017 at 10:28 AM · unity 5shaders

Error: Platform does not support compute shaders

I get an error every time I try to instantiate a compute buffer or try to dispatch a compute shader.

When I try to instantiate a compute buffer, it says:

Failed to create Compute Buffer, HRESULT: 0x80070057

Dispatching a compute shader returns:

Platform does not support compute shaders UnityEngine.ComputeShader:Dispatch(Int32, Int32, Int32, Int32) Fluid:Update() (at Assets/Fluid.cs:103)

Here's my CPU code:

 public class Fluid : MonoBehaviour {
 
     public RenderTexture mTex;
     public ComputeShader CSMain;
 
     public ComputeBuffer fluid, fluidin, forces;
 
     public float v = 0;
     public float W = 1, dt = 1f/24f;
 
     public int x = 64, y = 64, z = 64, w = 64;
 
     private int NavKernal, EmitKernal;
 
     int count(int i, int j, int k, int l)
     {
         return (i * y * z * w) + (j * z * w) + (k * w) + l;
     }
 
     struct voxel
     {
         public float density, temp, pressure;
         public Vector4 vel, vort;
     };
 
     struct force
     {
         uint x,y,z,w;
         Vector4 mag;
     };
 
     // Use this for initialization
     void Start () {
         //mTex.enableRandomWrite = true;
         //mTex.Create();
 
         NavKernal = CSMain.FindKernel("CSMain");
         EmitKernal = CSMain.FindKernel("CSEmit");
 
         CSMain.SetInt("numForces", 0);
         CSMain.SetInt("x", x);
         CSMain.SetInt("y", y);
         CSMain.SetInt("z", z);
         CSMain.SetInt("w", w);
 
         voxel[] vox = new voxel[x * y * z * w];
         for(int i = 0; i < x; i++)
         {
             for (int j = 0; j < y; j++)
             {
                 for (int k =0; k< z;k++)
                 {
                     for(int l = 0; l < w; l++)
                     {
                         voxel mvox = new voxel();
                         mvox.density = 0;
                         vox[count(i, j, k, l)] = new voxel();
                     }
                 }
             }
         }
 
         fluidin = new ComputeBuffer(x * y * z * w, sizeof(float)* 11);
         fluid = new ComputeBuffer(x * y * z * w, sizeof(float) * 11);
         forces = new ComputeBuffer(1, sizeof(float) * 8);
 
         fluidin.SetData(vox);
         fluid.SetData(vox);
         force[] forceArr = new force[1];
         forceArr[0] = new force();
         forces.SetData(forceArr);
 
         CSMain.SetBuffer(EmitKernal, "fluid", fluid);
         CSMain.SetBuffer(EmitKernal, "fluidin", fluidin);
         CSMain.SetBuffer(EmitKernal, "forces", forces);
         CSMain.SetTexture(EmitKernal, "Result", mTex);
 
         CSMain.SetBuffer(NavKernal, "fluid", fluid);
         CSMain.SetBuffer(NavKernal, "fluidin", fluidin);
         CSMain.SetBuffer(NavKernal, "forces", forces);
         CSMain.SetTexture(NavKernal, "Result", mTex);
 
     }
 
     void OnDestroy()
     {
         if (fluid != null) fluid.Release();
         if (fluidin != null) fluid.Release();
         if (forces != null) forces.Release();
     }
 
     
 
     // Update is called once per frame
     void Update () {
         CSMain.SetFloat("viscosity", v);
         CSMain.SetFloat("W", W);
 
         CSMain.Dispatch(EmitKernal, (x * y * z * w) / 64, 1, 1);
         CSMain.Dispatch(NavKernal, (x * y * z * w) / 64, 1, 1);
     }
 }

My dxdiag report: DXDiag

For the record, I am running an old switchable graphics card. It's an AMD Radeon HD 7670M.

Any help would be greatly appreciated.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by pwhbtg · Sep 01, 2017 at 06:05 AM

Hey man I've got the same problem Despite an NVIDIA graphics card and all necessary drivers.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Problem after upgrading from Unity 4.6 to Unity 5 0 Answers

How to Control shaders? 1 Answer

how to enable Compute shaders for OpenGL ES 3.X in Unity 5.1.x? 1 Answer

How to pass vertex color information into GLSL shaders program 1 Answer

Shader Program to have multiple passes where 2nd pass will work on result of 1st pass. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges