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 origins array
2*ShaderSrcImageCount + // the source image region sizes array 2*ShaderSrcImageCount + // the source image region sizes array
16 // the projection matrix 16 // the projection matrix
ProjectionMatrixUniformDwordIndex = 2 +
2*ShaderSrcImageCount +
2 +
2 +
2*ShaderSrcImageCount +
2*ShaderSrcImageCount
) )
const ( const (

View File

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

View File

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