Skip to content

Commit fc65f1b

Browse files
committed
Revert "cmake: Add hardware renderer source"
This reverts commit 97971ee.
1 parent 97971ee commit fc65f1b

File tree

3 files changed

+10
-22
lines changed

3 files changed

+10
-22
lines changed

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ cmake_minimum_required(VERSION 3.16...4.0)
55
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
66

77
set(WIN_ICON ${CMAKE_CURRENT_SOURCE_DIR}/res/iris.rc)
8-
set(OSX_ICON ${CMAKE_CURRENT_SOURCE_DIR}/res/iris.icns)
98
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
109
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15")
10+
set(OSX_ICON ${CMAKE_CURRENT_SOURCE_DIR}/res/iris.icns)
1111
set_source_files_properties(${OSX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
1212

1313
if (CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64")
@@ -122,7 +122,6 @@ target_sources(iris PRIVATE
122122
src/gs/renderer/renderer.cpp
123123
src/gs/renderer/software.cpp
124124
src/gs/renderer/software_thread.cpp
125-
src/gs/renderer/hardware.cpp
126125
src/iop/bus.c
127126
src/iop/cdvd.c
128127
src/iop/disc.c
@@ -213,8 +212,8 @@ message(STATUS "CMake System Name: ${CMAKE_SYSTEM_NAME}")
213212
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
214213
# tell Install about the target, otherwise fixup won't know about the transitive dependencies
215214
install(TARGETS iris
216-
BUNDLE DESTINATION ./install COMPONENT Runtime
217-
RUNTIME DESTINATION ./install/bin COMPONENT Runtime
215+
BUNDLE DESTINATION ./install COMPONENT Runtime
216+
RUNTIME DESTINATION ./install/bin COMPONENT Runtime
218217
)
219218

220219
set(DEP_DIR "${CMAKE_BINARY_DIR}") # where to look for dependencies when fixing up

src/gs/renderer/software_thread.cpp

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,7 @@ void software_thread_destroy(void* udata) {
422422
// release buffers
423423
SDL_ReleaseGPUBuffer(ctx->device, ctx->vertex_buffer);
424424
SDL_ReleaseGPUBuffer(ctx->device, ctx->index_buffer);
425-
SDL_ReleaseGPUSampler(ctx->device, ctx->sampler[0]);
426-
SDL_ReleaseGPUSampler(ctx->device, ctx->sampler[1]);
425+
SDL_ReleaseGPUSampler(ctx->device, ctx->sampler);
427426

428427
if (ctx->texture) SDL_ReleaseGPUTexture(ctx->device, ctx->texture);
429428

@@ -1529,26 +1528,16 @@ void software_thread_init(void* udata, struct ps2_gs* gs, SDL_Window* window, SD
15291528

15301529
ctx->index_buffer = SDL_CreateGPUBuffer(device, &ibci);
15311530

1532-
SDL_GPUSamplerCreateInfo nearest_sci = {
1533-
.min_filter = SDL_GPU_FILTER_NEAREST,
1534-
.mag_filter = SDL_GPU_FILTER_NEAREST,
1531+
SDL_GPUSamplerCreateInfo sci = {
1532+
.min_filter = ctx->bilinear ? SDL_GPU_FILTER_LINEAR : SDL_GPU_FILTER_NEAREST,
1533+
.mag_filter = ctx->bilinear ? SDL_GPU_FILTER_LINEAR : SDL_GPU_FILTER_NEAREST,
15351534
.mipmap_mode = SDL_GPU_SAMPLERMIPMAPMODE_NEAREST,
15361535
.address_mode_u = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
15371536
.address_mode_v = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
15381537
.address_mode_w = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
15391538
};
15401539

1541-
SDL_GPUSamplerCreateInfo linear_sci = {
1542-
.min_filter = SDL_GPU_FILTER_LINEAR,
1543-
.mag_filter = SDL_GPU_FILTER_LINEAR,
1544-
.mipmap_mode = SDL_GPU_SAMPLERMIPMAPMODE_NEAREST,
1545-
.address_mode_u = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
1546-
.address_mode_v = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
1547-
.address_mode_w = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
1548-
};
1549-
1550-
ctx->sampler[0] = SDL_CreateGPUSampler(ctx->device, &nearest_sci);
1551-
ctx->sampler[1] = SDL_CreateGPUSampler(ctx->device, &linear_sci);
1540+
ctx->sampler = SDL_CreateGPUSampler(ctx->device, &sci);
15521541
}
15531542

15541543
static inline void software_thread_vram_blit(struct ps2_gs* gs, software_thread_state* ctx) {
@@ -2833,7 +2822,7 @@ void software_thread_render(void* udata, SDL_GPUCommandBuffer* command_buffer, S
28332822

28342823
SDL_GPUTextureSamplerBinding tsb = {
28352824
.texture = ctx->texture,
2836-
.sampler = ctx->bilinear ? ctx->sampler[1] : ctx->sampler[0],
2825+
.sampler = ctx->sampler,
28372826
};
28382827

28392828
SDL_BindGPUFragmentSamplers(render_pass, 0, &tsb, 1);

src/gs/renderer/software_thread.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct software_thread_state {
4949
SDL_GPUBuffer* vertex_buffer = nullptr;
5050
SDL_GPUBuffer* index_buffer = nullptr;
5151
SDL_GPUTexture* texture = nullptr;
52-
SDL_GPUSampler* sampler[2] = { nullptr };
52+
SDL_GPUSampler* sampler = nullptr;
5353
SDL_GPUGraphicsPipeline* pipeline = nullptr;
5454

5555
// Context

0 commit comments

Comments
 (0)