mirror of
https://github.com/ScrelliCopter/NeHe-SDL_GPU.git
synced 2025-06-19 21:49:17 +10:00
Fix some typos and small errors
This commit is contained in:
@@ -110,7 +110,7 @@ def compile_dxil_shaders(shaders: Iterable[Shader], dxc: str | None = None, cwd:
|
|||||||
for shader in shaders:
|
for shader in shaders:
|
||||||
entry, shader_type = {
|
entry, shader_type = {
|
||||||
"vert": ("VertexMain", "vs_6_0"),
|
"vert": ("VertexMain", "vs_6_0"),
|
||||||
"frag": ("FragmentMain", "ps_6_0") }[shader.type]
|
"frag": ("PixelMain", "ps_6_0") }[shader.type]
|
||||||
cflags = ["-E", entry, "-T", shader_type]
|
cflags = ["-E", entry, "-T", shader_type]
|
||||||
subprocess.run([dxc, *cflags, "-Fo", shader.output, shader.source], cwd=cwd, check=True)
|
subprocess.run([dxc, *cflags, "-Fo", shader.output, shader.source], cwd=cwd, check=True)
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ def compile_dxbc_shaders(shaders: Iterable[Shader], cwd: Path | None = None) ->
|
|||||||
for shader in shaders:
|
for shader in shaders:
|
||||||
entry, shader_type = {
|
entry, shader_type = {
|
||||||
"vert": ("VertexMain", "vs_5_1"),
|
"vert": ("VertexMain", "vs_5_1"),
|
||||||
"frag": ("FragmentMain", "ps_5_1") }[shader.type]
|
"frag": ("PixelMain", "ps_5_1") }[shader.type]
|
||||||
cflags = ["/E", entry, "/T", shader_type]
|
cflags = ["/E", entry, "/T", shader_type]
|
||||||
subprocess.run(["fxc", *cflags, "/Fo", shader.output, shader.source], cwd=cwd, check=True)
|
subprocess.run(["fxc", *cflags, "/Fo", shader.output, shader.source], cwd=cwd, check=True)
|
||||||
|
|
||||||
|
|||||||
@@ -50,12 +50,12 @@ static const Vertex vertices[] =
|
|||||||
|
|
||||||
static const uint16_t indices[] =
|
static const uint16_t indices[] =
|
||||||
{
|
{
|
||||||
0, 1, 2, 2, 3, 0, // Front
|
0, 1, 2, 2, 3, 0, // Front
|
||||||
4, 5, 6, 6, 7, 4, // Back
|
4, 5, 6, 6, 7, 4, // Back
|
||||||
8, 9, 10, 10, 11, 8, // Top
|
8, 9, 10, 10, 11, 8, // Top
|
||||||
12, 13, 14, 14, 15, 12, // Bottom
|
12, 13, 14, 14, 15, 12, // Bottom
|
||||||
16, 17, 18, 18, 19, 16, // Right
|
16, 17, 18, 18, 19, 16, // Right
|
||||||
20, 21, 22, 22, 23, 20 // Left
|
20, 21, 22, 22, 23, 20 // Left
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ static bool Lesson7_Init(NeHeContext* restrict ctx)
|
|||||||
});
|
});
|
||||||
SDL_ReleaseGPUShader(ctx->device, fragmentShaderLight);
|
SDL_ReleaseGPUShader(ctx->device, fragmentShaderLight);
|
||||||
SDL_ReleaseGPUShader(ctx->device, vertexShaderLight);
|
SDL_ReleaseGPUShader(ctx->device, vertexShaderLight);
|
||||||
if (!psoUnlit)
|
if (!psoLight)
|
||||||
{
|
{
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_CreateGPUGraphicsPipeline: %s", SDL_GetError());
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_CreateGPUGraphicsPipeline: %s", SDL_GetError());
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -386,7 +386,6 @@ bool NeHe_LoadShaders(NeHeContext* restrict ctx,
|
|||||||
SDL_GPUShader** restrict outFragment,
|
SDL_GPUShader** restrict outFragment,
|
||||||
const char* restrict name,
|
const char* restrict name,
|
||||||
const NeHeShaderProgramCreateInfo* restrict info)
|
const NeHeShaderProgramCreateInfo* restrict info)
|
||||||
//unsigned vertexUniforms, unsigned fragmentSamplers, unsigned vertexStorage)
|
|
||||||
{
|
{
|
||||||
SDL_GPUShader *vtxShader = NULL, *frgShader = NULL;
|
SDL_GPUShader *vtxShader = NULL, *frgShader = NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ vertex Vertex2Fragment VertexMain(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fragment half4 FragmentMain(
|
fragment half4 FragmentMain(
|
||||||
Vertex2Fragment in [[stage_in]],
|
Vertex2Fragment in [[stage_in]],
|
||||||
metal::texture2d<half, metal::access::sample> texture [[texture(0)]],
|
metal::texture2d<half, metal::access::sample> texture [[texture(0)]],
|
||||||
metal::sampler sampler [[sampler(0)]])
|
metal::sampler sampler [[sampler(0)]])
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user