Giter Site home page Giter Site logo

Crash on certain shader inputs about shadered HOT 3 CLOSED

dfranx avatar dfranx commented on May 12, 2024
Crash on certain shader inputs

from shadered.

Comments (3)

dfranx avatar dfranx commented on May 12, 2024 1

Your cbuffer definitely causes the crash. An exception: "Buffer block cannot be expressed as any of std430, std140, scalar, even with enhanced layouts. You can try flattening this block to support a more flexible layout." is thrown.

It works fine when it is reordered in this way (or just float2 before int):

cbuffer cbPerFrame : register(b0)
{
	float4x4 matGeo;
	float4x4 matVP;
	float4x4 matGeoLast;
	float4x4 matVPLast;
	float4x4 matVInv;
	float2 viewport;
	int frame;
};

I guess I could encapsulate this in a try-catch block just to prevent crashes. I don't think I can fix it.

Also a quick note: since HLSL is being translated to GLSL, the actual order of variables doesn't matter (like it usually does when using Direct3D). Only the names inside of the cbuffer matter. So you can just reorder variables and it should keep working as expected.

from shadered.

CptPotato avatar CptPotato commented on May 12, 2024 1

Thanks, this solved the issue for me.

from shadered.

dfranx avatar dfranx commented on May 12, 2024

It shouldn't crash anymore.

from shadered.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.