internal/graphicsdriver/playstation5: add ebitengine_ProjectionMatrixUniformDwordIndex

This is a necessary information to treat the projection matrix correctly.

This change also updates the header file to avoid duplicated symbols
for constant variables.
This commit is contained in:
Hajime Hoshi 2024-12-07 23:04:17 +09:00
parent beac278c59
commit 103b3fe11e
3 changed files with 34 additions and 16 deletions

View File

@ -36,6 +36,13 @@ const (
2*ShaderSrcImageCount + // the source image region origins array
2*ShaderSrcImageCount + // the source image region sizes array
16 // the projection matrix
ProjectionMatrixUniformDwordIndex = 2 +
2*ShaderSrcImageCount +
2 +
2 +
2*ShaderSrcImageCount +
2*ShaderSrcImageCount
)
const (

View File

@ -30,6 +30,11 @@ import (
"github.com/hajimehoshi/ebiten/v2/internal/shaderir"
)
//export ebitengine_ProjectionMatrixUniformDwordIndex
func ebitengine_ProjectionMatrixUniformDwordIndex() C.int {
return C.int(graphics.ProjectionMatrixUniformDwordIndex)
}
type playstation5Error struct {
name string
code int

View File

@ -25,6 +25,8 @@
extern "C" {
#endif
int ebitengine_ProjectionMatrixUniformDwordIndex();
typedef struct ebitengine_Error {
const char *message;
int code;
@ -52,23 +54,27 @@ typedef struct ebitengine_DstRegion {
// kBlendFactor* and kBlendOperation* must be synced with
// internal/graphicsdriver/blend.go.
const uint8_t kBlendFactorZero = 0;
const uint8_t kBlendFactorOne = 1;
const uint8_t kBlendFactorSourceColor = 2;
const uint8_t kBlendFactorOneMinusSourceColor = 3;
const uint8_t kBlendFactorSourceAlpha = 4;
const uint8_t kBlendFactorOneMinusSourceAlpha = 5;
const uint8_t kBlendFactorDestinationColor = 6;
const uint8_t kBlendFactorOneMinusDestinationColor = 7;
const uint8_t kBlendFactorDestinationAlpha = 8;
const uint8_t kBlendFactorOneMinusDestinationAlpha = 9;
const uint8_t kBlendFactorSourceAlphaSaturated = 10;
enum {
kBlendFactorZero = 0,
kBlendFactorOne = 1,
kBlendFactorSourceColor = 2,
kBlendFactorOneMinusSourceColor = 3,
kBlendFactorSourceAlpha = 4,
kBlendFactorOneMinusSourceAlpha = 5,
kBlendFactorDestinationColor = 6,
kBlendFactorOneMinusDestinationColor = 7,
kBlendFactorDestinationAlpha = 8,
kBlendFactorOneMinusDestinationAlpha = 9,
kBlendFactorSourceAlphaSaturated = 10,
};
const uint8_t kBlendOperationAdd = 0;
const uint8_t kBlendOperationSubtract = 1;
const uint8_t kBlendOperationReverseSubtract = 2;
const uint8_t kBlendOperationMin = 3;
const uint8_t kBlendOperationMax = 4;
enum {
kBlendOperationAdd = 0,
kBlendOperationSubtract = 1,
kBlendOperationReverseSubtract = 2,
kBlendOperationMin = 3,
kBlendOperationMax = 4,
};
typedef struct ebitengine_Blend {
uint8_t factor_src_rgb;